]> granicus.if.org Git - sudo/commitdiff
bzero -> memset
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 30 Mar 1995 02:47:00 +0000 (02:47 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 30 Mar 1995 02:47:00 +0000 (02:47 +0000)
when a parse error is logged the line number of the error is now logged
too

logging.c

index efca55496141af546860a4d91cfa310af086c210..56615f2f9e0303b600691b3bdcb6cbdefe7b2c86 100644 (file)
--- a/logging.c
+++ b/logging.c
@@ -74,6 +74,7 @@ static int appropriate                __P((int));
  * Globals
  */
 static char logline[MAXLOGLEN + 8];
+extern int errorlineno;
 
 
 /**********************************************************************
@@ -137,8 +138,8 @@ void log_error(code)
            break;
 
        case VALIDATE_ERROR:
-           (void) sprintf(p, "error in %s ; PWD=%s ; command: ",
-               _PATH_SUDO_SUDOERS, cwd);
+           (void) sprintf(p, "error in %s, line %d ; PWD=%s.  ",
+               _PATH_SUDO_SUDOERS, errorlineno, cwd);
 #if (LOGGING & SLOG_SYSLOG)
            pri = Syslog_priority_NO;
 #endif /* LOGGING & SLOG_SYSLOG */
@@ -204,9 +205,10 @@ void log_error(code)
 
 
     /*
-     * if this error is from load_globals() don't put  argv in the message
+     * If this is a parse error or if the error is from load_globals()
+     * don't put  argv in the message.
      */
-    if (!(code & GLOBAL_PROBLEM)) {
+    if (code != VALIDATE_ERROR && !(code & GLOBAL_PROBLEM)) {
 
        strcat(logline, cmnd);  /* stuff the command into the logline */
        strcat(logline, " ");
@@ -377,7 +379,7 @@ static void send_mail()
 #ifdef POSIX_SIGNALS
     struct sigaction action;
 
-    (void) bzero((char *)(&action), sizeof(action));
+    (void) memset((VOID *)&action, 0, sizeof(action));
 #endif /* POSIX_SIGNALS */
 
     if ((mailer = find_path(MAILER)) == NULL) {