rh

Check-in [8434e47cb5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:hassubdir() broken on fuse filesystems.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:8434e47cb5d6ea90b4c917037ef96ef70761222589cafa1ae257dc7131e9b564
User & Date: vandyswa@gmail.com 2017-04-29 14:49:25
Context
2018-07-18
05:05
Clean up "fs ext" check-in: c99a1e35cc user: vandys tags: master, trunk
2017-04-29
14:49
hassubdir() broken on fuse filesystems. check-in: 8434e47cb5 user: vandyswa@gmail.com tags: master, trunk
2017-04-24
20:38
Add -0 for rooting through filenames with spaces. check-in: 2e4bd9935a user: vandyswa@gmail.com tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to rhdir.c.

18
19
20
21
22
23
24






25
26
27
28
29
30
31
32
#include "sysinfo.h"

#define user_index(b)	((000777 & (b)) >> 6) + ((b) & S_ISUID ? 8 : 0) 
#define group_index(b)	((000077 & b) >> 3) + ((b) & S_ISGID ? 8 : 0)
#define all_index(b)	((000007 & (b)) + (((b) & S_ISVTX) ? 8 : 0))
#define ftype_index(b)	((b) >> 13)







#define hassubdir(b)	((b)->st_nlink > 2)

#define isdot(s)	((s)[1] == '\0' && (s)[0] == '.')
#define isdotdot(s)	((s)[2] == '\0' && (s)[1] == '.' && (s)[0] == '.')

#if !defined(S_IFLNK)
#  define    lstat        stat
#endif







>
>
>
>
>
>
|







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "sysinfo.h"

#define user_index(b)	((000777 & (b)) >> 6) + ((b) & S_ISUID ? 8 : 0) 
#define group_index(b)	((000077 & b) >> 3) + ((b) & S_ISGID ? 8 : 0)
#define all_index(b)	((000007 & (b)) + (((b) & S_ISVTX) ? 8 : 0))
#define ftype_index(b)	((b) >> 13)

/*
 * This is pretty questionable; in a traditional filesystem you get
 *  a link for "." and for "..", thus > 2 means you have other directories
 *  which link to you.  But in virtual (fuse) filesystems, not so much.
 *  sshfs seems to just return 1 no matter what.
 */
#define hassubdir(b)	((b)->st_nlink != 2)

#define isdot(s)	((s)[1] == '\0' && (s)[0] == '.')
#define isdotdot(s)	((s)[2] == '\0' && (s)[1] == '.' && (s)[0] == '.')

#if !defined(S_IFLNK)
#  define    lstat        stat
#endif