]> git.saurik.com Git - apple/syslog.git/commitdiff
syslog-323.50.1.tar.gz os-x-10115 os-x-10116 v323.50.1
authorApple <opensource@apple.com>
Wed, 24 Feb 2016 22:04:52 +0000 (22:04 +0000)
committerApple <opensource@apple.com>
Wed, 24 Feb 2016 22:04:52 +0000 (22:04 +0000)
syslogd.tproj/asl_action.c
syslogd.tproj/daemon.c

index ca0d19d713577a8169ee20388190440a7d2f5fbd..249321a6bda6cbc07e19d3a3a081f82c8fe888f6 100644 (file)
@@ -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;
        }
index 8a3022283bcbabbc8921895bfb66934505d3a6a8..83912fb9c358f267ba68c386d65360e81f3cb1f8 100644 (file)
@@ -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)