]> git.saurik.com Git - apple/syslog.git/commitdiff
syslog-349.30.2.tar.gz macos-10122 macos-10123 v349.30.2
authorApple <opensource@apple.com>
Sat, 29 Oct 2016 01:04:27 +0000 (01:04 +0000)
committerApple <opensource@apple.com>
Sat, 29 Oct 2016 01:04:27 +0000 (01:04 +0000)
.gitignore [new file with mode: 0644]
syslogd.tproj/asl_action.c
syslogd.tproj/daemon.h
syslogd.tproj/dbserver.c

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..5b1daa3
--- /dev/null
@@ -0,0 +1,13 @@
+.DS_Store
+/DerivedData
+
+# /
+/build
+
+# /syslog.xcodeproj/
+/syslog.xcodeproj/*.xcworkspace
+/syslog.xcodeproj/xcuserdata
+/syslog.xcodeproj/*.mode1v3
+/syslog.xcodeproj/*.mode2v3
+/syslog.xcodeproj/*.pbxuser
+/syslog.xcodeproj/*.perspectivev3
index 249321a6bda6cbc07e19d3a3a081f82c8fe888f6..05c2d10e8c18436d5cb3c188aa77212388ed8abc 100644 (file)
@@ -2458,3 +2458,21 @@ asl_action_file_checkpoint(const char *module, const char *path)
 
        return 0;
 }
+
+void
+asl_action_out_module_query(asl_msg_t *q, asl_msg_t *m, bool all)
+{
+       dispatch_sync(asl_action_queue, ^{
+               asl_out_module_t *om;
+               const char *val;
+               for (om = global.asl_out_module; om != NULL; om = om->next)
+               {
+                       if (all || (0 == asl_msg_lookup(q, om->name, NULL, NULL)))
+                       {
+                               val = om->flags & MODULE_FLAG_ENABLED ? "enabled" : "disabled";
+                               if (om->name == NULL) asl_msg_set_key_val(m, "asl.conf", val);
+                               else asl_msg_set_key_val(m, om->name, val);
+                       }
+               }
+       });
+}
index 106059b17c1d6167efc57baef5ade3bd40dc747b..4646c3d1ce0b6ebec25d2b934f160f7b8f16a673 100644 (file)
@@ -199,6 +199,7 @@ void asl_out_message(asl_msg_t *msg, int64_t msize);
 void bsd_out_message(asl_msg_t *msg, int64_t msize);
 int control_set_param(const char *s, bool eval);
 int asl_action_control_set_param(const char *s);
+void asl_action_out_module_query(asl_msg_t *q, asl_msg_t *m, bool all);
 
 /* notify SPI */
 uint32_t notify_register_plain(const char *name, int *out_token);
index ae8a6d49efd2272c150d984f028f0a4badd2c462..7c355b62c1c17b26654bd189fa9e7c0d2b6af24f 100644 (file)
@@ -821,7 +821,6 @@ syslogd_state_query(asl_msg_t *q, asl_msg_list_t **res, uid_t uid)
        asl_msg_t *m;
        char val[256];
        const char *mval;
-       asl_out_module_t *om;
 
        if (res == NULL) return ASL_STATUS_INVALID_ARG;
        *res = NULL;
@@ -1001,15 +1000,8 @@ syslogd_state_query(asl_msg_t *q, asl_msg_list_t **res, uid_t uid)
                }
        }
 
-       for (om = global.asl_out_module; om != NULL; om = om->next)
-       {
-               if (all || (0 == asl_msg_lookup(q, om->name, NULL, NULL)))
-               {
-                       snprintf(val, sizeof(val), "%s", om->flags & MODULE_FLAG_ENABLED ? "enabled" : "disabled");
-                       if (om->name == NULL) asl_msg_set_key_val(m, "asl.conf", val);
-                       else asl_msg_set_key_val(m, om->name, val);
-               }
-       }
+       /* output module query must be on the asl_action_queue */
+       asl_action_out_module_query(q, m, all);
 
        /* synchronous actions use queries, since messages are simpleroutines */
        if (0 == asl_msg_lookup(q, "action", &mval, NULL))
@@ -1183,7 +1175,8 @@ database_server()
                        abort();
                }
 
-               if (request->head.msgh_id == MACH_NOTIFY_DEAD_NAME)
+               if (request->head.msgh_local_port == global.dead_session_port &&
+                       request->head.msgh_id == MACH_NOTIFY_DEAD_NAME)
                {
                        deadname = (mach_dead_name_notification_t *)request;
                        dispatch_async(asl_server_queue, ^{