IoTYPE(io) = PerlIO_intmode2str(rawmode, &mode[ix], &writing);
- namesv = sv_2mortal(newSVpvn(oname,strlen(oname)));
+ namesv = sv_2mortal(newSVpv(oname,0));
num_svs = 1;
svp = &namesv;
type = Nullch;
#ifdef USE_SFIO
/* sfio fails to clear error on next
sfwrite, contrary to documentation.
- -- Nick Clark */
+ -- Nicholas Clark */
if (PerlIO_seek(that_fp, 0, SEEK_CUR) == -1)
PerlIO_clearerr(that_fp);
#endif
}
else {
if (!num_svs) {
- namesv = sv_2mortal(newSVpvn(type,strlen(type)));
+ namesv = sv_2mortal(newSVpvn(type,tend - type));
num_svs = 1;
svp = &namesv;
type = Nullch;
}
else {
if (!num_svs) {
- namesv = sv_2mortal(newSVpvn(type,strlen(type)));
+ namesv = sv_2mortal(newSVpvn(type,tend - type));
num_svs = 1;
svp = &namesv;
type = Nullch;
}
else {
if (!num_svs) {
- namesv = sv_2mortal(newSVpvn(type,strlen(type)));
+ namesv = sv_2mortal(newSVpvn(type,tend - type));
num_svs = 1;
svp = &namesv;
type = Nullch;
const char *s;
SV ** const oldmark = mark;
+ /* Doing this ahead of the switch statement preserves the old behaviour,
+ where attempting to use kill as a taint test test would fail on
+ platforms where kill was not defined. */
+#ifndef HAS_KILL
+ if (type == OP_KILL)
+ Perl_die(aTHX_ PL_no_func, "kill");
+#endif
+#ifndef HAS_CHOWN
+ if (type == OP_CHOWN)
+ Perl_die(aTHX_ PL_no_func, "chown");
+#endif
+
+
#define APPLY_TAINT_PROPER() \
STMT_START { \
if (PL_tainted) { TAINT_PROPER(what); } \
/* 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]
#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. */