now uses user_pw_ent and simple macros to get at the contents

This commit is contained in:
Todd C. Miller
1995-11-24 02:27:27 +00:00
parent 57a4342e7d
commit d6a223e2a2
7 changed files with 61 additions and 62 deletions

View File

@@ -159,8 +159,7 @@ void log_error(code)
* necesary for mail and file logs.
*/
now = time((time_t) 0);
(void) sprintf(logline, "%19.19s : %8.8s : ", ctime(&now),
sudo_pw_ent->pw_name);
(void) sprintf(logline, "%19.19s : %8.8s : ", ctime(&now), user_name);
/*
* we need a pointer to the end of logline (XXX - use a #define not 33)
@@ -194,7 +193,7 @@ void log_error(code)
case GLOBAL_NO_PW_ENT:
(void) sprintf(p,
"There is no passwd entry for uid %ld (TTY=%s). ",
(long) sudo_pw_ent->pw_uid, tty);
(long) user_uid, tty);
break;
case PASSWORD_NOT_CORRECT:
@@ -319,10 +318,9 @@ void log_error(code)
*tmp = '\0';
if (count == 0)
syslog(pri, "%8.8s : %s", sudo_pw_ent->pw_name, p);
syslog(pri, "%8.8s : %s", user_name, p);
else
syslog(pri, "%8.8s : (command continued) %s",
sudo_pw_ent->pw_name, p);
syslog(pri, "%8.8s : (command continued) %s", user_name, p);
*tmp = save; /* restore saved character */
@@ -331,10 +329,9 @@ void log_error(code)
;
} else {
if (count == 0)
syslog(pri, "%8.8s : %s", sudo_pw_ent->pw_name, p);
syslog(pri, "%8.8s : %s", user_name, p);
else
syslog(pri, "%8.8s : (command continued) %s",
sudo_pw_ent->pw_name, p);
syslog(pri, "%8.8s : (command continued) %s", user_name, p);
}
}
closelog();
@@ -540,18 +537,18 @@ void inform_user(code)
case VALIDATE_NO_USER:
(void) fprintf(stderr,
"%s is not in the sudoers file. This incident will be reported.\n\n",
sudo_pw_ent->pw_name);
user_name);
break;
case VALIDATE_NOT_OK:
if (cmnd_args)
(void) fprintf(stderr,
"Sorry, user %s is not allowed to execute \"%s %s\" on %s.\n\n",
sudo_pw_ent->pw_name, cmnd, cmnd_args, host);
user_name, cmnd, cmnd_args, host);
else
(void) fprintf(stderr,
"Sorry, user %s is not allowed to execute \"%s\" on %s.\n\n",
sudo_pw_ent->pw_name, cmnd, host);
user_name, cmnd, host);
break;
case VALIDATE_ERROR: