]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
cupsMakeServerCredentials should return 0 on failure, 1 on success 617/head
authorRose <83477269+AtariDreams@users.noreply.github.com>
Sun, 19 Feb 2023 16:27:27 +0000 (11:27 -0500)
committerRose <83477269+AtariDreams@users.noreply.github.com>
Sat, 4 Mar 2023 15:13:54 +0000 (10:13 -0500)
Currently, it returns -1 on error it seems, which is not how the function is documented to work.

cups/tls-darwin.c

index 8f8161c7482b095903ec01621d20a13970b98dcc..805796a2861b36f9f8a50b49bf682e5cfda0c7f4 100644 (file)
@@ -109,7 +109,7 @@ cupsMakeServerCredentials(
   */
 
   if (!cupsFileFind("certtool", getenv("PATH"), 1, command, sizeof(command)))
-    return (-1);
+    return (0);
 
  /*
   * Create a file with the certificate information fields...
@@ -119,7 +119,7 @@ cupsMakeServerCredentials(
   */
 
  if ((fp = cupsTempFile2(infofile, sizeof(infofile))) == NULL)
-    return (-1);
+    return (0);
 
   cupsFilePrintf(fp,
                 "CUPS Self-Signed Certificate\n"
@@ -166,7 +166,7 @@ cupsMakeServerCredentials(
   if (posix_spawn(&pid, command, &actions, NULL, argv, envp))
   {
     unlink(infofile);
-    return (-1);
+    return (0);
   }
 
   posix_spawn_file_actions_destroy(&actions);
@@ -176,8 +176,7 @@ cupsMakeServerCredentials(
   while (waitpid(pid, &status, 0) < 0)
     if (errno != EINTR)
     {
-      status = -1;
-      break;
+      return (0);
     }
 
   return (!status);