From: Todd C. Miller Date: Fri, 6 Aug 1999 09:37:03 +0000 (+0000) Subject: o /etc/stmp -> /etc/sudoers.tmp since solaris uses stmp as shadow temp file X-Git-Tag: SUDO_1_6_0~152 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=145992dce23f95af98140872d4d159029eddbc31;p=sudo 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 --- diff --git a/Makefile.in b/Makefile.in index 0c00c937c..575cc6d57 100644 --- a/Makefile.in +++ b/Makefile.in @@ -100,7 +100,7 @@ sudoers_gid = @SUDOERS_GID@ 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. #### diff --git a/TROUBLESHOOTING b/TROUBLESHOOTING index daab4032c..1f68b4569 100644 --- a/TROUBLESHOOTING +++ b/TROUBLESHOOTING @@ -121,7 +121,7 @@ A) You probably didn't install the gcc-fixed include files. 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. diff --git a/parse.c b/parse.c index 005958b5e..b05c6844c 100644 --- a/parse.c +++ b/parse.c @@ -119,7 +119,7 @@ sudoers_lookup(check_cmnd) /* 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; diff --git a/pathnames.h.in b/pathnames.h.in index 009eff9cf..30e0f71b9 100644 --- a/pathnames.h.in +++ b/pathnames.h.in @@ -51,20 +51,20 @@ #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. diff --git a/sudo.c b/sudo.c index 0e100d061..435aa47c4 100644 --- a/sudo.c +++ b/sudo.c @@ -251,7 +251,7 @@ main(argc, argv) 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)); @@ -359,7 +359,7 @@ main(argc, argv) #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; @@ -765,26 +765,26 @@ check_sudoers() * 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)); } } @@ -795,24 +795,24 @@ check_sudoers() */ 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) @@ -822,7 +822,7 @@ check_sudoers() 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); diff --git a/visudo.c b/visudo.c index 6f50c17d2..491e4e85a 100644 --- a/visudo.c +++ b/visudo.c @@ -108,8 +108,8 @@ extern int errorlineno; 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; diff --git a/visudo.cat b/visudo.cat index 7a44e3871..662fafafa 100644 --- a/visudo.cat +++ b/visudo.cat @@ -46,10 +46,10 @@ OOOOPPPPTTTTIIIIOOOONNNNSSSS EEEERRRRRRRROOOORRRRSSSS sudoers file busy, try again later. Either someone is currently editing the _s_u_d_o_e_r_s 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 vvvviiiissssuuuuddddoooo as root. Can't find you in the passwd database @@ -57,11 +57,11 @@ EEEERRRRRRRROOOORRRRSSSS FFFFIIIILLLLEEEESSSS /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 @@ -127,7 +127,7 @@ SSSSEEEEEEEE AAAALLLLSSSSOOOO -1/Aug/1999 1.6 2 +6/Aug/1999 1.6 2 @@ -193,6 +193,6 @@ VISUDO(8) MAINTENANCE COMMANDS VISUDO(8) -1/Aug/1999 1.6 3 +6/Aug/1999 1.6 3 diff --git a/visudo.html b/visudo.html index 7fbc65263..f8673ae7f 100644 --- a/visudo.html +++ b/visudo.html @@ -77,10 +77,10 @@ The -V (version) option causes visudo to print the
sudoers file busy, try again later.

-Either someone is currently editing the sudoers file or there is a stale sudoers lock file (/etc/stmp by default) that you -need to delete. +Either someone is currently editing the sudoers file 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 visudo as root. @@ -90,17 +90,17 @@ Your userid does not appear in the passwd file.

FILES

-

 /etc/sudoers           file of authorized users.
- /etc/stmp              lock file for visudo.
+
 /etc/sudoers           List of who can run what
+ /etc/sudoers.tmp       Lock file for visudo
 

ENVIRONMENT VARIABLES

-The following are used only if visudo was compiled with the -ENV_EDITOR option: +The following are used only if visudo was configured with the +--with-env-editor option:

-

 EDITOR                 Used by visudo as the editor to use.
- VISUAL                 Used by visudo if EDITOR is not set.
+
 EDITOR                 Used by visudo as the editor to use
+ VISUAL                 Used by visudo if EDITOR is not set
 

AUTHOR

@@ -115,18 +115,19 @@ See the HISTORY file in the sudo distribution for more details.

Please send all bugs, comments, and changes to sudo-bugs@courtesan.com. +HREF="mailto:sudo-bugs@courtesan.com.">sudo-bugs@courtesan.com. Be sure +to include the version of sudo you are using and the platform you are running it on.

DISCLAIMER

-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. +Visudo 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 sudo for complete details.

CAVEATS

-Due to the syntax of the sudoers file, there is no way for visudo to tell the difference between a mistyped {Host,User,Cmnd}_Alias and a user +Due to the syntax of the sudoers file, there is no way for +visudo to tell the difference between a mistyped {Host,User,Cmnd}_Alias and a user or host name.

diff --git a/visudo.man b/visudo.man index b928e59bc..ba1542b13 100644 --- a/visudo.man +++ b/visudo.man @@ -2,8 +2,9 @@ ''' $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 @@ -96,7 +97,7 @@ .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 @@ -226,9 +227,9 @@ and exit. .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. @@ -236,7 +237,7 @@ 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 @@ -294,7 +295,7 @@ the individual \fBvisudo\fR program. .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" diff --git a/visudo.pod b/visudo.pod index 14947a6c9..60fd0223a 100644 --- a/visudo.pod +++ b/visudo.pod @@ -89,10 +89,10 @@ and exit. =item sudoers file busy, try again later. Either someone is currently editing the I 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 as root. @@ -103,7 +103,7 @@ Your userid does not appear in the passwd file. =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