diff options
author | George Kadianakis <desnacked@riseup.net> | 2021-04-08 14:20:53 +0300 |
---|---|---|
committer | George Kadianakis <desnacked@riseup.net> | 2021-04-08 14:20:53 +0300 |
commit | b07ed22cbb43fe0aaac3f1b13f4902cea895d724 (patch) | |
tree | 00f696438fc25816ae27ab90e2c8bf025666b431 /src/lib/fs | |
parent | 5ebf2b81a1db144a933b2971d580452d0eafcd31 (diff) | |
parent | d2c2204b2ac564cd71fd0be1ea3efabd6f84fc36 (diff) | |
download | tor-b07ed22cbb43fe0aaac3f1b13f4902cea895d724.tar.gz tor-b07ed22cbb43fe0aaac3f1b13f4902cea895d724.zip |
Merge remote-tracking branch 'tor-gitlab/mr/273'
Diffstat (limited to 'src/lib/fs')
-rw-r--r-- | src/lib/fs/path.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/fs/path.c b/src/lib/fs/path.c index 8c4b08f50a..48d610ab7b 100644 --- a/src/lib/fs/path.c +++ b/src/lib/fs/path.c @@ -611,11 +611,13 @@ tor_glob(const char *pattern) return NULL; } - // #40141: workaround for bug in glibc < 2.19 where patterns ending in path - // separator match files and folders instead of folders only + // #40141, !249: workaround for glibc bug where patterns ending in path + // separator match files and folders instead of folders only. + // this could be in #ifdef __GLIBC__ but: 1. it might affect other libcs too, + // and 2. it doesn't cost much to stat each match again since libc is already + // supposed to do it (otherwise the file may be on slow NFS or something) size_t pattern_len = strlen(pattern); - bool dir_only = has_glob(pattern) && - pattern_len > 0 && pattern[pattern_len-1] == *PATH_SEPARATOR; + bool dir_only = pattern_len > 0 && pattern[pattern_len-1] == *PATH_SEPARATOR; result = smartlist_new(); size_t i; |