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

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