From: Volker Lendecke Date: Fri, 6 Oct 2023 11:48:09 +0000 (+0200) Subject: libsmb: Expand IS_DOS_* macros X-Git-Tag: tevent-0.16.0~190 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=226a7c7bc3970945bacd7aea85c2de49b9e302ae;p=thirdparty%2Fsamba.git libsmb: Expand IS_DOS_* macros To me these macros hide more than they clarify. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/libsmb/libsmb_stat.c b/source3/libsmb/libsmb_stat.c index f25ee8f89a3..ae18f594647 100644 --- a/source3/libsmb/libsmb_stat.c +++ b/source3/libsmb/libsmb_stat.c @@ -58,22 +58,22 @@ void setup_stat(struct stat *st, { st->st_mode = 0; - if (IS_DOS_DIR(attr)) { + if (attr & FILE_ATTRIBUTE_DIRECTORY) { st->st_mode = (S_IFDIR | 0555); } else { st->st_mode = (S_IFREG | 0444); } - if (IS_DOS_ARCHIVE(attr)) { + if (attr & FILE_ATTRIBUTE_ARCHIVE) { st->st_mode |= S_IXUSR; } - if (IS_DOS_SYSTEM(attr)) { + if (attr & FILE_ATTRIBUTE_SYSTEM) { st->st_mode |= S_IXGRP; } - if (IS_DOS_HIDDEN(attr)) { + if (attr & FILE_ATTRIBUTE_HIDDEN) { st->st_mode |= S_IXOTH; } - if (!IS_DOS_READONLY(attr)) { + if (!(attr & FILE_ATTRIBUTE_READONLY)) { st->st_mode |= S_IWUSR; } @@ -90,7 +90,7 @@ void setup_stat(struct stat *st, st->st_uid = getuid(); st->st_gid = getgid(); - if (IS_DOS_DIR(attr)) { + if (attr & FILE_ATTRIBUTE_DIRECTORY) { st->st_nlink = 2; } else { st->st_nlink = 1;