]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Common source file change not applicable to open-vm-tools
authorOliver Kurth <okurth@vmware.com>
Fri, 26 Oct 2018 17:44:55 +0000 (10:44 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 26 Oct 2018 17:44:55 +0000 (10:44 -0700)
open-vm-tools/lib/misc/idLinux.c

index 1e5f6b7927e4c4386eb32c66fe82c5124f42cbd8..a3cc0ea961cf6cfde881f8c653a1198908327216 100644 (file)
@@ -602,19 +602,21 @@ IdAuthCreateWithFork(void)
       VERIFY(result == child);
    } else {
       // Child: use fds[1]
+      OSStatus ret;
 
-      data.success = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
-                                         kAuthorizationFlagDefaults, &auth)
-                     == errAuthorizationSuccess;
+      ret = AuthorizationCreate(NULL, kAuthorizationEmptyEnvironment,
+                                kAuthorizationFlagDefaults, &auth);
+      data.success = ret == errAuthorizationSuccess;
       if (data.success) {
-         data.success = AuthorizationMakeExternalForm(auth, &data.ext)
-                        == errAuthorizationSuccess;
+         ret = AuthorizationMakeExternalForm(auth, &data.ext);
+         data.success = ret == errAuthorizationSuccess;
          if (!data.success) {
-            Warning("%s: child AuthorizationMakeExternalForm() failed.\n",
-                    __func__);
+            Warning("%s: child AuthorizationMakeExternalForm() failed: %d.\n",
+                    __func__, (int32)ret);
          }
       } else {
-         Warning("%s: child AuthorizationCreate() failed.\n", __func__);
+         Warning("%s: child AuthorizationCreate() failed: %d.\n",
+                 __func__, (int32)ret);
       }
 
       // Tell the parent it can now create a process ref to the auth session.
@@ -675,6 +677,8 @@ static Atomic_Ptr procAuth = { 0 };
 static AuthorizationRef
 IdAuthGet(void)
 {
+   AuthorizationRef authRef;
+
    if (UNLIKELY(Atomic_ReadPtr(&procAuth) == NULL)) {
       AuthorizationRef newProcAuth = IdAuthCreate();
 
@@ -684,9 +688,12 @@ IdAuthGet(void)
       }
    }
 
-   ASSERT(Atomic_ReadPtr(&procAuth) != NULL);
+   authRef = Atomic_ReadPtr(&procAuth);
+   if (authRef == NULL) {
+      Log("%s: Failed to obtain an AuthorizationRef.\n", __func__);
+   }
 
-   return Atomic_ReadPtr(&procAuth);
+   return authRef;
 }