Prevent path disclosure (probing for existence of filenames)
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 24 Apr 2001 12:54:23 +0000 (12:54 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 24 Apr 2001 12:54:23 +0000 (12:54 +0000)
using suidperl; bug id 20010322.218.

p4raw-id: //depot/perl@9813

perl.c
pod/perldiag.pod

diff --git a/perl.c b/perl.c
index 834dc46..4a423dc 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -2718,8 +2718,14 @@ sed %s -e \"/^[^#]/b\" \
        }
 #endif
 #endif
+#ifdef IAMSUID
+       errno = EPERM;
+       Perl_croak(aTHX_ "Can't open perl script: %s\n",
+                  Strerror(errno));
+#else
        Perl_croak(aTHX_ "Can't open perl script \"%s\": %s\n",
                   CopFILE(PL_curcop), Strerror(errno));
+#endif
     }
 }
 
index 307f22d..98b2580 100644 (file)
@@ -868,7 +868,7 @@ the command line for writing.
 redirection, and couldn't open the pipe into which to send data destined
 for stdout.
 
-=item Can't open perl script "%s": %s
+=item Can't open perl script%s: %s
 
 (F) The script you specified can't be opened for the indicated reason.