summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-05-20 20:33:08 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-05-20 20:33:08 +0000
commitb94c04ac6df92c9dfee67602a1c95e58aa18b7fa (patch)
tree313b79a8c0c3cfa8d531b085e0e97b3128be380c /doio.c
parentc770b8dce624dbd0ea2e6a7fec22a90af1cf0ce3 (diff)
downloadperl-b94c04ac6df92c9dfee67602a1c95e58aa18b7fa.tar.gz
Fix for ID 20010519.003: sysopen() wasn't tainting :-(
p4raw-id: //depot/perl@10172
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/doio.c b/doio.c
index fd40ae08fc..87e5901daa 100644
--- a/doio.c
+++ b/doio.c
@@ -141,12 +141,14 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
/* sysopen style args, i.e. integer mode and permissions */
STRLEN ix = 0;
if (num_svs != 0) {
- Perl_croak(aTHX_ "panic:sysopen with multiple args");
+ Perl_croak(aTHX_ "panic: sysopen with multiple args");
}
+ if (rawmode & (O_WRONLY|O_RDWR|O_APPEND|O_CREAT|O_TRUNC))
+ TAINT_PROPER("sysopen");
mode[ix++] = '#'; /* Marker to openn to use numeric "sysopen" */
#if defined(USE_64_BIT_RAWIO) && defined(O_LARGEFILE)
- rawmode |= O_LARGEFILE;
+ rawmode |= O_LARGEFILE; /* Transparently largefiley. */
#endif
#ifndef O_ACCMODE
@@ -193,7 +195,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
num_svs = 1;
svp = &namesv;
type = Nullch;
- fp = PerlIO_openn(aTHX_ type,mode, -1, rawmode, rawperm, NULL, num_svs, svp);
+ fp = PerlIO_openn(aTHX_ type, mode, -1, rawmode, rawperm, NULL, num_svs, svp);
}
else {
/* Regular (non-sys) open */