From ed18769501f7359c4c437714c48aa2d35ec21604 Mon Sep 17 00:00:00 2001 From: Apple Date: Wed, 24 Feb 2016 22:04:52 +0000 Subject: [PATCH] syslog-323.50.1.tar.gz --- syslogd.tproj/asl_action.c | 8 ++++---- syslogd.tproj/daemon.c | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/syslogd.tproj/asl_action.c b/syslogd.tproj/asl_action.c index ca0d19d..249321a 100644 --- a/syslogd.tproj/asl_action.c +++ b/syslogd.tproj/asl_action.c @@ -2325,7 +2325,6 @@ int asl_action_control_set_param(const char *s) { __block char **l; - __block char *p; uint32_t count = 0; if (s == NULL) return -1; @@ -2355,8 +2354,8 @@ asl_action_control_set_param(const char *s) /* create / modify a module */ if ((!strcasecmp(l[1], "define")) && (strcmp(l[0], "*"))) { - p = strdup(s); - if (p == NULL) + char *str = strdup(s); + if (str == NULL) { asldebug("asl_action_control_set_param: memory allocation failed\n"); free_string_list(l); @@ -2366,6 +2365,7 @@ asl_action_control_set_param(const char *s) dispatch_sync(asl_action_queue, ^{ asl_out_module_t *m; asl_out_rule_t *r; + char *p = str; /* skip name, whitespace, "define" */ while ((*p != ' ') && (*p != '\t')) p++; @@ -2394,7 +2394,7 @@ asl_action_control_set_param(const char *s) } }); - free(p); + free(str); free_string_list(l); return 0; } diff --git a/syslogd.tproj/daemon.c b/syslogd.tproj/daemon.c index 8a30222..83912fb 100644 --- a/syslogd.tproj/daemon.c +++ b/syslogd.tproj/daemon.c @@ -453,8 +453,6 @@ aslmsg_verify(asl_msg_t *msg, uint32_t source, int32_t *kern_post_level, uid_t * } } - if (uid_out != NULL) *uid_out = uid; - gid = -2; val = asl_msg_get_val_for_key(msg, ASL_KEY_GID); if (val == NULL) @@ -484,7 +482,6 @@ aslmsg_verify(asl_msg_t *msg, uint32_t source, int32_t *kern_post_level, uid_t * break; } - case SOURCE_UDP_SOCKET: case SOURCE_ASL_MESSAGE: case SOURCE_LAUNCHD: { @@ -507,6 +504,8 @@ aslmsg_verify(asl_msg_t *msg, uint32_t source, int32_t *kern_post_level, uid_t * } } + if (uid_out != NULL) *uid_out = uid; + /* Sender */ if (sval == NULL) sval = asl_msg_get_val_for_key(msg, ASL_KEY_SENDER); if (sval == NULL) -- 2.47.2