From ae1951c189f1b82f18b60e8a8dae5f87c3eedec8 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Thu, 3 Nov 2005 11:09:39 +0000 Subject: [PATCH] Patch 3945 was a bit overkeen - the effective parameter to cando() and ingroup() is a boolean flag, not a GID or UID. p4raw-id: //depot/perl@25969 --- doio.c | 9 +++++---- embed.fnc | 4 ++-- proto.h | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/doio.c b/doio.c index 0af6a0a..5511b55 100644 --- a/doio.c +++ b/doio.c @@ -1872,9 +1872,10 @@ nothing in the core. /* Do the permissions allow some operation? Assumes statcache already set. */ #ifndef VMS /* VMS' cando is in vms.c */ bool -Perl_cando(pTHX_ Mode_t mode, Uid_t effective, register const Stat_t *statbufp) -/* Note: we use "effective" both for uids and gids. - * Here we are betting on Uid_t being equal or wider than Gid_t. */ +Perl_cando(pTHX_ Mode_t mode, bool effective, register const Stat_t *statbufp) +/* effective is a flag, true for EUID, or for checking if the effective gid + * is in the list of groups returned from getgroups(). + */ { #ifdef DOSISH /* [Comments and code from Len Reed] @@ -1926,7 +1927,7 @@ Perl_cando(pTHX_ Mode_t mode, Uid_t effective, register const Stat_t *statbufp) #endif /* ! VMS */ bool -Perl_ingroup(pTHX_ Gid_t testgid, Uid_t effective) +Perl_ingroup(pTHX_ Gid_t testgid, bool effective) { #ifdef MACOS_TRADITIONAL /* This is simply not correct for AppleShare, but fix it yerself. */ diff --git a/embed.fnc b/embed.fnc index 4202e7a..df347c3 100644 --- a/embed.fnc +++ b/embed.fnc @@ -119,7 +119,7 @@ pR |int |block_start |int full p |void |boot_core_UNIVERSAL p |void |boot_core_PerlIO Ap |void |call_list |I32 oldscope|NN AV* av_list -pR |bool |cando |Mode_t mode|Uid_t effective|NN const Stat_t* statbufp +pR |bool |cando |Mode_t mode|bool effective|NN const Stat_t* statbufp ApR |U32 |cast_ulong |NV f ApR |I32 |cast_i32 |NV f ApR |IV |cast_iv |NV f @@ -307,7 +307,7 @@ ApP |I32 |ibcmp |NN const char* a|NN const char* b|I32 len ApP |I32 |ibcmp_locale |NN const char* a|NN const char* b|I32 len Apd |I32 |ibcmp_utf8 |NN const char* a|NULLOK char **pe1|UV l1|bool u1 \ |NN const char* b|NULLOK char **pe2|UV l2|bool u2 -pR |bool |ingroup |Gid_t testgid|Uid_t effective +pR |bool |ingroup |Gid_t testgid|bool effective p |void |init_argv_symbols|int argc|NN char **argv p |void |init_debugger Ap |void |init_stacks diff --git a/proto.h b/proto.h index 2050389..2839a18 100644 --- a/proto.h +++ b/proto.h @@ -184,7 +184,7 @@ PERL_CALLCONV void Perl_boot_core_PerlIO(pTHX); PERL_CALLCONV void Perl_call_list(pTHX_ I32 oldscope, AV* av_list) __attribute__nonnull__(pTHX_2); -PERL_CALLCONV bool Perl_cando(pTHX_ Mode_t mode, Uid_t effective, const Stat_t* statbufp) +PERL_CALLCONV bool Perl_cando(pTHX_ Mode_t mode, bool effective, const Stat_t* statbufp) __attribute__warn_unused_result__ __attribute__nonnull__(pTHX_3); @@ -713,7 +713,7 @@ PERL_CALLCONV I32 Perl_ibcmp_utf8(pTHX_ const char* a, char **pe1, UV l1, bool u __attribute__nonnull__(pTHX_1) __attribute__nonnull__(pTHX_5); -PERL_CALLCONV bool Perl_ingroup(pTHX_ Gid_t testgid, Uid_t effective) +PERL_CALLCONV bool Perl_ingroup(pTHX_ Gid_t testgid, bool effective) __attribute__warn_unused_result__; PERL_CALLCONV void Perl_init_argv_symbols(pTHX_ int argc, char **argv) -- 2.7.4