aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2011-02-06 20:13:01 +0200
committerLasse Collin <lasse.collin@tukaani.org>2011-02-06 20:13:01 +0200
commit6dd061adfd2775428b079eb03d6fd47d7c0f1ffe (patch)
treed0300ef625b5ed4d5f29b53b96c90e203f1812c8 /src
parentMerge branch 'v5.0' (diff)
parentUpdate NEWS for 5.0.1. (diff)
downloadxz-6dd061adfd2775428b079eb03d6fd47d7c0f1ffe.tar.xz
Merge commit '5fbce0b8d96dc96775aa0215e3581addc830e23d'
Diffstat (limited to 'src')
-rw-r--r--src/xz/file_io.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/xz/file_io.c b/src/xz/file_io.c
index 6e24c58a..09edcca6 100644
--- a/src/xz/file_io.c
+++ b/src/xz/file_io.c
@@ -457,15 +457,14 @@ io_open_src_real(file_pair *pair)
goto error;
}
- if (reg_files_only) {
- if (!S_ISREG(pair->src_st.st_mode)) {
- message_warning(_("%s: Not a regular file, "
- "skipping"), pair->src_name);
- goto error;
- }
+ if (reg_files_only && !S_ISREG(pair->src_st.st_mode)) {
+ message_warning(_("%s: Not a regular file, skipping"),
+ pair->src_name);
+ goto error;
+ }
- // These are meaningless on Windows.
#ifndef TUKLIB_DOSLIKE
+ if (reg_files_only && !opt_force) {
if (pair->src_st.st_mode & (S_ISUID | S_ISGID)) {
// gzip rejects setuid and setgid files even
// when --force was used. bzip2 doesn't check
@@ -495,8 +494,8 @@ io_open_src_real(file_pair *pair)
"skipping"), pair->src_name);
goto error;
}
-#endif
}
+#endif
return false;