From cd1d1a9d7a0379eeb6c410f4c29dba88b15b0a39 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 27 Apr 2006 00:34:52 +0000 Subject: [PATCH] Fixed a problem with send_acl() when f == -1. --- acls.diff | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/acls.diff b/acls.diff index 209aee2..dcc917c 100644 --- a/acls.diff +++ b/acls.diff @@ -38,13 +38,12 @@ TODO items: popt_OBJS=popt/findme.o popt/popt.o popt/poptconfig.o \ --- old/acls.c +++ new/acls.c -@@ -0,0 +1,1307 @@ +@@ -0,0 +1,1306 @@ +/* + * Handle passing Access Control Lists between systems. + * + * Copyright (C) 1996 Andrew Tridgell + * Copyright (C) 1996 Paul Mackerras -+ * Copyright (C) 2006 Matt McCutchen + * Copyright (C) 2006 Wayne Davison + * + * This program is free software; you can redistribute it and/or modify @@ -94,7 +93,7 @@ TODO items: + uchar other; +} rsync_acl; + -+static const rsync_acl rsync_acl_initializer = { ++static const rsync_acl empty_rsync_acl = { + {0, 0, NULL}, {0, 0, NULL}, + ACL_NO_ENTRY, ACL_NO_ENTRY, ACL_NO_ENTRY, ACL_NO_ENTRY +}; @@ -200,7 +199,7 @@ TODO items: + const char *errfun; + int rc; + -+ *racl = rsync_acl_initializer; ++ *racl = empty_rsync_acl; + errfun = "sys_acl_get_entry"; + for (rc = sys_acl_get_entry(sacl, SMB_ACL_FIRST_ENTRY, &entry); + rc == 1; @@ -484,7 +483,7 @@ TODO items: + rsync_acl_strip_perms(curr_racl); + } else if (errno == ENOTSUP) { + /* ACLs are not supported. Leave list empty. */ -+ *curr_racl = rsync_acl_initializer; ++ *curr_racl = empty_rsync_acl; + } else { + rprintf(FERROR, "send_acl: sys_acl_get_file(%s, %s): %s\n", + fname, str_acl_type(type), strerror(errno)); @@ -512,7 +511,7 @@ TODO items: + int index; + rsync_acl_list *racl_list = rsync_acl_lists(type); + if (f == -1) { -+ rsync_acl_free(curr_racl); ++ rsync_acl_free(curr_racl++); + continue; + } + if ((index = find_matching_rsync_acl(type, racl_list, curr_racl)) @@ -809,7 +808,7 @@ TODO items: + id_access *ida; + size_t count; + -+ *racl = rsync_acl_initializer; ++ *racl = empty_rsync_acl; + + if (!(count = read_int(f))) + return; -- 2.34.1