Blame SOURCES/sudo-1.8.23-fix_empty_username_in_do_syslog.patch
|
|
e6a6c6 |
diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c
|
|
|
e6a6c6 |
index 2c685cd..7751a67 100644
|
|
|
e6a6c6 |
--- a/plugins/sudoers/logging.c
|
|
|
e6a6c6 |
+++ b/plugins/sudoers/logging.c
|
|
|
e6a6c6 |
@@ -106,7 +106,15 @@ do_syslog(int pri, char *msg)
|
|
|
e6a6c6 |
* Log the full line, breaking into multiple syslog(3) calls if necessary
|
|
|
e6a6c6 |
*/
|
|
|
e6a6c6 |
fmt = _("%8s : %s");
|
|
|
e6a6c6 |
- maxlen = def_syslog_maxlen - (strlen(fmt) - 5 + strlen(sudo_user_name));
|
|
|
e6a6c6 |
+
|
|
|
e6a6c6 |
+
|
|
|
e6a6c6 |
+ if (!sudo_user_name) {
|
|
|
e6a6c6 |
+ maxlen = def_syslog_maxlen - (strlen(fmt) - 5);
|
|
|
e6a6c6 |
+ }
|
|
|
e6a6c6 |
+ else {
|
|
|
e6a6c6 |
+ maxlen = def_syslog_maxlen - (strlen(fmt) - 5 + strlen(sudo_user_name));
|
|
|
e6a6c6 |
+ }
|
|
|
e6a6c6 |
+
|
|
|
e6a6c6 |
for (p = msg; *p != '\0'; ) {
|
|
|
e6a6c6 |
len = strlen(p);
|
|
|
e6a6c6 |
if (len > maxlen) {
|
|
|
e6a6c6 |
@@ -122,7 +130,12 @@ do_syslog(int pri, char *msg)
|
|
|
e6a6c6 |
save = *tmp;
|
|
|
e6a6c6 |
*tmp = '\0';
|
|
|
e6a6c6 |
|
|
|
e6a6c6 |
- mysyslog(pri, fmt, sudo_user_name, p);
|
|
|
e6a6c6 |
+ if(!sudo_user_name) {
|
|
|
e6a6c6 |
+ mysyslog(pri, fmt, "NaN", p);
|
|
|
e6a6c6 |
+ }
|
|
|
e6a6c6 |
+ else{
|
|
|
e6a6c6 |
+ mysyslog(pri, fmt, sudo_user_name, p);
|
|
|
e6a6c6 |
+ }
|
|
|
e6a6c6 |
|
|
|
e6a6c6 |
*tmp = save; /* restore saved character */
|
|
|
e6a6c6 |
|