no longer uses cmnd_args, now uses NewArgv instead.

This commit is contained in:
Todd C. Miller
1996-02-02 03:34:00 +00:00
parent bfacbff723
commit d386132788

View File

@@ -131,6 +131,7 @@ void log_error(code)
int code; int code;
{ {
char *p; char *p;
char **a;
int count; int count;
time_t now; time_t now;
#if (LOGGING & SLOG_FILE) #if (LOGGING & SLOG_FILE)
@@ -147,8 +148,8 @@ void log_error(code)
* XXX - don't use 33, use a macro! * XXX - don't use 33, use a macro!
*/ */
count = 33 + 128 + 2 * MAXPATHLEN + strlen(tty) + strlen(cwd); count = 33 + 128 + 2 * MAXPATHLEN + strlen(tty) + strlen(cwd);
if (cmnd_args) for (a = &NewArgv[1]; *a; a++)
count += strlen(cmnd_args); count += strlen(*a) + 1;
logline = (char *) malloc(count); logline = (char *) malloc(count);
if (logline == NULL) { if (logline == NULL) {
@@ -287,8 +288,8 @@ void log_error(code)
/* XXX - this could be sped up */ /* XXX - this could be sped up */
strcat(logline, cmnd); strcat(logline, cmnd);
strcat(logline, " "); strcat(logline, " ");
if (cmnd_args) { for (a = &NewArgv[1]; *a; a++) {
strcat(logline, cmnd_args); strcat(logline, *a);
strcat(logline, " "); strcat(logline, " ");
} }
} }
@@ -535,6 +536,7 @@ static RETSIGTYPE reapchild(sig)
void inform_user(code) void inform_user(code)
int code; int code;
{ {
char **a;
switch (code) { switch (code) {
case VALIDATE_NO_USER: case VALIDATE_NO_USER:
@@ -544,14 +546,16 @@ void inform_user(code)
break; break;
case VALIDATE_NOT_OK: case VALIDATE_NOT_OK:
if (cmnd_args) (void) fprintf(stderr,
(void) fprintf(stderr, "Sorry, user %s is not allowed to execute \"%s",
"Sorry, user %s is not allowed to execute \"%s %s\" on %s.\n\n", user_name, cmnd);
user_name, cmnd, cmnd_args, host);
else for (a = &NewArgv[1]; *a; a++) {
(void) fprintf(stderr, fputc(' ', stderr);
"Sorry, user %s is not allowed to execute \"%s\" on %s.\n\n", fputs(*a, stderr);
user_name, cmnd, host); }
(void) fprintf(stderr, "\" on %s.\n\n", host);
break; break;
case VALIDATE_ERROR: case VALIDATE_ERROR: