make readdir() respect IOf_UNTAINT flag (allows untainting of directory
Gurusamy Sarathy [Sun, 27 Feb 2000 16:20:31 +0000 (16:20 +0000)]
handles with: C<use IO::Handle; opendir D, $dir or die; D->untaint;>

p4raw-id: //depot/perl@5285

pp_sys.c

index 6fa9c10..9626025 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -3462,7 +3462,8 @@ PP(pp_readdir)
            sv = newSVpv(dp->d_name, 0);
 #endif
 #ifndef INCOMPLETE_TAINTS
-           SvTAINTED_on(sv);
+           if (!(IoFLAGS(io) & IOf_UNTAINT))
+               SvTAINTED_on(sv);
 #endif
            XPUSHs(sv_2mortal(sv));
        }
@@ -3476,7 +3477,8 @@ PP(pp_readdir)
        sv = newSVpv(dp->d_name, 0);
 #endif
 #ifndef INCOMPLETE_TAINTS
-       SvTAINTED_on(sv);
+       if (!(IoFLAGS(io) & IOf_UNTAINT))
+           SvTAINTED_on(sv);
 #endif
        XPUSHs(sv_2mortal(sv));
     }