diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-05-20 20:33:08 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-05-20 20:33:08 +0000 |
commit | b94c04ac6df92c9dfee67602a1c95e58aa18b7fa (patch) | |
tree | 313b79a8c0c3cfa8d531b085e0e97b3128be380c /doio.c | |
parent | c770b8dce624dbd0ea2e6a7fec22a90af1cf0ce3 (diff) | |
download | perl-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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 */ |