Blame SOURCES/sudo-1.8.6p7-logsudouser.patch

a67eaf
diff -up sudo-1.8.6p7/plugins/sudoers/logging.c.logsudouser sudo-1.8.6p7/plugins/sudoers/logging.c
a67eaf
--- sudo-1.8.6p7/plugins/sudoers/logging.c.logsudouser	2013-02-25 20:46:09.000000000 +0100
a67eaf
+++ sudo-1.8.6p7/plugins/sudoers/logging.c	2016-05-09 16:24:10.831703862 +0200
a67eaf
@@ -146,7 +146,7 @@ do_syslog(int pri, char *msg)
a67eaf
      * Log the full line, breaking into multiple syslog(3) calls if necessary
a67eaf
      */
a67eaf
     fmt = _(FMT_FIRST);
a67eaf
-    maxlen = MAXSYSLOGLEN - (strlen(fmt) - 5 + strlen(user_name));
a67eaf
+    maxlen = MAXSYSLOGLEN - (strlen(fmt) - 5 + strlen(sudo_user_name));
a67eaf
     for (p = msg; *p != '\0'; ) {
a67eaf
 	len = strlen(p);
a67eaf
 	if (len > maxlen) {
a67eaf
@@ -162,7 +162,7 @@ do_syslog(int pri, char *msg)
a67eaf
 	    save = *tmp;
a67eaf
 	    *tmp = '\0';
a67eaf
 
a67eaf
-	    mysyslog(pri, fmt, user_name, p);
a67eaf
+	    mysyslog(pri, fmt, sudo_user_name, p);
a67eaf
 
a67eaf
 	    *tmp = save;			/* restore saved character */
a67eaf
 
a67eaf
@@ -170,11 +170,11 @@ do_syslog(int pri, char *msg)
a67eaf
 	    for (p = tmp; *p == ' '; p++)
a67eaf
 		;
a67eaf
 	} else {
a67eaf
-	    mysyslog(pri, fmt, user_name, p);
a67eaf
+	    mysyslog(pri, fmt, sudo_user_name, p);
a67eaf
 	    p += len;
a67eaf
 	}
a67eaf
 	fmt = _(FMT_CONTD);
a67eaf
-	maxlen = MAXSYSLOGLEN - (strlen(fmt) - 5 + strlen(user_name));
a67eaf
+	maxlen = MAXSYSLOGLEN - (strlen(fmt) - 5 + strlen(sudo_user_name));
a67eaf
     }
a67eaf
 
a67eaf
 #ifdef HAVE_SETLOCALE
a67eaf
@@ -216,17 +216,17 @@ do_logfile(char *msg)
a67eaf
 	    /* Don't pretty-print long log file lines (hard to grep) */
a67eaf
 	    if (def_log_host)
a67eaf
 		(void) fprintf(fp, "%s : %s : HOST=%s : %s\n",
a67eaf
-		    get_timestr(now, def_log_year), user_name, user_shost, msg);
a67eaf
+		    get_timestr(now, def_log_year), sudo_user_name, user_shost, msg);
a67eaf
 	    else
a67eaf
 		(void) fprintf(fp, "%s : %s : %s\n",
a67eaf
-		    get_timestr(now, def_log_year), user_name, msg);
a67eaf
+		    get_timestr(now, def_log_year), sudo_user_name, msg);
a67eaf
 	} else {
a67eaf
 	    if (def_log_host)
a67eaf
 		len = easprintf(&full_line, "%s : %s : HOST=%s : %s",
a67eaf
-		    get_timestr(now, def_log_year), user_name, user_shost, msg);
a67eaf
+		    get_timestr(now, def_log_year), sudo_user_name, user_shost, msg);
a67eaf
 	    else
a67eaf
 		len = easprintf(&full_line, "%s : %s : %s",
a67eaf
-		    get_timestr(now, def_log_year), user_name, msg);
a67eaf
+		    get_timestr(now, def_log_year), sudo_user_name, msg);
a67eaf
 
a67eaf
 	    /*
a67eaf
 	     * Print out full_line with word wrap around def_loglinelen chars.
a67eaf
@@ -689,7 +689,7 @@ send_mail(const char *fmt, ...)
a67eaf
 #endif /* HAVE_NL_LANGINFO */
a67eaf
 
a67eaf
     (void) fprintf(mail, "\n\n%s : %s : %s : ", user_host,
a67eaf
-	get_timestr(time(NULL), def_log_year), user_name);
a67eaf
+	get_timestr(time(NULL), def_log_year), sudo_user_name);
a67eaf
     va_start(ap, fmt);
a67eaf
     (void) vfprintf(mail, fmt, ap);
a67eaf
     va_end(ap);
a67eaf
diff -up sudo-1.8.6p7/plugins/sudoers/sudoers.h.logsudouser sudo-1.8.6p7/plugins/sudoers/sudoers.h
a67eaf
--- sudo-1.8.6p7/plugins/sudoers/sudoers.h.logsudouser	2016-05-09 16:24:10.815704088 +0200
a67eaf
+++ sudo-1.8.6p7/plugins/sudoers/sudoers.h	2016-05-09 16:24:10.831703862 +0200
a67eaf
@@ -171,6 +171,7 @@ struct sudo_user {
a67eaf
 /*
a67eaf
  * Shortcuts for sudo_user contents.
a67eaf
  */
a67eaf
+#define sudo_user_name		(sudo_user.pw->pw_name)
a67eaf
 #define user_name		(sudo_user.name)
a67eaf
 #define user_uid		(sudo_user.uid)
a67eaf
 #define user_gid		(sudo_user.gid)