From: H.Merijn Brand Date: Mon, 29 Mar 2010 08:16:44 +0000 (+0200) Subject: Probe for prctl () and check id PR_SET_NAME is supported X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c796e3db23c597b99f07485542338844e61a6a69;p=p5sagit%2Fp5-mst-13.2.git Probe for prctl () and check id PR_SET_NAME is supported --- diff --git a/Configure b/Configure index 576b88d..f4d9cfb 100755 --- a/Configure +++ b/Configure @@ -30,7 +30,7 @@ # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $ # -# Generated on Sat Feb 13 19:05:42 CET 2010 [metaconfig 3.5 PL0] +# Generated on Mon Mar 29 10:12:43 CEST 2010 [metaconfig 3.5 PL0] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <try.c < + +int main (int argc, char *argv[]) +{ + return (prctl (PR_SET_NAME, "Test")); + } /* main */ +EOM + set try + if eval $compile_ok && $run ./try; then + echo "Your prctl (PR_SET_NAME, ...) works" + d_prctl_set_name=$define + fi + $rm_try + ;; + esac + : see if readlink exists set readlink d_readlink eval $inlibc @@ -22615,6 +22642,8 @@ d_phostname='$d_phostname' d_pipe='$d_pipe' d_poll='$d_poll' d_portable='$d_portable' +d_prctl='$d_prctl' +d_prctl_set_name='$d_prctl_set_name' d_printf_format_null='$d_printf_format_null' d_procselfexe='$d_procselfexe' d_pseudofork='$d_pseudofork' diff --git a/Porting/Glossary b/Porting/Glossary index e43fa89..b503e2b 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -1617,6 +1617,14 @@ d_portable (d_portable.U): indicates to the C program that it should not assume that it is running on the machine it was compiled on. +d_prctl (d_prctl.U): + This variable conditionally defines the HAS_PRCTL symbol, which + indicates to the C program that the prctl() routine is available. + +d_prctl_set_name (d_prctl.U): + This variable conditionally defines the HAS_PRCTL symbol, which + indicates to the C program that the prctl() routine is available. + d_PRId64 (quadfio.U): This variable conditionally defines the PERL_PRId64 symbol, which indiciates that stdio has a symbol to print 64-bit decimal numbers. diff --git a/config_h.SH b/config_h.SH index 8392c60..eedc734 100755 --- a/config_h.SH +++ b/config_h.SH @@ -1185,6 +1185,26 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un #$d_ctime_r HAS_CTIME_R /**/ #define CTIME_R_PROTO $ctime_r_proto /**/ +/* SETUID_SCRIPTS_ARE_SECURE_NOW: + * This symbol, if defined, indicates that the bug that prevents + * setuid scripts from being secure is not present in this kernel. + */ +/* DOSUID: + * This symbol, if defined, indicates that the C program should + * check the script that it is executing for setuid/setgid bits, and + * attempt to emulate setuid/setgid on systems that have disabled + * setuid #! scripts because the kernel can't do it securely. + * It is up to the package designer to make sure that this emulation + * is done securely. Among other things, it should do an fstat on + * the script it just opened to make sure it really is a setuid/setgid + * script, it should make sure the arguments passed correspond exactly + * to the argument on the #! line, and it should not trust any + * subprocesses to which it must pass the filename rather than the + * file descriptor of the script to be executed. + */ +#$d_suidsafe SETUID_SCRIPTS_ARE_SECURE_NOW /**/ +#$d_dosuid DOSUID /**/ + /* HAS_DRAND48_R: * This symbol, if defined, indicates that the drand48_r routine * is available to drand48 re-entrantly. @@ -3309,26 +3329,6 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$ebcdic EBCDIC /**/ -/* SETUID_SCRIPTS_ARE_SECURE_NOW: - * This symbol, if defined, indicates that the bug that prevents - * setuid scripts from being secure is not present in this kernel. - */ -/* DOSUID: - * This symbol, if defined, indicates that the C program should - * check the script that it is executing for setuid/setgid bits, and - * attempt to emulate setuid/setgid on systems that have disabled - * setuid #! scripts because the kernel can't do it securely. - * It is up to the package designer to make sure that this emulation - * is done securely. Among other things, it should do an fstat on - * the script it just opened to make sure it really is a setuid/setgid - * script, it should make sure the arguments passed correspond exactly - * to the argument on the #! line, and it should not trust any - * subprocesses to which it must pass the filename rather than the - * file descriptor of the script to be executed. - */ -#$d_suidsafe SETUID_SCRIPTS_ARE_SECURE_NOW /**/ -#$d_dosuid DOSUID /**/ - /* PERL_USE_DEVEL: * This symbol, if defined, indicates that Perl was configured with * -Dusedevel, to enable development features. This should not be @@ -3807,6 +3807,17 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un */ #$d_off64_t HAS_OFF64_T /**/ +/* HAS_PRCTL: + * This symbol, if defined, indicates that the prctl routine is + * available to set process title. + */ +/* HAS_PRCTL_SET_NAME: + * This symbol, if defined, indicates that the prctl routine is + * available to set process title and supports PR_SET_NAME. + */ +#$d_prctl HAS_PRCTL /**/ +#$d_prctl_set_name HAS_PRCTL_SET_NAME /**/ + /* HAS_PROCSELFEXE: * This symbol is defined if PROCSELFEXE_PATH is a symlink * to the absolute pathname of the executing program. diff --git a/handy.h b/handy.h index d12972d..81bf1e2 100644 --- a/handy.h +++ b/handy.h @@ -208,7 +208,8 @@ typedef U64TYPE U64; * GMTIME_MAX GMTIME_MIN LOCALTIME_MAX LOCALTIME_MIN * HAS_CTIME64 HAS_LOCALTIME64 HAS_GMTIME64 HAS_DIFFTIME64 * HAS_MKTIME64 HAS_ASCTIME64 HAS_GETADDRINFO HAS_GETNAMEINFO - * HAS_INETNTOP HAS_INETPTON CHARBITS + * HAS_INETNTOP HAS_INETPTON CHARBITS HAS_PRCTL_SET_NAME + * HAS_PRCTL * Not (yet) used at top level, but mention them for metaconfig */