Blame SOURCES/audit-3.0-user-event.patch

cfbdc8
diff --git a/src/auditctl.c b/src/auditctl.c
cfbdc8
index ac08e47..1150911 100644
cfbdc8
--- a/src/auditctl.c
cfbdc8
+++ b/src/auditctl.c
cfbdc8
@@ -809,6 +809,7 @@ static int setopt(int count, int lineno, char *vars[])
cfbdc8
 			retval = -1;
cfbdc8
 		} else {
cfbdc8
 			const char*s = optarg;
cfbdc8
+			char *umsg;
cfbdc8
 			while (*s) {
cfbdc8
 				if (*s < 32) {
cfbdc8
 					audit_msg(LOG_ERR,
cfbdc8
@@ -817,11 +818,18 @@ static int setopt(int count, int lineno, char *vars[])
cfbdc8
 				}
cfbdc8
 				s++;
cfbdc8
 			}
cfbdc8
+			if (asprintf(&umsg, "text=%s", optarg) < 0) {
cfbdc8
+				audit_msg(LOG_ERR, "Can't create user event");
cfbdc8
+				return -1;
cfbdc8
+			}
cfbdc8
 			if (audit_log_user_message( fd, AUDIT_USER,
cfbdc8
-					optarg, NULL, NULL, NULL, 1) <= 0)
cfbdc8
-			retval = -1;
cfbdc8
-		else
cfbdc8
-			return -2;  // success - no reply for this
cfbdc8
+					umsg, NULL, NULL, NULL, 1) <= 0)
cfbdc8
+				retval = -1;
cfbdc8
+			else {
cfbdc8
+				free(umsg);
cfbdc8
+				return -2;  // success - no reply for this
cfbdc8
+			}
cfbdc8
+			free(umsg);
cfbdc8
 		}
cfbdc8
 		break;
cfbdc8
 	case 'R':