sudoers_mode = @SUDOERS_MODE@
# Pass in paths and uid/gid + OS dependent defined
-DEFS = @OSDEFS@ -D_PATH_SUDO_SUDOERS=\"$(sudoersdir)/sudoers\" -D_PATH_SUDO_STMP=\"$(sudoersdir)/stmp\" -DSUDOERS_UID=$(sudoers_uid) -DSUDOERS_GID=$(sudoers_gid) -DSUDOERS_MODE=$(sudoers_mode)
+DEFS = @OSDEFS@ -D_PATH_SUDOERS=\"$(sudoersdir)/sudoers\" -D_PATH_SUDOERS_TMP=\"$(sudoersdir)/sudoers.tmp\" -DSUDOERS_UID=$(sudoers_uid) -DSUDOERS_GID=$(sudoers_gid) -DSUDOERS_MODE=$(sudoers_mode)
#### End of system configuration section. ####
Q) When I run "visudo" it says "sudoers file busy, try again later."
and doesn't do anything.
A) You have a stale sudoers temporary file. The default location is
- /etc/stmp. If you delete this file visudo will be happy again,
+ /etc/sudoers.tmp. If you delete this file visudo will be happy again,
but make sure to check that no one else is running visudo at
the time.
/* Become sudoers file owner */
set_perms(PERM_SUDOERS, 0);
- /* We opened _PATH_SUDO_SUDOERS in check_sudoers() so just rewind it. */
+ /* We opened _PATH_SUDOERS in check_sudoers() so just rewind it. */
rewind(sudoers_fp);
yyin = sudoers_fp;
yyout = stdout;
#endif /* _PATH_TTY */
/*
- * NOTE: _PATH_SUDO_SUDOERS is usually overriden by the Makefile.
+ * NOTE: _PATH_SUDOERS is usually overriden by the Makefile.
*/
-#ifndef _PATH_SUDO_SUDOERS
-#define _PATH_SUDO_SUDOERS "/etc/sudoers"
-#endif /* _PATH_SUDO_SUDOERS */
+#ifndef _PATH_SUDOERS
+#define _PATH_SUDOERS "/etc/sudoers"
+#endif /* _PATH_SUDOERS */
/*
- * NOTE: _PATH_SUDO_STMP is usually overriden by the Makefile.
- * _PATH_SUDO_STMP *MUST* be on the same partition
- * as _PATH_SUDO_SUDOERS!
+ * NOTE: _PATH_SUDOERS_TMP is usually overriden by the Makefile.
+ * _PATH_SUDOERS_TMP *MUST* be on the same partition
+ * as _PATH_SUDOERS!
*/
-#ifndef _PATH_SUDO_STMP
-#define _PATH_SUDO_STMP "/etc/stmp"
-#endif /* _PATH_SUDO_STMP */
+#ifndef _PATH_SUDOERS_TMP
+#define _PATH_SUDOERS_TMP "/etc/sudoers.tmp"
+#endif /* _PATH_SUDOERS_TMP */
/*
* The following paths are controlled via the configure script.
set_perms(PERM_USER, sudo_mode);
- check_sudoers(); /* check mode/owner on _PATH_SUDO_SUDOERS */
+ check_sudoers(); /* check mode/owner on _PATH_SUDOERS */
if (sudo_mode == MODE_KILL || sudo_mode == MODE_INVALIDATE) {
remove_timestamp((sudo_mode == MODE_KILL));
#endif /* DONT_LEAK_PATH_INFO */
case VALIDATE_ERROR:
- log_error(0, "parse error in %s around line %d", _PATH_SUDO_SUDOERS,
+ log_error(0, "parse error in %s around line %d", _PATH_SUDOERS,
errorlineno);
break;
* Only works if filesystem is readable/writable by root.
*/
set_perms(PERM_ROOT, 0);
- if ((rootstat = lstat(_PATH_SUDO_SUDOERS, &statbuf)) == 0 &&
+ if ((rootstat = lstat(_PATH_SUDOERS, &statbuf)) == 0 &&
SUDOERS_UID == statbuf.st_uid && SUDOERS_MODE != 0400 &&
(statbuf.st_mode & 0007777) == 0400) {
- if (chmod(_PATH_SUDO_SUDOERS, SUDOERS_MODE) == 0) {
+ if (chmod(_PATH_SUDOERS, SUDOERS_MODE) == 0) {
(void) fprintf(stderr, "%s: fixed mode on %s\n",
- Argv[0], _PATH_SUDO_SUDOERS);
+ Argv[0], _PATH_SUDOERS);
if (statbuf.st_gid != SUDOERS_GID) {
- if (!chown(_PATH_SUDO_SUDOERS,(uid_t) -1,SUDOERS_GID)) {
+ if (!chown(_PATH_SUDOERS,(uid_t) -1,SUDOERS_GID)) {
(void) fprintf(stderr, "%s: set group on %s\n",
- Argv[0], _PATH_SUDO_SUDOERS);
+ Argv[0], _PATH_SUDOERS);
statbuf.st_gid = SUDOERS_GID;
} else {
(void) fprintf(stderr,"%s: Unable to set group on %s: %s\n",
- Argv[0], _PATH_SUDO_SUDOERS, strerror(errno));
+ Argv[0], _PATH_SUDOERS, strerror(errno));
}
}
} else {
(void) fprintf(stderr, "%s: Unable to fix mode on %s: %s\n",
- Argv[0], _PATH_SUDO_SUDOERS, strerror(errno));
+ Argv[0], _PATH_SUDOERS, strerror(errno));
}
}
*/
set_perms(PERM_SUDOERS, 0);
- if (rootstat != 0 && lstat(_PATH_SUDO_SUDOERS, &statbuf) != 0)
- log_error(USE_ERRNO, "can't stat %s", _PATH_SUDO_SUDOERS);
+ if (rootstat != 0 && lstat(_PATH_SUDOERS, &statbuf) != 0)
+ log_error(USE_ERRNO, "can't stat %s", _PATH_SUDOERS);
else if (!S_ISREG(statbuf.st_mode))
- log_error(0, "%s is not a regular file", _PATH_SUDO_SUDOERS);
+ log_error(0, "%s is not a regular file", _PATH_SUDOERS);
else if ((statbuf.st_mode & 07777) != SUDOERS_MODE)
- log_error(0, "%s is mode 0%o, should be 0%o", _PATH_SUDO_SUDOERS,
+ log_error(0, "%s is mode 0%o, should be 0%o", _PATH_SUDOERS,
(statbuf.st_mode & 07777), SUDOERS_MODE);
else if (statbuf.st_uid != SUDOERS_UID)
- log_error(0, "%s is owned by uid %ld, should be %d", _PATH_SUDO_SUDOERS,
+ log_error(0, "%s is owned by uid %ld, should be %d", _PATH_SUDOERS,
(long) statbuf.st_uid, SUDOERS_UID);
else if (statbuf.st_gid != SUDOERS_GID)
- log_error(0, "%s is owned by gid %ld, should be %d", _PATH_SUDO_SUDOERS,
+ log_error(0, "%s is owned by gid %ld, should be %d", _PATH_SUDOERS,
(long) statbuf.st_gid, SUDOERS_GID);
else {
/* Solaris sometimes returns EAGAIN so try 10 times */
for (i = 0; i < 10 ; i++) {
errno = 0;
- if ((sudoers_fp = fopen(_PATH_SUDO_SUDOERS, "r")) == NULL ||
+ if ((sudoers_fp = fopen(_PATH_SUDOERS, "r")) == NULL ||
fread(&c, sizeof(c), 1, sudoers_fp) != 1) {
sudoers_fp = NULL;
if (errno != EAGAIN && errno != EWOULDBLOCK)
sleep(1);
}
if (sudoers_fp == NULL)
- log_error(USE_ERRNO, "can't open %s", _PATH_SUDO_SUDOERS);
+ log_error(USE_ERRNO, "can't open %s", _PATH_SUDOERS);
}
set_perms(PERM_ROOT, 0);
char **Argv;
char **NewArgv = NULL;
int NewArgc = 0;
-char *sudoers = _PATH_SUDO_SUDOERS;
-char *stmp = _PATH_SUDO_STMP;
+char *sudoers = _PATH_SUDOERS;
+char *stmp = _PATH_SUDOERS_TMP;
struct sudo_user sudo_user;
int parse_error = FALSE;
E\bE\bE\bER\bR\bR\bRR\bR\bR\bRO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
sudoers file busy, try again later.
Either someone is currently editing the _\bs_\bu_\bd_\bo_\be_\br_\bs file
- or there is a stale sudoers lock file (/etc/stmp by
- default) that you need to delete.
+ or there is a stale sudoers lock file
+ (/etc/sudoers.tmp by default) that you need to delete.
- /etc/stmp: Permission denied
+ /etc/sudoers.tmp: Permission denied
You didn't run v\bv\bv\bvi\bi\bi\bis\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo as root.
Can't find you in the passwd database
F\bF\bF\bFI\bI\bI\bIL\bL\bL\bLE\bE\bE\bES\bS\bS\bS
/etc/sudoers List of who can run what
- /etc/stmp Lock file for visudo
+ /etc/sudoers.tmp Lock file for visudo
-1/Aug/1999 1.6 1
+6/Aug/1999 1.6 1
-1/Aug/1999 1.6 2
+6/Aug/1999 1.6 2
-1/Aug/1999 1.6 3
+6/Aug/1999 1.6 3
<DL>
<DT><STRONG><A NAME="item_sudoers">sudoers file busy, try again later.</A></STRONG><DD>
<P>
-Either someone is currently editing the <EM>sudoers</EM> file or there is a stale sudoers lock file (/etc/stmp by default) that you
-need to delete.
+Either someone is currently editing the <EM>sudoers</EM> file or there is a stale sudoers lock file (/etc/sudoers.tmp by default)
+that you need to delete.
-<DT><STRONG><A NAME="item__etc_stmp_">/etc/stmp: Permission denied</A></STRONG><DD>
+<DT><STRONG><A NAME="item__etc_sudoers_tmp_">/etc/sudoers.tmp: Permission denied</A></STRONG><DD>
<P>
You didn't run <STRONG>visudo</STRONG> as root.
<H1><A NAME="FILES">FILES</A></H1>
<P>
-<PRE> /etc/sudoers file of authorized users.
- /etc/stmp lock file for visudo.
+<PRE> /etc/sudoers List of who can run what
+ /etc/sudoers.tmp Lock file for visudo
</PRE>
<H1><A NAME="ENVIRONMENT_VARIABLES">ENVIRONMENT VARIABLES</A></H1>
<P>
-The following are used only if <STRONG>visudo</STRONG> was compiled with the
-<EM>ENV_EDITOR</EM> option:
+The following are used only if <STRONG>visudo</STRONG> was configured with the
+<EM>--with-env-editor</EM> option:
<P>
-<PRE> EDITOR Used by visudo as the editor to use.
- VISUAL Used by visudo if EDITOR is not set.
+<PRE> EDITOR Used by visudo as the editor to use
+ VISUAL Used by visudo if EDITOR is not set
</PRE>
<H1><A NAME="AUTHOR">AUTHOR</A></H1>
<P>
<P>
Please send all bugs, comments, and changes to <A
-HREF="mailto:sudo-bugs@courtesan.com.">sudo-bugs@courtesan.com.</A>
+HREF="mailto:sudo-bugs@courtesan.com.">sudo-bugs@courtesan.com.</A> Be sure
+to include the version of <STRONG>sudo</STRONG> you are using and the platform you are running it on.
<H1><A NAME="DISCLAIMER">DISCLAIMER</A></H1>
<P>
-This program is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file distributed with
-sudo for more details.
+<STRONG>Visudo</STRONG> is provided ``AS IS'' and any express or implied warranties, including, but
+not limited to, the implied warranties of merchantability and fitness for a
+particular purpose are disclaimed. See the LICENSE file distributed with <STRONG>sudo</STRONG> for complete details.
<H1><A NAME="CAVEATS">CAVEATS</A></H1>
<P>
-Due to the syntax of the <EM>sudoers</EM> file, there is no way for <STRONG>visudo</STRONG> to tell the difference between a mistyped {Host,User,Cmnd}_Alias and a user
+Due to the syntax of the <EM>sudoers</EM> file, there is no way for
+<STRONG>visudo</STRONG> to tell the difference between a mistyped {Host,User,Cmnd}_Alias and a user
or host name.
<P>
''' $RCSfile$$Revision$$Date$
'''
''' $Log$
-''' Revision 1.8 1999/08/01 16:26:16 millert
-''' regen
+''' Revision 1.9 1999/08/06 09:37:02 millert
+''' o /etc/stmp -> /etc/sudoers.tmp since solaris uses stmp as shadow temp file
+''' o _PATH_SUDO_SUDOERS -> _PATH_SUDOERS and _PATH_SUDO_STMP -> _PATH_SUDOERS_TMP
'''
'''
.de Sh
.nr % 0
.rr F
.\}
-.TH VISUDO 8 "1.6" "1/Aug/1999" "MAINTENANCE COMMANDS"
+.TH VISUDO 8 "1.6" "6/Aug/1999" "MAINTENANCE COMMANDS"
.UC
.if n .hy 0
.if n .na
.SH "ERRORS"
.Ip "sudoers file busy, try again later." 4
Either someone is currently editing the \fIsudoers\fR file
-or there is a stale sudoers lock file (/etc/stmp by default)
+or there is a stale sudoers lock file (/etc/sudoers.tmp by default)
that you need to delete.
-.Ip "/etc/stmp: Permission denied" 4
+.Ip "/etc/sudoers.tmp: Permission denied" 4
You didn't run \fBvisudo\fR as root.
.Ip "Can't find you in the passwd database" 4
Your userid does not appear in the passwd file.
.Sp
.Vb 2
\& /etc/sudoers List of who can run what
-\& /etc/stmp Lock file for visudo
+\& /etc/sudoers.tmp Lock file for visudo
.Ve
.SH "ENVIRONMENT VARIABLES"
The following are used only if \fBvisudo\fR was configured with the
.IX Item "sudoers file busy, try again later."
-.IX Item "/etc/stmp: Permission denied"
+.IX Item "/etc/sudoers.tmp: Permission denied"
.IX Item "Can't find you in the passwd database"
=item sudoers file busy, try again later.
Either someone is currently editing the I<sudoers> file
-or there is a stale sudoers lock file (/etc/stmp by default)
+or there is a stale sudoers lock file (/etc/sudoers.tmp by default)
that you need to delete.
-=item /etc/stmp: Permission denied
+=item /etc/sudoers.tmp: Permission denied
You didn't run B<visudo> as root.
=head1 FILES
/etc/sudoers List of who can run what
- /etc/stmp Lock file for visudo
+ /etc/sudoers.tmp Lock file for visudo
=head1 ENVIRONMENT VARIABLES