diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-10 09:06:42 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-10 09:06:42 +0000 |
commit | d8eceb896c98708a63dcc63f7bf202b095342359 (patch) | |
tree | 9701b08cb03f36f95bdc3bc268845cf99e36dd6f | |
parent | 1ff81528d9b685c68d4fe91564f636f46d635496 (diff) | |
download | perl-d8eceb896c98708a63dcc63f7bf202b095342359.tar.gz |
Gratuitous uid and gid casts to I32s and ints removed.
There are still problem spots in printfing such ids:
width (%d vs %ld) and signedness %d vs %u.
p4raw-id: //depot/cfgperl@3945
-rw-r--r-- | doio.c | 9 | ||||
-rwxr-xr-x | embed.pl | 4 | ||||
-rw-r--r-- | intrpvar.h | 8 | ||||
-rw-r--r-- | mg.c | 16 | ||||
-rw-r--r-- | perl.c | 8 | ||||
-rwxr-xr-x | perlapi.c | 6 | ||||
-rw-r--r-- | pp_hot.c | 8 | ||||
-rw-r--r-- | proto.h | 5 |
8 files changed, 32 insertions, 32 deletions
@@ -1488,7 +1488,8 @@ nothing in the core. /* Do the permissions allow some operation? Assumes statcache already set. */ #ifndef VMS /* VMS' cando is in vms.c */ I32 -Perl_cando(pTHX_ I32 bit, I32 effective, register struct stat *statbufp) +Perl_cando(pTHX_ I32 bit, Uid_t effective, register struct stat *statbufp) +/* Note: we use `effective' both for uids and gids. */ { #ifdef DOSISH /* [Comments and code from Len Reed] @@ -1528,7 +1529,7 @@ Perl_cando(pTHX_ I32 bit, I32 effective, register struct stat *statbufp) if (statbufp->st_mode & bit) return TRUE; /* ok as "user" */ } - else if (ingroup((I32)statbufp->st_gid,effective)) { + else if (ingroup(statbufp->st_gid,effective)) { if (statbufp->st_mode & bit >> 3) return TRUE; /* ok as "group" */ } @@ -1539,8 +1540,8 @@ Perl_cando(pTHX_ I32 bit, I32 effective, register struct stat *statbufp) } #endif /* ! VMS */ -I32 -Perl_ingroup(pTHX_ I32 testgid, I32 effective) +bool +Perl_ingroup(pTHX_ Gid_t testgid, Uid_t effective) { if (testgid == (effective ? PL_egid : PL_gid)) return TRUE; @@ -1051,7 +1051,7 @@ p |I32 |block_gimme p |int |block_start |int full p |void |boot_core_UNIVERSAL p |void |call_list |I32 oldscope|AV* av_list -p |I32 |cando |I32 bit|I32 effective|Stat_t* statbufp +p |I32 |cando |I32 bit|Uid_t effective|Stat_t* statbufp p |U32 |cast_ulong |NV f p |I32 |cast_i32 |NV f p |IV |cast_iv |NV f @@ -1222,7 +1222,7 @@ p |HE* |hv_store_ent |HV* tb|SV* key|SV* val|U32 hash p |void |hv_undef |HV* tb p |I32 |ibcmp |const char* a|const char* b|I32 len p |I32 |ibcmp_locale |const char* a|const char* b|I32 len -p |I32 |ingroup |I32 testgid|I32 effective +p |bool |ingroup |Gid_t testgid|Uid_t effective p |void |init_debugger p |void |init_stacks p |U32 |intro_my diff --git a/intrpvar.h b/intrpvar.h index 65ab5c64fc..a291d393ca 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -200,10 +200,10 @@ PERLVARI(Ithreadnum, U32, 0) /* incremented each thread creation */ PERLVAR(Istrtab_mutex, perl_mutex) /* Mutex for string table access */ #endif /* USE_THREADS */ -PERLVAR(Iuid, int) /* current real user id */ -PERLVAR(Ieuid, int) /* current effective user id */ -PERLVAR(Igid, int) /* current real group id */ -PERLVAR(Iegid, int) /* current effective group id */ +PERLVAR(Iuid, Uid_t) /* current real user id */ +PERLVAR(Ieuid, Uid_t) /* current effective user id */ +PERLVAR(Igid, Gid_t) /* current real group id */ +PERLVAR(Iegid, Gid_t) /* current effective group id */ PERLVAR(Inomemok, bool) /* let malloc context handle nomem */ PERLVAR(Ian, U32) /* malloc sequence number */ PERLVAR(Icop_seqmax, U32) /* statement sequence number */ @@ -1813,13 +1813,13 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) if (PL_uid == PL_euid) /* special case $< = $> */ (void)PerlProc_setuid(PL_uid); else { - PL_uid = (I32)PerlProc_getuid(); + PL_uid = PerlProc_getuid(); Perl_croak(aTHX_ "setruid() not implemented"); } #endif #endif #endif - PL_uid = (I32)PerlProc_getuid(); + PL_uid = PerlProc_getuid(); PL_tainting |= (PL_uid && (PL_euid != PL_uid || PL_egid != PL_gid)); break; case '>': @@ -1840,13 +1840,13 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) if (PL_euid == PL_uid) /* special case $> = $< */ PerlProc_setuid(PL_euid); else { - PL_euid = (I32)PerlProc_geteuid(); + PL_euid = rlProc_geteuid(); Perl_croak(aTHX_ "seteuid() not implemented"); } #endif #endif #endif - PL_euid = (I32)PerlProc_geteuid(); + PL_euid = PerlProc_geteuid(); PL_tainting |= (PL_uid && (PL_euid != PL_uid || PL_egid != PL_gid)); break; case '(': @@ -1867,13 +1867,13 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) if (PL_gid == PL_egid) /* special case $( = $) */ (void)PerlProc_setgid(PL_gid); else { - PL_gid = (I32)PerlProc_getgid(); + PL_gid = PerlProc_getgid(); Perl_croak(aTHX_ "setrgid() not implemented"); } #endif #endif #endif - PL_gid = (I32)PerlProc_getgid(); + PL_gid = PerlProc_getgid(); PL_tainting |= (PL_uid && (PL_euid != PL_uid || PL_egid != PL_gid)); break; case ')': @@ -1916,13 +1916,13 @@ Perl_magic_set(pTHX_ SV *sv, MAGIC *mg) if (PL_egid == PL_gid) /* special case $) = $( */ (void)PerlProc_setgid(PL_egid); else { - PL_egid = (I32)PerlProc_getegid(); + PL_egid = PerlProc_getegid(); Perl_croak(aTHX_ "setegid() not implemented"); } #endif #endif #endif - PL_egid = (I32)PerlProc_getegid(); + PL_egid = PerlProc_getegid(); PL_tainting |= (PL_uid && (PL_euid != PL_uid || PL_egid != PL_gid)); break; case ':': @@ -2459,10 +2459,10 @@ S_find_beginning(pTHX) STATIC void S_init_ids(pTHX) { - PL_uid = (int)PerlProc_getuid(); - PL_euid = (int)PerlProc_geteuid(); - PL_gid = (int)PerlProc_getgid(); - PL_egid = (int)PerlProc_getegid(); + PL_uid = PerlProc_getuid(); + PL_euid = PerlProc_geteuid(); + PL_gid = PerlProc_getgid(); + PL_egid = PerlProc_getegid(); #ifdef VMS PL_uid |= PL_gid << 16; PL_euid |= PL_egid << 16; @@ -254,7 +254,7 @@ Perl_call_list(pTHXo_ I32 oldscope, AV* av_list) #undef Perl_cando I32 -Perl_cando(pTHXo_ I32 bit, I32 effective, Stat_t* statbufp) +Perl_cando(pTHXo_ I32 bit, Uid_t effective, Stat_t* statbufp) { return ((CPerlObj*)pPerl)->Perl_cando(bit, effective, statbufp); } @@ -1343,8 +1343,8 @@ Perl_ibcmp_locale(pTHXo_ const char* a, const char* b, I32 len) } #undef Perl_ingroup -I32 -Perl_ingroup(pTHXo_ I32 testgid, I32 effective) +bool +Perl_ingroup(pTHXo_ Gid_t testgid, Uid_t effective) { return ((CPerlObj*)pPerl)->Perl_ingroup(testgid, effective); } @@ -767,8 +767,8 @@ PP(pp_aassign) } # endif /* HAS_SETREUID */ #endif /* HAS_SETRESUID */ - PL_uid = (int)PerlProc_getuid(); - PL_euid = (int)PerlProc_geteuid(); + PL_uid = PerlProc_getuid(); + PL_euid = PerlProc_geteuid(); } if (PL_delaymagic & DM_GID) { #ifdef HAS_SETRESGID @@ -796,8 +796,8 @@ PP(pp_aassign) } # endif /* HAS_SETREGID */ #endif /* HAS_SETRESGID */ - PL_gid = (int)PerlProc_getgid(); - PL_egid = (int)PerlProc_getegid(); + PL_gid = PerlProc_getgid(); + PL_egid = PerlProc_getegid(); } PL_tainting |= (PL_uid && (PL_euid != PL_uid || PL_egid != PL_gid)); } @@ -37,7 +37,7 @@ VIRTUAL I32 Perl_block_gimme(pTHX); VIRTUAL int Perl_block_start(pTHX_ int full); VIRTUAL void Perl_boot_core_UNIVERSAL(pTHX); VIRTUAL void Perl_call_list(pTHX_ I32 oldscope, AV* av_list); -VIRTUAL I32 Perl_cando(pTHX_ I32 bit, I32 effective, Stat_t* statbufp); +VIRTUAL I32 Perl_cando(pTHX_ I32 bit, Uid_t effective, Stat_t* statbufp); VIRTUAL U32 Perl_cast_ulong(pTHX_ NV f); VIRTUAL I32 Perl_cast_i32(pTHX_ NV f); VIRTUAL IV Perl_cast_iv(pTHX_ NV f); @@ -197,7 +197,7 @@ VIRTUAL HE* Perl_hv_store_ent(pTHX_ HV* tb, SV* key, SV* val, U32 hash); VIRTUAL void Perl_hv_undef(pTHX_ HV* tb); VIRTUAL I32 Perl_ibcmp(pTHX_ const char* a, const char* b, I32 len); VIRTUAL I32 Perl_ibcmp_locale(pTHX_ const char* a, const char* b, I32 len); -VIRTUAL I32 Perl_ingroup(pTHX_ I32 testgid, I32 effective); +VIRTUAL bool Perl_ingroup(pTHX_ Gid_t testgid, Uid_t effective); VIRTUAL void Perl_init_debugger(pTHX); VIRTUAL void Perl_init_stacks(pTHX); VIRTUAL U32 Perl_intro_my(pTHX); @@ -855,7 +855,6 @@ STATIC regnode* S_reg(pTHX_ I32, I32 *); STATIC regnode* S_reganode(pTHX_ U8, U32); STATIC regnode* S_regatom(pTHX_ I32 *); STATIC regnode* S_regbranch(pTHX_ I32 *, I32); -STATIC void S_regc(pTHX_ U8, char *); STATIC void S_reguni(pTHX_ UV, char *, I32*); STATIC regnode* S_regclass(pTHX); STATIC regnode* S_regclassutf8(pTHX); |