cmnd_args is now exported from sudo.[ch]
This commit is contained in:
19
logging.c
19
logging.c
@@ -135,7 +135,7 @@ static void syslog_wrapper(pri, fmt, arg1, arg2)
|
|||||||
void log_error(code)
|
void log_error(code)
|
||||||
int code;
|
int code;
|
||||||
{
|
{
|
||||||
char *p, *cmnd_args = NULL;
|
char *p;
|
||||||
int count;
|
int count;
|
||||||
time_t now;
|
time_t now;
|
||||||
#if (LOGGING & SLOG_FILE)
|
#if (LOGGING & SLOG_FILE)
|
||||||
@@ -147,14 +147,6 @@ void log_error(code)
|
|||||||
char *tmp, save;
|
char *tmp, save;
|
||||||
#endif /* LOGGING & SLOG_SYSLOG */
|
#endif /* LOGGING & SLOG_SYSLOG */
|
||||||
|
|
||||||
/* Get the command line args from the environment */
|
|
||||||
if (NewArgc > 1 && (cmnd_args = getenv("SUDO_COMMAND"))) {
|
|
||||||
if ((cmnd_args = strchr(cmnd_args, ' ')))
|
|
||||||
cmnd_args++;
|
|
||||||
else
|
|
||||||
cmnd_args = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Allocate enough memory for logline so we won't overflow it
|
* Allocate enough memory for logline so we won't overflow it
|
||||||
*/
|
*/
|
||||||
@@ -552,8 +544,6 @@ static RETSIGTYPE reapchild(sig)
|
|||||||
void inform_user(code)
|
void inform_user(code)
|
||||||
int code;
|
int code;
|
||||||
{
|
{
|
||||||
char *cmnd_args = NULL;
|
|
||||||
|
|
||||||
switch (code) {
|
switch (code) {
|
||||||
case VALIDATE_NO_USER:
|
case VALIDATE_NO_USER:
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
@@ -562,13 +552,6 @@ void inform_user(code)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VALIDATE_NOT_OK:
|
case VALIDATE_NOT_OK:
|
||||||
if (NewArgc > 1 && (cmnd_args = getenv("SUDO_COMMAND"))) {
|
|
||||||
if ((cmnd_args = strchr(cmnd_args, ' ')))
|
|
||||||
cmnd_args++;
|
|
||||||
else
|
|
||||||
cmnd_args = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
(void) fprintf(stderr,
|
(void) fprintf(stderr,
|
||||||
"Sorry, user %s is not allowed to execute \"%s",
|
"Sorry, user %s is not allowed to execute \"%s",
|
||||||
user_name, cmnd);
|
user_name, cmnd);
|
||||||
|
Reference in New Issue
Block a user