From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Sun, 19 Feb 2023 16:27:27 +0000 (-0500) Subject: cupsMakeServerCredentials should return 0 on failure, 1 on success X-Git-Tag: v2.4.3~40^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F617%2Fhead;p=thirdparty%2Fcups.git cupsMakeServerCredentials should return 0 on failure, 1 on success Currently, it returns -1 on error it seems, which is not how the function is documented to work. --- diff --git a/cups/tls-darwin.c b/cups/tls-darwin.c index 8f8161c748..805796a286 100644 --- a/cups/tls-darwin.c +++ b/cups/tls-darwin.c @@ -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);