From 86a8bcf5391af0ec49053c96da1549f1e6ee226a Mon Sep 17 00:00:00 2001 From: Apple Date: Thu, 25 Jul 2019 19:03:13 +0000 Subject: [PATCH] syslog-377.0.1.tar.gz --- APPLE_LICENSE | 367 ++++++++++++++++++ aslcommon/asl_common.c | 55 ++- aslcommon/asl_common.h | 5 +- aslcommon/asl_ipc.defs | 35 +- aslmanager.tproj/aslmanager.c | 61 +-- aslmanager.tproj/cache_delete.c | 145 ------- aslmanager.tproj/cache_delete.h | 24 -- ...m.apple.activity_tracing.CacheDelete.plist | 12 - aslmanager.tproj/com.apple.aslmanager.plist | 2 - aslmanager.tproj/daemon.c | 110 +----- aslmanager.tproj/daemon.h | 1 - libsystem_asl.tproj/include/asl_private.h | 1 + libsystem_asl.tproj/man/asl.3 | 4 +- libsystem_asl.tproj/src/asl.c | 21 +- libsystem_asl.tproj/src/asl_client.c | 3 +- libsystem_asl.tproj/src/asl_mt_shim.c | 100 +++++ syslog.xcodeproj/project.pbxproj | 33 +- syslogd.tproj/asl_action.c | 49 +-- syslogd.tproj/bsd_in.c | 2 +- syslogd.tproj/bsd_out.c | 4 +- syslogd.tproj/com.apple.syslogd.plist | 17 +- syslogd.tproj/com.apple.syslogd_sim.plist | 10 +- syslogd.tproj/daemon.c | 15 +- syslogd.tproj/daemon.h | 4 +- syslogd.tproj/dbserver.c | 113 +----- syslogd.tproj/klog_in.c | 4 +- syslogd.tproj/remote.c | 4 +- syslogd.tproj/syslogd.c | 32 +- syslogd.tproj/udp_in.c | 4 +- 29 files changed, 621 insertions(+), 616 deletions(-) create mode 100644 APPLE_LICENSE delete mode 100644 aslmanager.tproj/cache_delete.c delete mode 100644 aslmanager.tproj/cache_delete.h delete mode 100644 aslmanager.tproj/com.apple.activity_tracing.CacheDelete.plist create mode 100644 libsystem_asl.tproj/src/asl_mt_shim.c diff --git a/APPLE_LICENSE b/APPLE_LICENSE new file mode 100644 index 0000000..fe81a60 --- /dev/null +++ b/APPLE_LICENSE @@ -0,0 +1,367 @@ +APPLE PUBLIC SOURCE LICENSE +Version 2.0 - August 6, 2003 + +Please read this License carefully before downloading this software. +By downloading or using this software, you are agreeing to be bound by +the terms of this License. If you do not or cannot agree to the terms +of this License, please do not download or use the software. + +1. General; Definitions. This License applies to any program or other +work which Apple Computer, Inc. ("Apple") makes publicly available and +which contains a notice placed by Apple identifying such program or +work as "Original Code" and stating that it is subject to the terms of +this Apple Public Source License version 2.0 ("License"). As used in +this License: + +1.1 "Applicable Patent Rights" mean: (a) in the case where Apple is +the grantor of rights, (i) claims of patents that are now or hereafter +acquired, owned by or assigned to Apple and (ii) that cover subject +matter contained in the Original Code, but only to the extent +necessary to use, reproduce and/or distribute the Original Code +without infringement; and (b) in the case where You are the grantor of +rights, (i) claims of patents that are now or hereafter acquired, +owned by or assigned to You and (ii) that cover subject matter in Your +Modifications, taken alone or in combination with Original Code. + +1.2 "Contributor" means any person or entity that creates or +contributes to the creation of Modifications. + +1.3 "Covered Code" means the Original Code, Modifications, the +combination of Original Code and any Modifications, and/or any +respective portions thereof. + +1.4 "Externally Deploy" means: (a) to sublicense, distribute or +otherwise make Covered Code available, directly or indirectly, to +anyone other than You; and/or (b) to use Covered Code, alone or as +part of a Larger Work, in any way to provide a service, including but +not limited to delivery of content, through electronic communication +with a client other than You. + +1.5 "Larger Work" means a work which combines Covered Code or portions +thereof with code not governed by the terms of this License. + +1.6 "Modifications" mean any addition to, deletion from, and/or change +to, the substance and/or structure of the Original Code, any previous +Modifications, the combination of Original Code and any previous +Modifications, and/or any respective portions thereof. When code is +released as a series of files, a Modification is: (a) any addition to +or deletion from the contents of a file containing Covered Code; +and/or (b) any new file or other representation of computer program +statements that contains any part of Covered Code. + +1.7 "Original Code" means (a) the Source Code of a program or other +work as originally made available by Apple under this License, +including the Source Code of any updates or upgrades to such programs +or works made available by Apple under this License, and that has been +expressly identified by Apple as such in the header file(s) of such +work; and (b) the object code compiled from such Source Code and +originally made available by Apple under this License. + +1.8 "Source Code" means the human readable form of a program or other +work that is suitable for making modifications to it, including all +modules it contains, plus any associated interface definition files, +scripts used to control compilation and installation of an executable +(object code). + +1.9 "You" or "Your" means an individual or a legal entity exercising +rights under this License. For legal entities, "You" or "Your" +includes any entity which controls, is controlled by, or is under +common control with, You, where "control" means (a) the power, direct +or indirect, to cause the direction or management of such entity, +whether by contract or otherwise, or (b) ownership of fifty percent +(50%) or more of the outstanding shares or beneficial ownership of +such entity. + +2. Permitted Uses; Conditions & Restrictions. Subject to the terms +and conditions of this License, Apple hereby grants You, effective on +the date You accept this License and download the Original Code, a +world-wide, royalty-free, non-exclusive license, to the extent of +Apple's Applicable Patent Rights and copyrights covering the Original +Code, to do the following: + +2.1 Unmodified Code. You may use, reproduce, display, perform, +internally distribute within Your organization, and Externally Deploy +verbatim, unmodified copies of the Original Code, for commercial or +non-commercial purposes, provided that in each instance: + +(a) You must retain and reproduce in all copies of Original Code the +copyright and other proprietary notices and disclaimers of Apple as +they appear in the Original Code, and keep intact all notices in the +Original Code that refer to this License; and + +(b) You must include a copy of this License with every copy of Source +Code of Covered Code and documentation You distribute or Externally +Deploy, and You may not offer or impose any terms on such Source Code +that alter or restrict this License or the recipients' rights +hereunder, except as permitted under Section 6. + +2.2 Modified Code. You may modify Covered Code and use, reproduce, +display, perform, internally distribute within Your organization, and +Externally Deploy Your Modifications and Covered Code, for commercial +or non-commercial purposes, provided that in each instance You also +meet all of these conditions: + +(a) You must satisfy all the conditions of Section 2.1 with respect to +the Source Code of the Covered Code; + +(b) You must duplicate, to the extent it does not already exist, the +notice in Exhibit A in each file of the Source Code of all Your +Modifications, and cause the modified files to carry prominent notices +stating that You changed the files and the date of any change; and + +(c) If You Externally Deploy Your Modifications, You must make +Source Code of all Your Externally Deployed Modifications either +available to those to whom You have Externally Deployed Your +Modifications, or publicly available. Source Code of Your Externally +Deployed Modifications must be released under the terms set forth in +this License, including the license grants set forth in Section 3 +below, for as long as you Externally Deploy the Covered Code or twelve +(12) months from the date of initial External Deployment, whichever is +longer. You should preferably distribute the Source Code of Your +Externally Deployed Modifications electronically (e.g. download from a +web site). + +2.3 Distribution of Executable Versions. In addition, if You +Externally Deploy Covered Code (Original Code and/or Modifications) in +object code, executable form only, You must include a prominent +notice, in the code itself as well as in related documentation, +stating that Source Code of the Covered Code is available under the +terms of this License with information on how and where to obtain such +Source Code. + +2.4 Third Party Rights. You expressly acknowledge and agree that +although Apple and each Contributor grants the licenses to their +respective portions of the Covered Code set forth herein, no +assurances are provided by Apple or any Contributor that the Covered +Code does not infringe the patent or other intellectual property +rights of any other entity. Apple and each Contributor disclaim any +liability to You for claims brought by any other entity based on +infringement of intellectual property rights or otherwise. As a +condition to exercising the rights and licenses granted hereunder, You +hereby assume sole responsibility to secure any other intellectual +property rights needed, if any. For example, if a third party patent +license is required to allow You to distribute the Covered Code, it is +Your responsibility to acquire that license before distributing the +Covered Code. + +3. Your Grants. In consideration of, and as a condition to, the +licenses granted to You under this License, You hereby grant to any +person or entity receiving or distributing Covered Code under this +License a non-exclusive, royalty-free, perpetual, irrevocable license, +under Your Applicable Patent Rights and other intellectual property +rights (other than patent) owned or controlled by You, to use, +reproduce, display, perform, modify, sublicense, distribute and +Externally Deploy Your Modifications of the same scope and extent as +Apple's licenses under Sections 2.1 and 2.2 above. + +4. Larger Works. You may create a Larger Work by combining Covered +Code with other code not governed by the terms of this License and +distribute the Larger Work as a single product. In each such instance, +You must make sure the requirements of this License are fulfilled for +the Covered Code or any portion thereof. + +5. Limitations on Patent License. Except as expressly stated in +Section 2, no other patent rights, express or implied, are granted by +Apple herein. Modifications and/or Larger Works may require additional +patent licenses from Apple which Apple may grant in its sole +discretion. + +6. Additional Terms. You may choose to offer, and to charge a fee for, +warranty, support, indemnity or liability obligations and/or other +rights consistent with the scope of the license granted herein +("Additional Terms") to one or more recipients of Covered Code. +However, You may do so only on Your own behalf and as Your sole +responsibility, and not on behalf of Apple or any Contributor. You +must obtain the recipient's agreement that any such Additional Terms +are offered by You alone, and You hereby agree to indemnify, defend +and hold Apple and every Contributor harmless for any liability +incurred by or claims asserted against Apple or such Contributor by +reason of any such Additional Terms. + +7. Versions of the License. Apple may publish revised and/or new +versions of this License from time to time. Each version will be given +a distinguishing version number. Once Original Code has been published +under a particular version of this License, You may continue to use it +under the terms of that version. You may also choose to use such +Original Code under the terms of any subsequent version of this +License published by Apple. No one other than Apple has the right to +modify the terms applicable to Covered Code created under this +License. + +8. NO WARRANTY OR SUPPORT. The Covered Code may contain in whole or in +part pre-release, untested, or not fully tested works. The Covered +Code may contain errors that could cause failures or loss of data, and +may be incomplete or contain inaccuracies. You expressly acknowledge +and agree that use of the Covered Code, or any portion thereof, is at +Your sole and entire risk. THE COVERED CODE IS PROVIDED "AS IS" AND +WITHOUT WARRANTY, UPGRADES OR SUPPORT OF ANY KIND AND APPLE AND +APPLE'S LICENSOR(S) (COLLECTIVELY REFERRED TO AS "APPLE" FOR THE +PURPOSES OF SECTIONS 8 AND 9) AND ALL CONTRIBUTORS EXPRESSLY DISCLAIM +ALL WARRANTIES AND/OR CONDITIONS, EXPRESS OR IMPLIED, INCLUDING, BUT +NOT LIMITED TO, THE IMPLIED WARRANTIES AND/OR CONDITIONS OF +MERCHANTABILITY, OF SATISFACTORY QUALITY, OF FITNESS FOR A PARTICULAR +PURPOSE, OF ACCURACY, OF QUIET ENJOYMENT, AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. APPLE AND EACH CONTRIBUTOR DOES NOT WARRANT AGAINST +INTERFERENCE WITH YOUR ENJOYMENT OF THE COVERED CODE, THAT THE +FUNCTIONS CONTAINED IN THE COVERED CODE WILL MEET YOUR REQUIREMENTS, +THAT THE OPERATION OF THE COVERED CODE WILL BE UNINTERRUPTED OR +ERROR-FREE, OR THAT DEFECTS IN THE COVERED CODE WILL BE CORRECTED. NO +ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY APPLE, AN APPLE +AUTHORIZED REPRESENTATIVE OR ANY CONTRIBUTOR SHALL CREATE A WARRANTY. +You acknowledge that the Covered Code is not intended for use in the +operation of nuclear facilities, aircraft navigation, communication +systems, or air traffic control machines in which case the failure of +the Covered Code could lead to death, personal injury, or severe +physical or environmental damage. + +9. LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO +EVENT SHALL APPLE OR ANY CONTRIBUTOR BE LIABLE FOR ANY INCIDENTAL, +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATING +TO THIS LICENSE OR YOUR USE OR INABILITY TO USE THE COVERED CODE, OR +ANY PORTION THEREOF, WHETHER UNDER A THEORY OF CONTRACT, WARRANTY, +TORT (INCLUDING NEGLIGENCE), PRODUCTS LIABILITY OR OTHERWISE, EVEN IF +APPLE OR SUCH CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES AND NOTWITHSTANDING THE FAILURE OF ESSENTIAL PURPOSE OF ANY +REMEDY. SOME JURISDICTIONS DO NOT ALLOW THE LIMITATION OF LIABILITY OF +INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS LIMITATION MAY NOT APPLY +TO YOU. In no event shall Apple's total liability to You for all +damages (other than as may be required by applicable law) under this +License exceed the amount of fifty dollars ($50.00). + +10. Trademarks. This License does not grant any rights to use the +trademarks or trade names "Apple", "Apple Computer", "Mac", "Mac OS", +"QuickTime", "QuickTime Streaming Server" or any other trademarks, +service marks, logos or trade names belonging to Apple (collectively +"Apple Marks") or to any trademark, service mark, logo or trade name +belonging to any Contributor. You agree not to use any Apple Marks in +or as part of the name of products derived from the Original Code or +to endorse or promote products derived from the Original Code other +than as expressly permitted by and in strict compliance at all times +with Apple's third party trademark usage guidelines which are posted +at http://www.apple.com/legal/guidelinesfor3rdparties.html. + +11. Ownership. Subject to the licenses granted under this License, +each Contributor retains all rights, title and interest in and to any +Modifications made by such Contributor. Apple retains all rights, +title and interest in and to the Original Code and any Modifications +made by or on behalf of Apple ("Apple Modifications"), and such Apple +Modifications will not be automatically subject to this License. Apple +may, at its sole discretion, choose to license such Apple +Modifications under this License, or on different terms from those +contained in this License or may choose not to license them at all. + +12. Termination. + +12.1 Termination. This License and the rights granted hereunder will +terminate: + +(a) automatically without notice from Apple if You fail to comply with +any term(s) of this License and fail to cure such breach within 30 +days of becoming aware of such breach; + +(b) immediately in the event of the circumstances described in Section +13.5(b); or + +(c) automatically without notice from Apple if You, at any time during +the term of this License, commence an action for patent infringement +against Apple; provided that Apple did not first commence +an action for patent infringement against You in that instance. + +12.2 Effect of Termination. Upon termination, You agree to immediately +stop any further use, reproduction, modification, sublicensing and +distribution of the Covered Code. All sublicenses to the Covered Code +which have been properly granted prior to termination shall survive +any termination of this License. Provisions which, by their nature, +should remain in effect beyond the termination of this License shall +survive, including but not limited to Sections 3, 5, 8, 9, 10, 11, +12.2 and 13. No party will be liable to any other for compensation, +indemnity or damages of any sort solely as a result of terminating +this License in accordance with its terms, and termination of this +License will be without prejudice to any other right or remedy of +any party. + +13. Miscellaneous. + +13.1 Government End Users. The Covered Code is a "commercial item" as +defined in FAR 2.101. Government software and technical data rights in +the Covered Code include only those rights customarily provided to the +public as defined in this License. This customary commercial license +in technical data and software is provided in accordance with FAR +12.211 (Technical Data) and 12.212 (Computer Software) and, for +Department of Defense purchases, DFAR 252.227-7015 (Technical Data -- +Commercial Items) and 227.7202-3 (Rights in Commercial Computer +Software or Computer Software Documentation). Accordingly, all U.S. +Government End Users acquire Covered Code with only those rights set +forth herein. + +13.2 Relationship of Parties. This License will not be construed as +creating an agency, partnership, joint venture or any other form of +legal association between or among You, Apple or any Contributor, and +You will not represent to the contrary, whether expressly, by +implication, appearance or otherwise. + +13.3 Independent Development. Nothing in this License will impair +Apple's right to acquire, license, develop, have others develop for +it, market and/or distribute technology or products that perform the +same or similar functions as, or otherwise compete with, +Modifications, Larger Works, technology or products that You may +develop, produce, market or distribute. + +13.4 Waiver; Construction. Failure by Apple or any Contributor to +enforce any provision of this License will not be deemed a waiver of +future enforcement of that or any other provision. Any law or +regulation which provides that the language of a contract shall be +construed against the drafter will not apply to this License. + +13.5 Severability. (a) If for any reason a court of competent +jurisdiction finds any provision of this License, or portion thereof, +to be unenforceable, that provision of the License will be enforced to +the maximum extent permissible so as to effect the economic benefits +and intent of the parties, and the remainder of this License will +continue in full force and effect. (b) Notwithstanding the foregoing, +if applicable law prohibits or restricts You from fully and/or +specifically complying with Sections 2 and/or 3 or prevents the +enforceability of either of those Sections, this License will +immediately terminate and You must immediately discontinue any use of +the Covered Code and destroy all copies of it that are in your +possession or control. + +13.6 Dispute Resolution. Any litigation or other dispute resolution +between You and Apple relating to this License shall take place in the +Northern District of California, and You and Apple hereby consent to +the personal jurisdiction of, and venue in, the state and federal +courts within that District with respect to this License. The +application of the United Nations Convention on Contracts for the +International Sale of Goods is expressly excluded. + +13.7 Entire Agreement; Governing Law. This License constitutes the +entire agreement between the parties with respect to the subject +matter hereof. This License shall be governed by the laws of the +United States and the State of California, except that body of +California law concerning conflicts of law. + +Where You are located in the province of Quebec, Canada, the following +clause applies: The parties hereby confirm that they have requested +that this License and all related documents be drafted in English. Les +parties ont exige que le present contrat et tous les documents +connexes soient rediges en anglais. + +EXHIBIT A. + +"Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights +Reserved. + +This file contains Original Code and/or Modifications of Original Code +as defined in and that are subject to the Apple Public Source License +Version 2.0 (the 'License'). You may not use this file except in +compliance with the License. Please obtain a copy of the License at +http://www.opensource.apple.com/apsl/ and read it before using this +file. + +The Original Code and all software distributed under the License are +distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER +EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, +INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. +Please see the License for the specific language governing rights and +limitations under the License." diff --git a/aslcommon/asl_common.c b/aslcommon/asl_common.c index a5c1b89..6044938 100644 --- a/aslcommon/asl_common.c +++ b/aslcommon/asl_common.c @@ -52,7 +52,7 @@ #define PATH_LIBRARY_LOGS "/Library/Logs/" #define PATH_LIBRARY_LOGS_LEN 14 -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR #define _PATH_ASL_CONF_LOCAL_DIR "/usr/local/etc/asl" #endif @@ -554,7 +554,7 @@ _asl_common_make_dir_path(asl_out_module_t *mlist, uint32_t flags, const char *p status = mkdir(tmp, mode); umask(mask); -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR uid_t u = 0; gid_t g = 80; @@ -819,7 +819,7 @@ asl_out_dst_data_release(asl_out_dst_data_t *dst) free(dst->ext); free(dst->rotate_dir); free(dst->fmt); -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR free(dst->uid); free(dst->gid); #endif @@ -838,7 +838,7 @@ asl_out_dst_data_retain(asl_out_dst_data_t *dst) int asl_out_dst_set_access(int fd, asl_out_dst_data_t *dst) { -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR uid_t fuid = 0; gid_t fgid = 80; #if !TARGET_OS_EMBEDDED @@ -854,7 +854,7 @@ asl_out_dst_set_access(int fd, asl_out_dst_data_t *dst) if (dst == NULL) return -1; if (fd < 0) return -1; -#if TARGET_IPHONE_SIMULATOR +#if TARGET_OS_SIMULATOR return fd; #else @@ -946,7 +946,7 @@ asl_file_create_return: acl_free(acl); return fd; #endif /* !TARGET_OS_EMBEDDED */ -#endif /* !TARGET_IPHONE_SIMULATOR */ +#endif /* !TARGET_OS_SIMULATOR */ } /* create a file with acls */ @@ -1204,7 +1204,7 @@ _asl_out_module_parse_set_param(asl_out_module_t *m, char *s) return out; } -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR static void _dst_add_uid(asl_out_dst_data_t *dst, char *s) { @@ -1278,7 +1278,7 @@ _dst_add_gid(asl_out_dst_data_t *dst, char *s) dst->gid[dst->ngid++] = gid; } -#endif /* !TARGET_IPHONE_SIMULATOR */ +#endif /* !TARGET_OS_SIMULATOR */ static char * _dst_format_string(char *s) @@ -1557,7 +1557,7 @@ _asl_out_module_parse_dst(asl_out_module_t *m, char *s, mode_t def_mode) char *t = path; const char *log_root = "/var/log"; -#if TARGET_IPHONE_SIMULATOR +#if TARGET_OS_SIMULATOR log_root = getenv("SIMULATOR_LOG_ROOT"); if (log_root == NULL) log_root = "/tmp/log"; #endif @@ -1630,7 +1630,7 @@ _asl_out_module_parse_dst(asl_out_module_t *m, char *s, mode_t def_mode) while (NULL != (p = next_word_from_string(&opts))) { if (KEYMATCH(p, "mode=")) dst->mode = strtol(p+5, NULL, 0); -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR else if (KEYMATCH(p, "uid=")) _dst_add_uid(dst, p+4); else if (KEYMATCH(p, "gid=")) _dst_add_gid(dst, p+4); #endif @@ -1645,7 +1645,6 @@ _asl_out_module_parse_dst(asl_out_module_t *m, char *s, mode_t def_mode) else if (KEYMATCH(p+9, "false")) dst->flags &= ~MODULE_FLAG_COALESCE; } else if (KEYMATCH(p, "compress")) dst->flags |= MODULE_FLAG_COMPRESS; - else if (KEYMATCH(p, "activity")) dst->flags |= MODULE_FLAG_ACTIVITY; else if (KEYMATCH(p, "extern")) dst->flags |= MODULE_FLAG_EXTERNAL; else if (KEYMATCH(p, "truncate")) dst->flags |= MODULE_FLAG_TRUNCATE; else if (KEYMATCH(p, "dir")) dst->flags |= MODULE_FLAG_TYPE_ASL_DIR; @@ -1695,6 +1694,10 @@ _asl_out_module_parse_dst(asl_out_module_t *m, char *s, mode_t def_mode) dst->ttl[x] = asl_core_str_to_time(p+5, SECONDS_PER_DAY); } } + else if (KEYMATCH(p, "size_only")) + { + dst->flags |= MODULE_FLAG_SIZE_ONLY; + } free(p); p = NULL; @@ -1742,6 +1745,18 @@ _asl_out_module_parse_dst(asl_out_module_t *m, char *s, mode_t def_mode) /* set file_max to all_max if it is zero */ if (dst->file_max == 0) dst->file_max = dst->all_max; + /* size_only option requires non-zero file_max and all_max settings */ + if ((dst->flags & MODULE_FLAG_SIZE_ONLY) && (dst->file_max == 0 || dst->all_max == 0)) + { + dst->flags &= ~MODULE_FLAG_SIZE_ONLY; + } + + /* size_only option cannot be used with crashlog option */ + if ((dst->flags & MODULE_FLAG_SIZE_ONLY) && (dst->flags & MODULE_FLAG_CRASHLOG)) + { + dst->flags &= ~MODULE_FLAG_SIZE_ONLY; + } + out->action = ACTION_OUT_DEST; out->dst = dst; @@ -1891,7 +1906,7 @@ _asl_out_module_parse_query_action(asl_out_module_t *m, char *s) out->dst->flags &= ~MODULE_FLAG_ROTATE; } -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR if (out->dst->nuid == 0) _dst_add_uid(out->dst, "0"); if (out->dst->ngid == 0) _dst_add_gid(out->dst, "80"); #endif @@ -2035,7 +2050,7 @@ asl_out_module_init(void) { asl_out_module_t *out = NULL; -#if TARGET_IPHONE_SIMULATOR +#if TARGET_OS_SIMULATOR char *sim_root_path, *sim_resources_path; char *asl_conf, *asl_conf_dir, *asl_conf_local_dir; @@ -2062,7 +2077,7 @@ asl_out_module_init(void) if (_asl_out_module_find(out, ASL_MODULE_NAME) == NULL) { /* system just has old-style /etc/asl.conf */ -#if TARGET_IPHONE_SIMULATOR +#if TARGET_OS_SIMULATOR FILE *f = fopen(asl_conf, "r"); free(asl_conf); #else @@ -2207,11 +2222,6 @@ asl_out_module_print(FILE *f, asl_out_module_t *m) fprintf(f, "%cexternal", c); c = ' '; } - if (o->flags & MODULE_FLAG_ACTIVITY) - { - fprintf(f, "%cactivity", c); - c = ' '; - } if (o->flags & MODULE_FLAG_CRASHLOG) { fprintf(f, "%ccrashlog", c); @@ -2227,6 +2237,11 @@ asl_out_module_print(FILE *f, asl_out_module_t *m) fprintf(f, "%casl_directory", c); c = ' '; } + if (o->flags & MODULE_FLAG_SIZE_ONLY) + { + fprintf(f, "%csize_only", c); + c = ' '; + } fprintf(f, ")"); } fprintf(f, "\n"); @@ -2274,7 +2289,7 @@ asl_out_module_print(FILE *f, asl_out_module_t *m) fprintf(f, " mode: 0%o\n", o->mode); fprintf(f, " file_max: %lu\n", o->file_max); fprintf(f, " all_max: %lu\n", o->all_max); -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR fprintf(f, " uid:"); for (i = 0; i < o->nuid; i++) fprintf(f, " %d", o->uid[i]); fprintf(f, "\n"); diff --git a/aslcommon/asl_common.h b/aslcommon/asl_common.h index 5f92393..aac33fa 100644 --- a/aslcommon/asl_common.h +++ b/aslcommon/asl_common.h @@ -81,7 +81,7 @@ #define MODULE_FLAG_TYPE_ASL 0x00001000 /* asl format file */ #define MODULE_FLAG_TYPE_ASL_DIR 0x00002000 /* asl format directory */ #define MODULE_FLAG_STD_BSD_MSG 0x00004000 /* print format is std, bsd, or msg */ -#define MODULE_FLAG_ACTIVITY 0x00008000 +#define MODULE_FLAG_SIZE_ONLY 0x00008000 /* checkpoint on file size only */ #define MODULE_NAME_STYLE_FORMAT_MASK 0xf0000000 #define MODULE_NAME_STYLE_FORMAT_BS 0x10000000 /* base.stamp */ @@ -103,7 +103,6 @@ #define CHECKPOINT_TEST 0x00000000 #define CHECKPOINT_FORCE 0x00000001 -#define CHECKPOINT_CRASH 0x00000002 #define LEVEL_ALL 8 @@ -123,7 +122,7 @@ typedef struct uint32_t fails; uint32_t ttl[9]; mode_t mode; -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR uid_t *uid; uint32_t nuid; gid_t *gid; diff --git a/aslcommon/asl_ipc.defs b/aslcommon/asl_ipc.defs index bdbaf83..c5b3c62 100644 --- a/aslcommon/asl_ipc.defs +++ b/aslcommon/asl_ipc.defs @@ -32,40 +32,11 @@ import ; type ooline_data = ^ array [] of MACH_MSG_TYPE_BYTE ctype : caddr_t; -routine _asl_server_query -( - server : mach_port_t; - request : ooline_data, dealloc; - startid : uint64_t; - count : int; - flags : int; - out reply : ooline_data, dealloc; - out lastid : uint64_t; - out status : int; - SecToken token : security_token_t -); +skip; /* removed: _asl_server_query */ -routine _asl_server_query_timeout -( - server : mach_port_t; - request : ooline_data, dealloc; - startid : uint64_t; - count : int; - WaitTime timeout: natural_t; - flags : int; - out reply : ooline_data, dealloc; - out lastid : uint64_t; - out status : int; - ServerAuditToken token : audit_token_t -); +skip; /* removed: _asl_server_query_timeout */ -routine _asl_server_prune -( - server : mach_port_t; - request : ooline_data, dealloc; - out status : int; - SecToken token : security_token_t -); +skip; /* removed: _asl_server_prune */ routine _asl_server_create_aux_link ( diff --git a/aslmanager.tproj/aslmanager.c b/aslmanager.tproj/aslmanager.c index f8ab040..05bb9af 100644 --- a/aslmanager.tproj/aslmanager.c +++ b/aslmanager.tproj/aslmanager.c @@ -27,10 +27,10 @@ #include #include #include +#include #include "asl_common.h" #include "daemon.h" -#include "cache_delete.h" /* global */ bool dryrun; @@ -140,8 +140,6 @@ cli_main(int argc, char *argv[]) asl_out_dst_data_t store, opts, *asl_store_dst = NULL; const char *mname = NULL; bool quiet = false; - bool cache_delete = false; - bool cache_delete_query = false; #if !TARGET_OS_SIMULATOR if (geteuid() != 0) @@ -277,11 +275,6 @@ cli_main(int argc, char *argv[]) { work |= DO_CHECKPT; } - else if (!strcmp(argv[i], "-cache_delete")) - { - cache_delete = true; - if (((i + 1) < argc) && (argv[i + 1][0] == 'q')) cache_delete_query = true; - } else if (!strcmp(argv[i], "-module")) { work &= ~DO_ASLDB; @@ -314,42 +307,6 @@ cli_main(int argc, char *argv[]) debug_log(ASL_LEVEL_ERR, "aslmanager starting%s\n", dryrun ? " dryrun" : ""); - if (cache_delete) - { - size_t curr_size = 0; - - if (cache_delete_task(true, &curr_size) != 0) - { - debug_log(ASL_LEVEL_NOTICE, "cache_delete_process failed - can't determine current size\n"); - } - else - { - debug_log(ASL_LEVEL_NOTICE, "cache delete current size = %lu\n", curr_size); - - if (!cache_delete_query) - { - size_t new_size = curr_size - opts.all_max; - - if (cache_delete_task(false, &new_size) != 0) - { - debug_log(ASL_LEVEL_NOTICE, "cache_delete_process failed - delete failed\n"); - } - else - { - debug_log(ASL_LEVEL_NOTICE, "cache delete new size = %lu\n", new_size); - } - } - } - - asl_out_module_free(mod); - - debug_log(ASL_LEVEL_NOTICE, "----------------------------------------\n"); - debug_log(ASL_LEVEL_ERR, "aslmanager finished%s\n", dryrun ? " dryrun" : ""); - debug_close(); - - return 0; - } - if (work & DO_ASLDB) process_asl_data_store(asl_store_dst, &opts); if (work & DO_MODULE) @@ -389,7 +346,8 @@ main_task(void) if (main_task_enqueued) return; main_task_enqueued = true; - xpc_transaction_begin(); + + os_transaction_t transaction = os_transaction_create("com.apple.aslmanager"); if (initial_main_task) { @@ -399,7 +357,7 @@ main_task(void) dispatch_after(delay, work_queue, ^{ cli_main(0, NULL); main_task_enqueued = false; - xpc_transaction_end(); + os_release(transaction); }); } else @@ -407,7 +365,7 @@ main_task(void) dispatch_async(work_queue, ^{ cli_main(0, NULL); main_task_enqueued = false; - xpc_transaction_end(); + os_release(transaction); }); } } @@ -422,8 +380,11 @@ accept_connection(xpc_connection_t peer) /* send a reply immediately */ xpc_object_t reply = xpc_dictionary_create_reply(request); - xpc_connection_send_message(peer, reply); - xpc_release(reply); + if (reply != NULL) + { + xpc_connection_send_message(peer, reply); + xpc_release(reply); + } /* * Some day, we may use the dictionary to pass parameters @@ -478,7 +439,5 @@ main(int argc, char *argv[]) }); xpc_connection_resume(listener); - cache_delete_register(); - dispatch_main(); } diff --git a/aslmanager.tproj/cache_delete.c b/aslmanager.tproj/cache_delete.c deleted file mode 100644 index 1184fc2..0000000 --- a/aslmanager.tproj/cache_delete.c +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2015 Apple Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ - -#include -#include -#include -#include "daemon.h" - -/* CacheDelete ID (stored in cache delete plist). Must match suggested CacheDelete id naming conventions. */ -#define CACHE_DELETE_ID "com.apple.activity_tracing.cache-delete" - -#define CFSTR_FROM_DICT(dict, key) ({ \ - void *strRef = NULL; \ - if (dict != NULL) { \ - strRef = (void *)CFDictionaryGetValue(dict, key); \ - if ((strRef == NULL) || (CFStringGetTypeID() != CFGetTypeID(strRef))) strRef = NULL; \ - } \ - (CFStringRef)strRef; \ -}) - -#define INT64_FROM_DICT(dict, key) ({ \ - int64_t value = 0; \ - if (dict != NULL) { \ - void *numRef = (void *)CFDictionaryGetValue(dict, key); \ - if (numRef && (CFNumberGetTypeID() == CFGetTypeID(numRef))) {\ - if (!CFNumberGetValue(numRef, kCFNumberSInt64Type, &value)) value = 0; \ - } \ - } \ - value; \ -}) - -static int64_t -_purgeable(void) -{ - size_t psize = 0; - int status = cache_delete_task(true, &psize); - if (status == 0) return (uint64_t)psize; - return 0; -} - -static int64_t -_purge(int64_t purge_amount_bytes, CacheDeleteUrgency urgency) -{ - size_t curr_size, new_size; - curr_size = 0; - - int status = cache_delete_task(true, &curr_size); - if (status != 0) return 0; - - new_size = curr_size - purge_amount_bytes; - - status = cache_delete_task(false, &new_size); - if (status == 0) return new_size; - - return 0; -} - -static bool -_volume_contains_cached_data(CFStringRef volume) -{ - return true; -} - - -static CFDictionaryRef -_handle_cache_delete_with_urgency(CFDictionaryRef info, CacheDeleteUrgency urgency, bool purge) -{ - xpc_transaction_begin(); - - uint64_t amount_requested = INT64_FROM_DICT(info, CFSTR(CACHE_DELETE_AMOUNT_KEY)); - CFStringRef volume_requested = CFSTR_FROM_DICT(info, CFSTR(CACHE_DELETE_VOLUME_KEY)); - - CFMutableDictionaryRef result = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - if (result == NULL) - { - goto bail; - } - else if (volume_requested == NULL) - { - goto bail; - } - - /* TODO: CFStringGetCStringPtr can return NULL */ -// debug_log(ASL_LEVEL_DEBUG, "CacheDelete request (purge=%d, urgency=%d, volume=%s, amount=%llu).", (int)urgency, CFStringGetCStringPtr(volume_requested, kCFStringEncodingUTF8), amount_requested); - - int64_t amount_purged = 0; - - if (_volume_contains_cached_data(volume_requested)) - { - if (purge) - { - amount_purged = _purge(amount_requested, urgency); -// debug_log(ASL_LEVEL_WARNING, "Purged %lld bytes.", amount_purged); - } - else - { - amount_purged = _purgeable(); -// debug_log(ASL_LEVEL_WARNING, "%lld bytes of purgeable space.", amount_purged); - } - } - - CFNumberRef amount_purged_obj = CFNumberCreate(NULL, kCFNumberSInt64Type, &amount_purged); - if (amount_purged_obj != NULL) - { - CFDictionaryAddValue(result, CFSTR(CACHE_DELETE_AMOUNT_KEY), amount_purged_obj); - CFRelease(amount_purged_obj); - } - -bail: - - xpc_transaction_end(); - return result; -} - -bool -cache_delete_register(void) -{ - return CacheDeleteRegisterInfoCallbacks(CFSTR(CACHE_DELETE_ID), ^CFDictionaryRef(CacheDeleteUrgency urgency, CFDictionaryRef info) { - /* Purgeable Space Request */ - return _handle_cache_delete_with_urgency(info, urgency, false); - }, ^CFDictionaryRef(CacheDeleteUrgency urgency, CFDictionaryRef info) { - /* Purge Request */ - return _handle_cache_delete_with_urgency(info, urgency, true); - }, NULL, NULL) == 0; -} diff --git a/aslmanager.tproj/cache_delete.h b/aslmanager.tproj/cache_delete.h deleted file mode 100644 index 22d3b12..0000000 --- a/aslmanager.tproj/cache_delete.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2015 Apple Inc. All rights reserved. - * - * @APPLE_LICENSE_HEADER_START@ - * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, - * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. - * - * @APPLE_LICENSE_HEADER_END@ - */ - -bool cache_delete_register(void); diff --git a/aslmanager.tproj/com.apple.activity_tracing.CacheDelete.plist b/aslmanager.tproj/com.apple.activity_tracing.CacheDelete.plist deleted file mode 100644 index 35633de..0000000 --- a/aslmanager.tproj/com.apple.activity_tracing.CacheDelete.plist +++ /dev/null @@ -1,12 +0,0 @@ - - - - - CACHE_DELETE_ID - com.apple.activity_tracing.cache-delete - CACHE_DELETE_SERVICES - - PURGE - - - diff --git a/aslmanager.tproj/com.apple.aslmanager.plist b/aslmanager.tproj/com.apple.aslmanager.plist index 3e1429c..1ab802b 100644 --- a/aslmanager.tproj/com.apple.aslmanager.plist +++ b/aslmanager.tproj/com.apple.aslmanager.plist @@ -14,8 +14,6 @@ com.apple.aslmanager - com.apple.activity_tracing.cache-delete - EnableTransactions diff --git a/aslmanager.tproj/daemon.c b/aslmanager.tproj/daemon.c index ea05d27..b3e162f 100644 --- a/aslmanager.tproj/daemon.c +++ b/aslmanager.tproj/daemon.c @@ -51,6 +51,7 @@ #include #include #include "daemon.h" +#include "asl_ipc.h" /* global */ extern bool dryrun; @@ -62,21 +63,6 @@ static mach_port_t asl_server_port; static aslclient aslc; static int asl_aux_fd = -1; -extern kern_return_t _asl_server_query -( - mach_port_t server, - caddr_t request, - mach_msg_type_number_t requestCnt, - uint64_t startid, - int count, - int flags, - caddr_t *reply, - mach_msg_type_number_t *replyCnt, - uint64_t *lastid, - int *status, - security_token_t *token - ); - const char * keep_str(uint8_t mask) { @@ -1150,26 +1136,6 @@ process_asl_data_store(asl_out_dst_data_t *dst, asl_out_dst_data_t *opts) return 0; } -static asl_out_file_list_t * -_remove_youngest_activity_tracing_file(asl_out_file_list_t *l) -{ - asl_out_file_list_t *f; - - /* ignore youngest activity tracing file - it is the active file */ - if (l->next == NULL) - { - debug_log(ASL_LEVEL_INFO, " ignore youngest (only) activity tracing file %s\n", l->name); - asl_out_file_list_free(l); - return NULL; - } - - for (f = l; f->next->next != NULL; f = f->next); - debug_log(ASL_LEVEL_INFO, " ignore youngest activity tracing file %s\n", f->next->name); - asl_out_file_list_free(f->next); - f->next = NULL; - return l; -} - /* move sequenced source files to dst dir, renaming as we go */ int module_copy_rename(asl_out_dst_data_t *dst) @@ -1235,11 +1201,6 @@ module_copy_rename(asl_out_dst_data_t *dst) dst_list = asl_list_dst_files(dst); - if ((dst_list != NULL) && (dst->flags & MODULE_FLAG_ACTIVITY)) - { - dst_list = _remove_youngest_activity_tracing_file(dst_list); - } - dst_dir = dst->rotate_dir; if (dst_dir == NULL) dst_dir = dst->dir; @@ -1385,11 +1346,6 @@ module_expire(asl_out_dst_data_t *dst, asl_out_dst_data_t *opts) dst_list = asl_list_dst_files(dst); - if ((dst_list != NULL) && (dst->flags & MODULE_FLAG_ACTIVITY)) - { - dst_list = _remove_youngest_activity_tracing_file(dst_list); - } - *base = '\0'; dst_dir = dst->rotate_dir; @@ -1449,12 +1405,6 @@ module_check_size(asl_out_dst_data_t *dst, asl_out_dst_data_t *opts, bool query, if (all_max == 0) return 0; dst_list = asl_list_dst_files(dst); - - if ((dst_list != NULL) && (dst->flags & MODULE_FLAG_ACTIVITY)) - { - dst_list = _remove_youngest_activity_tracing_file(dst_list); - } - if (dst_list == NULL) { debug_log(ASL_LEVEL_INFO, " no dst files\n"); @@ -1512,7 +1462,7 @@ process_dst(asl_out_dst_data_t *dst, asl_out_dst_data_t *opts) module_copy_rename(dst); - if (ttl > 0) + if ((ttl > 0) && !(dst->flags & MODULE_FLAG_SIZE_ONLY)) { char tstr[150]; @@ -1560,57 +1510,6 @@ process_module(asl_out_module_t *mod, asl_out_dst_data_t *opts) return 0; } -int -cache_delete_task(bool query, size_t *size) -{ - dispatch_sync(work_queue, ^{ - asl_out_module_t *mod, *m; - asl_out_dst_data_t opts; - size_t total_size = 0; - - memset(&opts, 0, sizeof(opts)); - if ((!query) && (size != NULL)) opts.all_max = *size; - - debug_log(ASL_LEVEL_NOTICE, "cache_delete_process%s size %lu\n", query ? " query" : "", opts.all_max); - - mod = asl_out_module_init(); - - for (m = mod; m != NULL; m = m->next) - { - bool logged = false; - asl_out_rule_t *r; - - for (r = m->ruleset; r != NULL; r = r->next) - { - if (r->action == ACTION_OUT_DEST) - { - if (r->dst->flags & MODULE_FLAG_ACTIVITY) - { - if (!logged) - { - debug_log(ASL_LEVEL_NOTICE, "----------------------------------------\n"); - debug_log(ASL_LEVEL_NOTICE, "Processing activity module %s\n", (m->name == NULL) ? "asl.conf" : m->name); - logged = true; - } - - size_t dsize = 0; - module_check_size(r->dst, &opts, false, &dsize); - total_size += dsize; - } - } - } - - if (logged) debug_log(ASL_LEVEL_NOTICE, "Finished processing activity module %s\n", (m->name == NULL) ? "asl.conf" : m->name); - } - - asl_out_module_free(mod); - - if (size != NULL) *size = total_size; - }); - - return 0; -} - asl_msg_list_t * control_query(asl_msg_t *a) { @@ -1620,7 +1519,6 @@ control_query(asl_msg_t *a) uint64_t cmax, qmin; kern_return_t kstatus; caddr_t vmstr; - security_token_t sec; if (asl_server_port == MACH_PORT_NULL) { @@ -1648,8 +1546,6 @@ control_query(asl_msg_t *a) out = NULL; qmin = 0; cmax = 0; - sec.val[0] = -1; - sec.val[1] = -1; res = NULL; reslen = 0; @@ -1662,7 +1558,7 @@ control_query(asl_msg_t *a) free(str); status = 0; - kstatus = _asl_server_query(asl_server_port, vmstr, len, qmin, 1, 0, (caddr_t *)&res, &reslen, &cmax, (int *)&status, &sec); + kstatus = _asl_server_query_2(asl_server_port, vmstr, len, qmin, 1, 0, (caddr_t *)&res, &reslen, &cmax, (int *)&status); if (kstatus != KERN_SUCCESS) return NULL; if (res == NULL) return NULL; diff --git a/aslmanager.tproj/daemon.h b/aslmanager.tproj/daemon.h index ed05961..11d81b7 100644 --- a/aslmanager.tproj/daemon.h +++ b/aslmanager.tproj/daemon.h @@ -97,6 +97,5 @@ int process_dst(asl_out_dst_data_t *dst, asl_out_dst_data_t *opts); asl_msg_list_t * control_query(asl_msg_t *a); int checkpoint(const char *name); -int cache_delete_task(bool query, size_t *size); void main_task(void); diff --git a/libsystem_asl.tproj/include/asl_private.h b/libsystem_asl.tproj/include/asl_private.h index 8235216..f0e03ce 100644 --- a/libsystem_asl.tproj/include/asl_private.h +++ b/libsystem_asl.tproj/include/asl_private.h @@ -78,6 +78,7 @@ #define EVAL_ASL_FILE 0x00100000 #define EVAL_TUNNEL 0x00200000 #define EVAL_QUOTA 0x00400000 +#define EVAL_MT_SHIM 0x00800000 /* * Private types diff --git a/libsystem_asl.tproj/man/asl.3 b/libsystem_asl.tproj/man/asl.3 index 42daaff..8751a00 100644 --- a/libsystem_asl.tproj/man/asl.3 +++ b/libsystem_asl.tproj/man/asl.3 @@ -31,7 +31,7 @@ .Os "Mac OS X" .Sh NAME .Nm asl_add_log_file , -.Nm asl_add_outout_file , +.Nm asl_add_output_file , .Nm asl_append , .Nm asl_close , .Nm asl_close_auxiliary_file , @@ -430,7 +430,7 @@ is non-NULL, it may override the values for ASL_KEY_SENDER and ASL_KEY_FACILITY, and it may supply additional key/value pairs. The .Fa format -string and it's associated arguments are used to construct a string value for the +string and its associated arguments are used to construct a string value for the ASL_KEY_MSG key in the final log message dictionary. .Pp If the diff --git a/libsystem_asl.tproj/src/asl.c b/libsystem_asl.tproj/src/asl.c index 027516e..8e255b4 100644 --- a/libsystem_asl.tproj/src/asl.c +++ b/libsystem_asl.tproj/src/asl.c @@ -109,6 +109,11 @@ uint32_t notify_register_plain(const char *name, int *out_token); /* fork handling in asl_fd.c */ extern void _asl_redirect_fork_child(void); +#if TARGET_OS_OSX +extern void _asl_mt_shim_fork_child(void); +extern void _asl_mt_shim_send_message(asl_msg_t *msg); +#endif + typedef struct { int fd; @@ -165,6 +170,9 @@ _asl_fork_child() pthread_mutex_init(&(_asl_global.lock), NULL); _asl_redirect_fork_child(); +#if TARGET_OS_OSX + _asl_mt_shim_fork_child(); +#endif } /* @@ -564,7 +572,11 @@ _asl_evaluate_send(asl_object_t client, asl_object_t m, int slevel) /* don't send MessageTracer messages to Activity Tracing */ val = NULL; - if ((asl_msg_lookup(msg, ASL_KEY_MESSAGETRACER, &val, NULL) == 0) && (val != NULL)) eval &= ~EVAL_SEND_TRACE; + if ((asl_msg_lookup(msg, ASL_KEY_MESSAGETRACER, &val, NULL) == 0) && (val != NULL)) + { + eval &= ~EVAL_SEND_TRACE; + eval |= EVAL_MT_SHIM; + } /* don't send PowerManagement messages to Activity Tracing */ val = NULL; @@ -1461,6 +1473,13 @@ _asl_send_message(asl_object_t obj, uint32_t eval, asl_msg_t *msg, const char *m } } +#if TARGET_OS_OSX + if (eval & EVAL_MT_SHIM) + { + _asl_mt_shim_send_message(sendmsg); + } +#endif + if ((_asl_global.server_port != MACH_PORT_NULL) && (eval & EVAL_SEND_ASL)) { asl_string_t *send_str; diff --git a/libsystem_asl.tproj/src/asl_client.c b/libsystem_asl.tproj/src/asl_client.c index fd87f34..7aa0455 100644 --- a/libsystem_asl.tproj/src/asl_client.c +++ b/libsystem_asl.tproj/src/asl_client.c @@ -240,8 +240,9 @@ _do_server_match(asl_msg_list_t *qlist, size_t *last, size_t start, size_t count count64 = count; kstatus = _asl_server_match(asl_server_port, vmstr, len, start64, count64, duration, dir, (caddr_t *)&res, &reslen, &last64, (int *)&status); - *last = last64; + if (kstatus != KERN_SUCCESS) return NULL; + *last = last64; out = asl_msg_list_from_string(res); vm_deallocate(mach_task_self(), (vm_address_t)res, reslen); diff --git a/libsystem_asl.tproj/src/asl_mt_shim.c b/libsystem_asl.tproj/src/asl_mt_shim.c new file mode 100644 index 0000000..68c8618 --- /dev/null +++ b/libsystem_asl.tproj/src/asl_mt_shim.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2019 Apple Inc. All rights reserved. + * + * @APPLE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this + * file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_LICENSE_HEADER_END@ + */ + +#include +#include +#include + +#if TARGET_OS_OSX + +#define MT_SHIM_SERVICE_NAME "com.apple.analyticsd.messagetracer" + +static os_unfair_lock _mt_shim_lock = OS_UNFAIR_LOCK_INIT; +static xpc_pipe_t _mt_shim_pipe; + +void +_asl_mt_shim_fork_child(void) +{ + if (_mt_shim_pipe) { + xpc_pipe_invalidate(_mt_shim_pipe); + xpc_release(_mt_shim_pipe); + _mt_shim_pipe = NULL; + } + _mt_shim_lock = OS_UNFAIR_LOCK_INIT; +} + +static xpc_pipe_t +_asl_mt_shim_pipe_copy(OS_OBJECT_CONSUMED xpc_pipe_t prev) +{ + xpc_pipe_t pipe; + + os_unfair_lock_lock_with_options(&_mt_shim_lock, + OS_UNFAIR_LOCK_DATA_SYNCHRONIZATION); + pipe = _mt_shim_pipe; + if (prev) { + if (pipe == prev) { + xpc_release(pipe); + pipe = NULL; + } + xpc_release(prev); + } + if (!pipe) { + uint64_t flags = XPC_PIPE_PRIVILEGED | XPC_PIPE_USE_SYNC_IPC_OVERRIDE; + _mt_shim_pipe = pipe = xpc_pipe_create(MT_SHIM_SERVICE_NAME, flags); + } + if (pipe) xpc_retain(pipe); + os_unfair_lock_unlock(&_mt_shim_lock); + return pipe; +} + +static xpc_object_t +_asl_mt_shim_send_with_reply(xpc_object_t msg) +{ + xpc_object_t reply = NULL; + xpc_pipe_t pipe = _asl_mt_shim_pipe_copy(NULL); + + if (pipe && xpc_pipe_routine(pipe, msg, &reply) == EPIPE) { + pipe = _asl_mt_shim_pipe_copy(pipe); + if (pipe) (void)xpc_pipe_routine(pipe, msg, &reply); + } + if (pipe) xpc_release(pipe); + return reply; +} + +void +_asl_mt_shim_send_message(asl_msg_t *msg) +{ + /* don't send messages that were already shimmed by the caller */ + const char *val = NULL; + if ((asl_msg_lookup(msg, "com.apple.message.__source__", &val, NULL) == 0) && (val != NULL)) { + if (!strcmp(val, "SPI")) return; + } + + xpc_object_t xmsg = xpc_dictionary_create(NULL, NULL, 0); + _asl_log_args_to_xpc(NULL, (asl_object_t)msg, xmsg); + xpc_object_t reply = _asl_mt_shim_send_with_reply(xmsg); + if (reply) xpc_release(reply); + xpc_release(xmsg); +} + +#endif /* TARGET_OS_OSX */ diff --git a/syslog.xcodeproj/project.pbxproj b/syslog.xcodeproj/project.pbxproj index 7a01c4c..462268a 100644 --- a/syslog.xcodeproj/project.pbxproj +++ b/syslog.xcodeproj/project.pbxproj @@ -82,11 +82,7 @@ 2D31F3D017E77F8800F2A60C /* asl_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 2D31F3CC17E77F8800F2A60C /* asl_string.c */; }; 2D60F61115657D0F00F2E3F9 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2D60F61015657D0F00F2E3F9 /* libz.dylib */; }; 2D9DEB64150E6FE80059BA61 /* asl_common.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D30656D150E6EFF00F31A54 /* asl_common.h */; }; - 2DAF75551AE8613000054190 /* com.apple.activity_tracing.CacheDelete.plist in Copy CacheDelete plist */ = {isa = PBXBuildFile; fileRef = 2DAF75541AE8610200054190 /* com.apple.activity_tracing.CacheDelete.plist */; }; 2DCF701A150E97C0002D5E8F /* libaslcommon.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 505ACB9D108FD16400197086 /* libaslcommon.a */; }; - 2DEE8C411AE575A2007B5CBE /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DEE8C401AE575A2007B5CBE /* CoreFoundation.framework */; }; - 2DEE8C431AE575AB007B5CBE /* CacheDelete.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2DEE8C421AE575AB007B5CBE /* CacheDelete.framework */; }; - 2DEE8C461AE5798B007B5CBE /* cache_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = 2DEE8C441AE5798B007B5CBE /* cache_delete.c */; }; 3F6F43F21613A8E300CA9ADB /* asl.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F6F43CF1613A8E300CA9ADB /* asl.h */; settings = {ATTRIBUTES = (Public, ); }; }; 3F6F43F31613A8E300CA9ADB /* asl_core.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F6F43D01613A8E300CA9ADB /* asl_core.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3F6F43F41613A8E300CA9ADB /* asl_file.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F6F43D11613A8E300CA9ADB /* asl_file.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -129,6 +125,7 @@ 505ACBA8108FD18400197086 /* asl_ipc.defs in Headers */ = {isa = PBXBuildFile; fileRef = 505ACBA2108FD18400197086 /* asl_ipc.defs */; }; 505ACBA9108FD18400197086 /* asl_memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 505ACBA3108FD18400197086 /* asl_memory.c */; }; 505ACBAA108FD18400197086 /* asl_memory.h in Headers */ = {isa = PBXBuildFile; fileRef = 505ACBA4108FD18400197086 /* asl_memory.h */; }; + 8FBD22362241ED0000CEBA6A /* asl_mt_shim.c in Sources */ = {isa = PBXBuildFile; fileRef = 8F77AF5A2241CD17004AF9B4 /* asl_mt_shim.c */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -219,17 +216,6 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ - 2D30D27D1AE6BBA000673818 /* Copy CacheDelete plist */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 8; - dstPath = /System/Library/CacheDelete; - dstSubfolderSpec = 0; - files = ( - 2DAF75551AE8613000054190 /* com.apple.activity_tracing.CacheDelete.plist in Copy CacheDelete plist */, - ); - name = "Copy CacheDelete plist"; - runOnlyForDeploymentPostprocessing = 1; - }; 3F6F44131613AA9300CA9ADB /* Install man3 */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 8; @@ -304,13 +290,8 @@ 2D31F3CC17E77F8800F2A60C /* asl_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = asl_string.c; sourceTree = ""; }; 2D60F61015657D0F00F2E3F9 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; 2D9C4F131B3A29E700219FB3 /* com.apple.system.log */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = com.apple.system.log; path = syslogd.tproj/com.apple.system.log; sourceTree = ""; }; - 2DAF75541AE8610200054190 /* com.apple.activity_tracing.CacheDelete.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.activity_tracing.CacheDelete.plist; path = aslmanager.tproj/com.apple.activity_tracing.CacheDelete.plist; sourceTree = ""; }; 2DB4DA0A125FC69A001CDC45 /* after_install.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; name = after_install.sh; path = syslogd.tproj/after_install.sh; sourceTree = ""; }; 2DB8178915589D0C004D0BDE /* entitlements.plist */ = {isa = PBXFileReference; lastKnownFileType = file.bplist; name = entitlements.plist; path = util.tproj/entitlements.plist; sourceTree = ""; }; - 2DEE8C401AE575A2007B5CBE /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = ../../../../../../../../System/Library/Frameworks/CoreFoundation.framework; sourceTree = ""; }; - 2DEE8C421AE575AB007B5CBE /* CacheDelete.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CacheDelete.framework; path = ../../../../../../../../System/Library/PrivateFrameworks/CacheDelete.framework; sourceTree = ""; }; - 2DEE8C441AE5798B007B5CBE /* cache_delete.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = cache_delete.c; path = aslmanager.tproj/cache_delete.c; sourceTree = ""; }; - 2DEE8C451AE5798B007B5CBE /* cache_delete.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = cache_delete.h; path = aslmanager.tproj/cache_delete.h; sourceTree = ""; }; 3F6B6311185AF66C00F692C5 /* aslmanager.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = aslmanager.xcconfig; sourceTree = ""; }; 3F6B6312185AF66C00F692C5 /* base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = base.xcconfig; sourceTree = ""; }; 3F6B6313185AF66C00F692C5 /* syslogd.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = syslogd.xcconfig; sourceTree = ""; }; @@ -369,6 +350,7 @@ 505ACBA2108FD18400197086 /* asl_ipc.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = asl_ipc.defs; sourceTree = ""; }; 505ACBA3108FD18400197086 /* asl_memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = asl_memory.c; sourceTree = ""; }; 505ACBA4108FD18400197086 /* asl_memory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = asl_memory.h; sourceTree = ""; }; + 8F77AF5A2241CD17004AF9B4 /* asl_mt_shim.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = asl_mt_shim.c; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -383,8 +365,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 2DEE8C431AE575AB007B5CBE /* CacheDelete.framework in Frameworks */, - 2DEE8C411AE575A2007B5CBE /* CoreFoundation.framework in Frameworks */, 2D60F61115657D0F00F2E3F9 /* libz.dylib in Frameworks */, 2DCF701A150E97C0002D5E8F /* libaslcommon.a in Frameworks */, ); @@ -420,8 +400,6 @@ 08FB7794FE84155DC02AAC07 /* syslog */ = { isa = PBXGroup; children = ( - 2DEE8C421AE575AB007B5CBE /* CacheDelete.framework */, - 2DEE8C401AE575A2007B5CBE /* CoreFoundation.framework */, 505ACBA1108FD18400197086 /* aslcommon */, 503917691091404D0001165E /* aslmanager */, 503917C41091412B0001165E /* util */, @@ -489,6 +467,7 @@ 3F6F43E51613A8E300CA9ADB /* asl_file.c */, 3F6F43E61613A8E300CA9ADB /* asl_legacy1.c */, 3F6F43E71613A8E300CA9ADB /* asl_msg.c */, + 8F77AF5A2241CD17004AF9B4 /* asl_mt_shim.c */, 3F6F43E81613A8E300CA9ADB /* asl_store.c */, 3F6F43E91613A8E300CA9ADB /* asl_util.c */, ); @@ -518,9 +497,6 @@ 503917691091404D0001165E /* aslmanager */ = { isa = PBXGroup; children = ( - 2DAF75541AE8610200054190 /* com.apple.activity_tracing.CacheDelete.plist */, - 2DEE8C441AE5798B007B5CBE /* cache_delete.c */, - 2DEE8C451AE5798B007B5CBE /* cache_delete.h */, 5039176B1091408B0001165E /* aslmanager.8 */, 5039176C1091408B0001165E /* aslmanager.c */, 2D30D27F1AE6C84200673818 /* daemon.c */, @@ -653,7 +629,6 @@ 50391764109140450001165E /* Frameworks */, 503A82631099037D00B0D08A /* Copy Manpage.8 */, FCAC6D7410AB34C9008DEAC9 /* ShellScript */, - 2D30D27D1AE6BBA000673818 /* Copy CacheDelete plist */, ); buildRules = ( ); @@ -821,6 +796,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 8FBD22362241ED0000CEBA6A /* asl_mt_shim.c in Sources */, 2D31F3CD17E77F8800F2A60C /* asl_client.c in Sources */, 3F6F43FB1613A8E300CA9ADB /* asl.c in Sources */, 3F6F43FC1613A8E300CA9ADB /* asl_core.c in Sources */, @@ -844,7 +820,6 @@ files = ( 2D30D2811AE6C84200673818 /* daemon.c in Sources */, 5039176F1091408B0001165E /* aslmanager.c in Sources */, - 2DEE8C461AE5798B007B5CBE /* cache_delete.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/syslogd.tproj/asl_action.c b/syslogd.tproj/asl_action.c index 05c2d10..e6dc577 100644 --- a/syslogd.tproj/asl_action.c +++ b/syslogd.tproj/asl_action.c @@ -448,7 +448,7 @@ _asl_dir_storedata_open(asl_out_rule_t *r, uint64_t xid) return -1; } -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR if (chown(dstpath, r->dst->uid[0], r->dst->gid[0]) != 0) { asldebug("_asl_dir_storedata_open: chown %d %d new %s: %s\n", dstpath, r->dst->uid[0], r->dst->gid[0], strerror(errno)); @@ -542,6 +542,7 @@ static int _act_checkpoint(asl_out_rule_t *r, uint32_t force) { char tmpcurrent_name[MAXPATHLEN], *fn; + bool size_only = false; if (r == NULL) return 0; if (r->dst == NULL) return 0; @@ -554,7 +555,12 @@ _act_checkpoint(asl_out_rule_t *r, uint32_t force) fn = tmpcurrent_name; } - if ((force == CHECKPOINT_TEST) && (r->dst->file_max == 0)) return 0; + if ((force == CHECKPOINT_TEST) || (r->dst->flags & MODULE_FLAG_SIZE_ONLY)) + { + size_only = true; + } + + if (size_only && (r->dst->file_max == 0)) return 0; if ((r->dst->size == 0) || (r->dst->timestamp == 0)) { @@ -573,7 +579,7 @@ _act_checkpoint(asl_out_rule_t *r, uint32_t force) r->dst->size = sb.st_size; } - if ((force == CHECKPOINT_TEST) && (r->dst->size < r->dst->file_max)) return 0; + if (size_only && (r->dst->size < r->dst->file_max)) return 0; if (r->dst->flags & MODULE_FLAG_BASESTAMP) { @@ -680,7 +686,7 @@ _asl_dir_today_open(asl_out_rule_t *r, const time_t *tick) return -1; } -#if TARGET_IPHONE_SIMULATOR +#if TARGET_OS_SIMULATOR uid_t uid = -1; gid_t gid = -1; #else @@ -1404,7 +1410,6 @@ _act_file_checkpoint(asl_out_module_t *m, const char *path, uint32_t force) if (m == NULL) return 0; - for (r = m->ruleset; r != NULL; r = r->next) { if ((r->action == ACTION_FILE) || (r->action == ACTION_ASL_FILE)) @@ -1413,24 +1418,10 @@ _act_file_checkpoint(asl_out_module_t *m, const char *path, uint32_t force) { if (_act_file_equal(r->dst->path, path)) { - if (force & CHECKPOINT_CRASH) + if (_act_checkpoint(r, force) > 0) { - if (r->dst->flags & MODULE_FLAG_CRASHLOG) - { - if (_act_checkpoint(r, CHECKPOINT_FORCE) > 0) - { - did_checkpoint = 1; - _act_dst_close(r, DST_CLOSE_CHECKPOINT); - } - } - } - else - { - if (_act_checkpoint(r, force) > 0) - { - did_checkpoint = 1; - _act_dst_close(r, DST_CLOSE_CHECKPOINT); - } + did_checkpoint = 1; + _act_dst_close(r, DST_CLOSE_CHECKPOINT); } } } @@ -1749,7 +1740,7 @@ asl_out_message(asl_msg_t *msg, int64_t msize) if (p != NULL) asl_msg_set_key_val(msg, ASL_KEY_FREE_NOTE, p); /* chain to the next output module (done this way to make queue size accounting easier */ -#if !TARGET_IPHONE_SIMULATOR +#if !TARGET_OS_SIMULATOR if (global.bsd_out_enabled) bsd_out_message(msg, msize); else OSAtomicAdd64(-1ll * msize, &global.memory_size); #else @@ -2447,18 +2438,6 @@ asl_action_control_set_param(const char *s) return 0; } -int -asl_action_file_checkpoint(const char *module, const char *path) -{ - /* Note this is synchronous on asl_action queue */ - dispatch_sync(asl_action_queue, ^{ - asl_out_module_t *m = _asl_action_module_with_name(module); - _act_file_checkpoint(m, path, CHECKPOINT_FORCE); - }); - - return 0; -} - void asl_action_out_module_query(asl_msg_t *q, asl_msg_t *m, bool all) { diff --git a/syslogd.tproj/bsd_in.c b/syslogd.tproj/bsd_in.c index a1beed7..47559d0 100644 --- a/syslogd.tproj/bsd_in.c +++ b/syslogd.tproj/bsd_in.c @@ -72,7 +72,7 @@ bsd_in_init() launch_data_t sockets_dict, fd_array, fd_dict; static dispatch_once_t once; -#if TARGET_IPHONE_SIMULATOR +#if TARGET_OS_SIMULATOR const char *_PATH_SYSLOG_IN = getenv("IOS_SIMULATOR_SYSLOG_SOCKET"); #endif diff --git a/syslogd.tproj/bsd_out.c b/syslogd.tproj/bsd_out.c index 9cd9d43..20ef975 100644 --- a/syslogd.tproj/bsd_out.c +++ b/syslogd.tproj/bsd_out.c @@ -23,7 +23,7 @@ #include -#if TARGET_IPHONE_SIMULATOR +#if TARGET_OS_SIMULATOR struct _not_empty; #else @@ -808,4 +808,4 @@ bsd_out_reset(void) return 0; } -#endif /* !TARGET_IPHONE_SIMULATOR */ +#endif /* !TARGET_OS_SIMULATOR */ diff --git a/syslogd.tproj/com.apple.syslogd.plist b/syslogd.tproj/com.apple.syslogd.plist index bd9c2b7..e6f70ca 100644 --- a/syslogd.tproj/com.apple.syslogd.plist +++ b/syslogd.tproj/com.apple.syslogd.plist @@ -4,21 +4,14 @@ Label com.apple.syslogd - OnDemand - - JetsamProperties - - JetsamPriority - -49 - JetsamMemoryLimit - 300 - - HopefullyExitsLast + KeepAlive EnableTransactions - POSIXSpawnType - Adaptive + EnablePressuredExit + + POSIXSpawnType + Adaptive ProgramArguments