In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/245c138eeeb54c68f594609593a6d05004ef4d82?hp=aff2be59e4b3bbb62744c92140fb0be47ae32d1c>

- Log -----------------------------------------------------------------
commit 245c138eeeb54c68f594609593a6d05004ef4d82
Author: Lukas Mai <l....@web.de>
Date:   Fri Oct 14 13:21:33 2016 +0200

    perlsec: convert C snippet from K&R C to C89
    
    Also include required headers and report errors on failure.
    
    (Inspired by afoken's post at <http://perlmonks.org/?node_id=1173959>.)
-----------------------------------------------------------------------

Summary of changes:
 pod/perlsec.pod | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/pod/perlsec.pod b/pod/perlsec.pod
index 43dd136..3635ec3 100644
--- a/pod/perlsec.pod
+++ b/pod/perlsec.pod
@@ -393,11 +393,19 @@ except call your Perl program.   Compiled programs are 
not subject to the
 kernel bug that plagues set-id scripts.  Here's a simple wrapper, written
 in C:
 
+    #include <unistd.h>
+    #include <stdio.h>
+    #include <string.h>
+    #include <errno.h>
+
     #define REAL_PATH "/path/to/script"
-    main(ac, av)
-       char **av;
+
+    int main(int argc, char **argv)
     {
-       execv(REAL_PATH, av);
+        execv(REAL_PATH, argv);
+        fprintf(stderr, "%s: %s: %s\n",
+                        argv[0], REAL_PATH, strerror(errno));
+        return 127;
     }
 
 Compile this wrapper into a binary executable and then make I<it> rather

--
Perl5 Master Repository

Reply via email to