X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pp_sys.c;h=0ec539d51fc7d70ba28228b62a759e4077bc7915;hb=60e543b98faa4a5070dcca1fd2110807d43d1186;hp=e1d74aee3a608720b2f9ba0440e1a04d11462902;hpb=b448e4fea9d52c651a1814ffb2d1d8745f1f0de9;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pp_sys.c b/pp_sys.c index e1d74ae..0ec539d 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -2546,12 +2546,20 @@ PP(pp_stat) #if Uid_t_size > IVSIZE PUSHs(sv_2mortal(newSVnv(PL_statcache.st_uid))); #else +# if Uid_t_sign <= 0 PUSHs(sv_2mortal(newSViv(PL_statcache.st_uid))); +# else + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_uid))); +# endif #endif #if Gid_t_size > IVSIZE PUSHs(sv_2mortal(newSVnv(PL_statcache.st_gid))); #else +# if Gid_t_sign <= 0 PUSHs(sv_2mortal(newSViv(PL_statcache.st_gid))); +# else + PUSHs(sv_2mortal(newSVuv(PL_statcache.st_gid))); +# endif #endif #ifdef USE_STAT_RDEV PUSHs(sv_2mortal(newSViv(PL_statcache.st_rdev))); @@ -4801,7 +4809,11 @@ PP(pp_gpwent) PUSHs(sv = sv_newmortal()); if (pwent) { if (which == OP_GPWNAM) +#if Uid_t_sign <= 0 sv_setiv(sv, (IV)pwent->pw_uid); +#else + sv_setuv(sv, (UV)pwent->pw_uid); +#endif else sv_setpv(sv, pwent->pw_name); } @@ -4823,13 +4835,24 @@ PP(pp_gpwent) sv_setpv(sv, pwent->pw_passwd); # endif #endif +#ifndef INCOMPLETE_TAINTS + /* passwd is tainted because user himself can diddle with it. */ + SvTAINTED_on(sv); +#endif PUSHs(sv = sv_mortalcopy(&PL_sv_no)); +#if Uid_t_sign <= 0 sv_setiv(sv, (IV)pwent->pw_uid); +#else + sv_setuv(sv, (UV)pwent->pw_uid); +#endif PUSHs(sv = sv_mortalcopy(&PL_sv_no)); +#if Uid_t_sign <= 0 sv_setiv(sv, (IV)pwent->pw_gid); - +#else + sv_setuv(sv, (UV)pwent->pw_gid); +#endif /* pw_change, pw_quota, and pw_age are mutually exclusive. */ PUSHs(sv = sv_mortalcopy(&PL_sv_no)); #ifdef PWCHANGE @@ -4868,6 +4891,10 @@ PP(pp_gpwent) PUSHs(sv = sv_mortalcopy(&PL_sv_no)); sv_setpv(sv, pwent->pw_shell); +#ifndef INCOMPLETE_TAINTS + /* pw_shell is tainted because user himself can diddle with it. */ + SvTAINTED_on(sv); +#endif #ifdef PWEXPIRE PUSHs(sv = sv_mortalcopy(&PL_sv_no));