diff options
author | Randy J. Ray <rjray@uswest.com> | 1996-10-08 22:24:48 -0400 |
---|---|---|
committer | Andy Dougherty <doughera@lafcol.lafayette.edu> | 1996-10-08 22:24:48 -0400 |
commit | 59629a133a44e0c0672b4b2244f7db38a6ace577 (patch) | |
tree | 8a447996b448225fd0aa96398ce0fe8373ed131b /ext | |
parent | 6c5092641ca826888bcae4d3a2a676a905f07608 (diff) | |
download | perl-59629a133a44e0c0672b4b2244f7db38a6ace577.tar.gz |
PATCH: untaint method for IO::Handle, 5.003_06 version
This is a re-post of my patch to Graham's IO library to add a method in
IO::Handle called "untaint", that sets the IOf_UNTAINT flag on an object
that is of or inherits from IO::Handle. With this flag set, data read from
said handle is not tainted, whether running under -T, suid or sgid.
This patch adds the method to IO.xs, adds documentation and warning to the
pod of IO/Handle.pm, creates a new test in t/lib called io_taint.t, and
adds mention of the new file to MANIFEST.
Add method "untaint" into class IO::Handle
Diffstat (limited to 'ext')
-rw-r--r-- | ext/IO/IO.xs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs index bfe1f5ae42..3cc3518e7e 100644 --- a/ext/IO/IO.xs +++ b/ext/IO/IO.xs @@ -199,6 +199,23 @@ clearerr(handle) OUTPUT: RETVAL +int +untaint(handle) + SV * handle + CODE: + IO * io; + io = sv_2io(handle); + if (io) { + IoFLAGS(io) |= IOf_UNTAINT; + RETVAL = 0; + } + else { + RETVAL = -1; + errno = EINVAL; + } + OUTPUT: + RETVAL + SysRet fflush(handle) OutputStream handle |