From c1cdbeda53937ed92e237ebc57a6e401a6d319c6 Mon Sep 17 00:00:00 2001 From: Apple Date: Tue, 18 Jun 2019 01:06:23 +0000 Subject: [PATCH] configd-963.250.1.tar.gz --- SystemConfiguration.fproj/config.defs | 10 +++++----- SystemConfiguration.fproj/helper/SCHelper_server.c | 4 +++- configd.tproj/_configadd.c | 10 +++------- configd.tproj/_configget.c | 8 ++------ configd.tproj/_configopen.c | 3 ++- configd.tproj/_configset.c | 4 ++-- configd.tproj/configd_server.h | 12 ++++++------ 7 files changed, 23 insertions(+), 28 deletions(-) diff --git a/SystemConfiguration.fproj/config.defs b/SystemConfiguration.fproj/config.defs index 7c7a335..836f366 100644 --- a/SystemConfiguration.fproj/config.defs +++ b/SystemConfiguration.fproj/config.defs @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, 2003-2005, 2011, 2012, 2015 Apple Inc. All rights reserved. + * Copyright (c) 2000, 2001, 2003-2005, 2011, 2012, 2015, 2019 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -109,14 +109,14 @@ routine configlist ( server : mach_port_t; routine configadd ( server : mach_port_t; key : xmlData; data : xmlData; - out newInstance : int; + out newInstance : int; // no longer used out status : int; ServerAuditToken audit_token : audit_token_t); routine configget ( server : mach_port_t; key : xmlData; out data : xmlDataOut, dealloc; - out newInstance : int; + out newInstance : int; // no longer used out status : int; ServerAuditToken audit_token : audit_token_t); @@ -124,7 +124,7 @@ routine configset ( server : mach_port_t; key : xmlData; data : xmlData; instance : int; - out newInstance : int; + out newInstance : int; // no longer used out status : int; ServerAuditToken audit_token : audit_token_t); @@ -138,7 +138,7 @@ routine configremove ( server : mach_port_t; routine configadd_s ( server : mach_port_t; key : xmlData; data : xmlData; - out newInstance : int; + out newInstance : int; // no longer used out status : int); routine confignotify ( server : mach_port_t; diff --git a/SystemConfiguration.fproj/helper/SCHelper_server.c b/SystemConfiguration.fproj/helper/SCHelper_server.c index a635076..10a21ed 100644 --- a/SystemConfiguration.fproj/helper/SCHelper_server.c +++ b/SystemConfiguration.fproj/helper/SCHelper_server.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005-2018 Apple Inc. All rights reserved. + * Copyright (c) 2005-2019 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -2097,6 +2097,8 @@ _helperinit(mach_port_t server, pthread_attr_t tattr; pthread_t tid; + *newSession = MACH_PORT_NULL; + session = __SCHelperSessionFindWithPort(server); if (session != NULL) { #ifdef DEBUG diff --git a/configd.tproj/_configadd.c b/configd.tproj/_configadd.c index 38ee21e..c66bede 100644 --- a/configd.tproj/_configadd.c +++ b/configd.tproj/_configadd.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2001, 2003, 2004, 2006, 2008, 2011, 2012, 2014-2017 Apple Inc. All rights reserved. + * Copyright (c) 2000, 2001, 2003, 2004, 2006, 2008, 2011, 2012, 2014-2017, 2019 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -98,6 +98,7 @@ _configadd(mach_port_t server, CFDataRef data = NULL; /* data (un-serialized) */ serverSessionRef mySession; + *newInstance = 0; *sc_status = kSCStatusOK; /* un-serialize the key */ @@ -136,9 +137,6 @@ _configadd(mach_port_t server, } *sc_status = __SCDynamicStoreAddValue(mySession->store, key, data); - if (*sc_status == kSCStatusOK) { - *newInstance = 0; - } done : @@ -165,6 +163,7 @@ _configadd_s(mach_port_t server, SCDynamicStorePrivateRef storePrivate; Boolean useSessionKeys; + *newInstance = 0; *sc_status = kSCStatusOK; /* un-serialize the key */ @@ -204,9 +203,6 @@ _configadd_s(mach_port_t server, storePrivate->useSessionKeys = TRUE; *sc_status = __SCDynamicStoreAddValue(mySession->store, key, data); - if (*sc_status == kSCStatusOK) { - *newInstance = 0; - } // restore "useSessionKeys" storePrivate->useSessionKeys = useSessionKeys; diff --git a/configd.tproj/_configget.c b/configd.tproj/_configget.c index 6a08c54..936bd46 100644 --- a/configd.tproj/_configget.c +++ b/configd.tproj/_configget.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2006, 2008, 2011, 2013-2016 Apple Inc. All rights reserved. + * Copyright (c) 2000-2006, 2008, 2011, 2013-2016, 2019 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -77,6 +77,7 @@ _configget(mach_port_t server, *dataRef = NULL; *dataLen = 0; + *newInstance = 0; /* un-serialize the key */ if (!_SCUnserializeString(&key, NULL, (void *)keyRef, keyLen)) { @@ -113,11 +114,6 @@ _configget(mach_port_t server, goto done; } - /* - * return the instance number associated with the returned data. - */ - *newInstance = 1; - done : if (key != NULL) CFRelease(key); diff --git a/configd.tproj/_configopen.c b/configd.tproj/_configopen.c index 37f7981..f4a2500 100644 --- a/configd.tproj/_configopen.c +++ b/configd.tproj/_configopen.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2009, 2011, 2015-2017 Apple Inc. All rights reserved. + * Copyright (c) 2000-2009, 2011, 2015-2017, 2019 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -109,6 +109,7 @@ _configopen(mach_port_t server, SCDynamicStorePrivateRef storePrivate; CFBooleanRef useSessionKeys = NULL; + *newServer = MACH_PORT_NULL; *sc_status = kSCStatusOK; /* un-serialize the name */ diff --git a/configd.tproj/_configset.c b/configd.tproj/_configset.c index 4497e44..88706d0 100644 --- a/configd.tproj/_configset.c +++ b/configd.tproj/_configset.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2004, 2006, 2008, 2011, 2012, 2014-2017 Apple Inc. All rights reserved. + * Copyright (c) 2000-2004, 2006, 2008, 2011, 2012, 2014-2017, 2019 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -222,6 +222,7 @@ _configset(mach_port_t server, CFStringRef key = NULL; /* key (un-serialized) */ serverSessionRef mySession; + *newInstance = 0; *sc_status = kSCStatusOK; /* un-serialize the key */ @@ -259,7 +260,6 @@ _configset(mach_port_t server, } *sc_status = __SCDynamicStoreSetValue(mySession->store, key, data, FALSE); - *newInstance = 0; done : diff --git a/configd.tproj/configd_server.h b/configd.tproj/configd_server.h index 1b9fbd4..caf743f 100644 --- a/configd.tproj/configd_server.h +++ b/configd.tproj/configd_server.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2006, 2008, 2011. 2015 Apple Inc. All rights reserved. + * Copyright (c) 2000-2006, 2008, 2011, 2015, 2019 Apple Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * @@ -79,7 +79,7 @@ kern_return_t _configadd (mach_port_t server, mach_msg_type_number_t keyLen, xmlData_t dataRef, mach_msg_type_number_t dataLen, - int *newInstance, + int *newInstance, // no longer used int *sc_status, audit_token_t audit_token); @@ -88,7 +88,7 @@ kern_return_t _configadd_s (mach_port_t server, mach_msg_type_number_t keyLen, xmlData_t dataRef, mach_msg_type_number_t dataLen, - int *newInstance, + int *newInstance, // no longer used int *sc_status); kern_return_t _configget (mach_port_t server, @@ -96,7 +96,7 @@ kern_return_t _configget (mach_port_t server, mach_msg_type_number_t keyLen, xmlDataOut_t *dataRef, mach_msg_type_number_t *dataLen, - int *newInstance, + int *newInstance, // no longer used int *sc_status, audit_token_t audit_token); @@ -105,7 +105,7 @@ kern_return_t _configset (mach_port_t server, mach_msg_type_number_t keyLen, xmlData_t dataRef, mach_msg_type_number_t dataLen, - int *newInstance, + int *newInstance, // no longer used int *sc_status, audit_token_t audit_token); @@ -186,4 +186,4 @@ kern_return_t _notifyset (mach_port_t server, __END_DECLS -#endif /* !_S_CONFIGD_SERVER_H */ +#endif /* !_S_CONFIGD_SERVER_H */ -- 2.45.2