Change 32997 by [EMAIL PROTECTED] on 2008/01/18 09:40:02

        Collect all the S_validate_suid() unused argument logic in one place.

Affected files ...

... //depot/perl/perl.c#851 edit

Differences ...

==== //depot/perl/perl.c#851 (text) ====
Index: perl/perl.c
--- perl/perl.c#850~32996~      2008-01-18 01:27:13.000000000 -0800
+++ perl/perl.c 2008-01-18 01:40:02.000000000 -0800
@@ -3767,6 +3767,24 @@
                int fdscript, int suidscript, SV *linestr_sv, PerlIO *rsfp)
 {
     dVAR;
+#ifdef DOSUID
+    const char *s, *s2;
+#endif
+
+#ifdef DOSUID
+#  ifdef IAMSUID
+    PERL_UNUSED_ARG(scriptname);
+#  endif
+#else
+    PERL_UNUSED_ARG(validarg);
+    PERL_UNUSED_ARG(scriptname);
+    PERL_UNUSED_ARG(linestr_sv);
+    PERL_UNUSED_ARG(fdscript);
+    PERL_UNUSED_ARG(suidscript);
+#  ifdef SETUID_SCRIPTS_ARE_SECURE_NOW
+    PERL_UNUSED_ARG(rsfp);
+#  endif
+#endif
 
     /* do we need to emulate setuid on scripts? */
 
@@ -3796,7 +3814,6 @@
      */
 
 #ifdef DOSUID
-    const char *s, *s2;
 
     if (PerlLIO_fstat(PerlIO_fileno(rsfp),&PL_statbuf) < 0)    /* normal stat 
is insecure */
        Perl_croak(aTHX_ "Can't stat script \"%s\"",PL_origfilename);
@@ -4140,12 +4157,8 @@
     Perl_croak(aTHX_ "Can't do setuid (suidperl cannot exec perl)\n");
 #  endif /* IAMSUID */
 #else /* !DOSUID */
-    PERL_UNUSED_ARG(fdscript);
-    PERL_UNUSED_ARG(suidscript);
     if (PL_euid != PL_uid || PL_egid != PL_gid) {      /* (suidperl doesn't 
exist, in fact) */
-#  ifdef SETUID_SCRIPTS_ARE_SECURE_NOW
-    PERL_UNUSED_ARG(rsfp);
-#  else
+#  ifndef SETUID_SCRIPTS_ARE_SECURE_NOW
        PerlLIO_fstat(PerlIO_fileno(rsfp),&PL_statbuf); /* may be either 
wrapped or real suid */
        if ((PL_euid != PL_uid && PL_euid == PL_statbuf.st_uid && 
PL_statbuf.st_mode & S_ISUID)
            ||
@@ -4158,9 +4171,6 @@
        /* not set-id, must be wrapped */
     }
 #endif /* DOSUID */
-    PERL_UNUSED_ARG(validarg);
-    PERL_UNUSED_ARG(scriptname);
-    PERL_UNUSED_ARG(linestr_sv);
 }
 
 STATIC void
End of Patch.

Reply via email to