This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #72990] Mac OS X and setruid, etc.
authorFather Chrysostomos <sprout@cpan.org>
Mon, 27 Sep 2010 05:27:29 +0000 (22:27 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 27 Sep 2010 05:27:29 +0000 (22:27 -0700)
hints/darwin.sh pretends that setruid and similar functions do not
exist, as they were buggy in earlier versions of Mac OS X. Leopard and
Snow Leopard (I don’t know about Tiger) are fine. The attached patch
re-enables those on recent versions.

hints/darwin.sh

index 6cb9bd1..dab0607 100644 (file)
@@ -13,11 +13,16 @@ perl_version=`awk '/define[         ]+PERL_VERSION/ {print $3}' $src/patchlevel.h`
 perl_subversion=`awk '/define[         ]+PERL_SUBVERSION/ {print $3}' $src/patchlevel.h`
 version="${perl_revision}.${perl_version}.${perl_subversion}"
 
-# Pretend that Darwin doesn't know about those system calls [perl #24122]
-d_setregid='undef'
-d_setreuid='undef'
-d_setrgid='undef'
-d_setruid='undef'
+# Pretend that Darwin doesn't know about those system calls in Tiger
+# (10.4/darwin 8) and earlier [perl #24122]
+case "$osvers" in
+[1-8].*)
+    d_setregid='undef'
+    d_setreuid='undef'
+    d_setrgid='undef'
+    d_setruid='undef'
+    ;;
+esac
 
 # This was previously used in all but causes three cases
 # (no -Ddprefix=, -Dprefix=/usr, -Dprefix=/some/thing/else)