Skip to content

Commit 62bb9bb

Browse files
carenastridge
authored andcommitted
acls: correct type/size for orig_umask
Since 0527893 (- Call mkdir_defmode() instead of do_mkdir(). - Define orig_umask in this file, not options.c. - Made orig_umask a mode_t, not an int., 2006-02-24), the type for the global was changed, and therefore on systems where sizeof(mode_t) != sizeof(int), writes or reads to them will overflow to adjacent bytes. Change the type to the one used everywhere else and avoid this problem. While at it, silence again a warning that is being triggered by Apple's clang 15.
1 parent 6601510 commit 62bb9bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

acls.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extern int dry_run;
2828
extern int am_root;
2929
extern int read_only;
3030
extern int list_only;
31-
extern int orig_umask;
31+
extern mode_t orig_umask;
3232
extern int numeric_ids;
3333
extern int inc_recurse;
3434
extern int preserve_devices;
@@ -982,7 +982,7 @@ static int set_rsync_acl(const char *fname, acl_duo *duo_item,
982982
&& !pack_smb_acl(&duo_item->sacl, &duo_item->racl))
983983
return -1;
984984
#ifdef HAVE_OSX_ACLS
985-
mode = 0; /* eliminate compiler warning */
985+
(void)mode; /* eliminate compiler warning */
986986
#else
987987
if (type == SMB_ACL_TYPE_ACCESS) {
988988
cur_mode = change_sacl_perms(duo_item->sacl, &duo_item->racl, cur_mode, mode);

0 commit comments

Comments
 (0)