#define IS_VFS_XATTR(NAME) (strncmp((NAME), VFS_XATTR, VFS_XATTR_LENGTH) == 0)
#define IS_VFS_FILE(NAME) (strncmp((NAME), VFS_FILE, VFS_FILE_LENGTH) == 0)
-// force everything to current owner for now
-#define VFS_UID_NONE xStat.stat.st_uid
-#define VFS_GID_NONE xStat.stat.st_gid
+// no owner or group ==> root
+#define VFS_UID_NONE 0
+#define VFS_GID_NONE 0
#define INODE_CACHE_SIZE 256
xStat.stat.st_uid = xattrs.getUnsigned(VFS_XATTR "owner", VFS_UID_NONE);
modeStr = xattrs.getString(VFS_XATTR "mode", "");
+ // 1) prefer type from the filesystem
+ // 2) no permissions at all when not in xattrs
+ xStat.stat.st_mode &= S_IFMT;
if (!modeStr.empty()) {
errno = 0;
mode = strtoull(modeStr.c_str(), &parse, 8);
log(LOG_ERR, "conversion of the mode '%s' failed on '%s'", modeStr.c_str(), xStat.name.c_str());
#endif
} else {
- // prefer type from the filesystem
- mode &= ~S_IFMT;
mode |= xStat.stat.st_mode & S_IFMT;
// use xattr for everything else
xStat.stat.st_mode = mode;