diff options
author | Zefram <zefram@fysh.org> | 2017-11-17 03:26:47 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-11-17 03:35:40 +0000 |
commit | a6c31837e629c46be2f7496149b36a4b79f93484 (patch) | |
tree | aed847581150f6f5744ed8866b56a942fdf05cf0 | |
parent | a9fdb5b7996c84e762ac02fcb9949dadc31c1bdc (diff) | |
download | perl-a6c31837e629c46be2f7496149b36a4b79f93484.tar.gz |
correctly error on -k "nonexistent" on Windows
The file test operators for Unix permission bits were returning a blanket
false result on systems where the bit being tested for doesn't exist.
That's a sensible way to treat a nonexistent bit when statting a file,
but the false result was being returned without checking that the argument
actually refers to a file. Remove the pre-stat checks for nonexistent
bits, so that we get the correct errors for non-files. We still get a
blanket false result for nonexistent bits on files.
-rw-r--r-- | pod/perldelta.pod | 7 | ||||
-rw-r--r-- | pp_sys.c | 18 |
2 files changed, 7 insertions, 18 deletions
diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 8dbc185976..03d545cbe7 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -576,6 +576,13 @@ failing due to being applied to a closed or otherwise invalid file handle. =item * +File test operators for Unix permission bits that don't exist on a +particular platform, such as C<-k> (sticky bit) on Windows, now check that +the file being tested exists before returning the blanket false result, +and yield the appropriate errors if the argument doesn't refer to a file. + +=item * + The in-place reverse optimisation now correctly strengthens weak references using the L<C<sv_rvunweaken()>|perlapi/sv_rvunweaken> API function. @@ -3374,24 +3374,6 @@ PP(pp_ftrowned) } tryAMAGICftest_MG(opchar); - /* I believe that all these three are likely to be defined on most every - system these days. */ -#ifndef S_ISUID - if(PL_op->op_type == OP_FTSUID) { - FT_RETURNNO; - } -#endif -#ifndef S_ISGID - if(PL_op->op_type == OP_FTSGID) { - FT_RETURNNO; - } -#endif -#ifndef S_ISVTX - if(PL_op->op_type == OP_FTSVTX) { - FT_RETURNNO; - } -#endif - result = my_stat_flags(0); if (result < 0) FT_RETURNUNDEF; |