]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
negotiate_wrapper: Do not use vfork() (#1697)
authorFrancesco Chemolli <5175948+kinkie@users.noreply.github.com>
Fri, 23 Feb 2024 14:35:53 +0000 (14:35 +0000)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sat, 24 Feb 2024 06:34:41 +0000 (19:34 +1300)
POSIX.1-2001 marks vfork(2) OBSOLETE.
POSIX.1-2008 removes the specification of vfork(2).
MacOS system headers declare vfork(2) as deprecated.
We only use vfork(2) in negotiate_wrapper, where it is not necessary.

src/auth/negotiate/wrapper/negotiate_wrapper.cc
src/auth/negotiate/wrapper/required.m4

index 5b39e643fbd27322335e5cb9642c69b55507008b..4db7adcc0629a223a9dd15bed3eb5123fe6514ec 100644 (file)
@@ -354,7 +354,7 @@ main(int argc, char *const argv[])
         exit(EXIT_FAILURE);
     }
 
-    if  (( fpid = vfork()) < 0 ) {
+    if  (( fpid = fork()) < 0 ) {
         fprintf(stderr, "%s| %s: Failed first fork\n", LogTime(), PROGRAM);
         exit(EXIT_FAILURE);
     }
@@ -390,7 +390,7 @@ main(int argc, char *const argv[])
         exit(EXIT_FAILURE);
     }
 
-    if  (( fpid = vfork()) < 0 ) {
+    if  (( fpid = fork()) < 0 ) {
         fprintf(stderr, "%s| %s: Failed second fork\n", LogTime(), PROGRAM);
         exit(EXIT_FAILURE);
     }
index 3fbc680121063ca6928bd1db52d2f0532753c492..1fc7464fb76fe4519a075ede6024d4dca0bec186 100755 (executable)
@@ -5,4 +5,4 @@
 ## Please see the COPYING and CONTRIBUTORS files for details.
 ##
 
-AC_CHECK_FUNCS(vfork,[BUILD_HELPER="wrapper"])
+BUILD_HELPER="wrapper"