X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/ae306a2933c7617493d80f46d891911634ec43d0..c1ff70aa47e11c5b37634479a0facee775a7b6d9:/acls.diff diff --git a/acls.diff b/acls.diff index 3cc4cb4..ff1f178 100644 --- a/acls.diff +++ b/acls.diff @@ -9,6 +9,7 @@ To use this patch, run these commands for a successful build: ./configure (optional if already run) make +based-on: a01e3b490eb36ccf9e704840e1b6683dab867550 diff --git a/acls.c b/acls.c --- a/acls.c +++ b/acls.c @@ -20,7 +21,7 @@ diff --git a/acls.c b/acls.c /* Flags used to indicate what items are being transmitted for an entry. */ #define XMIT_USER_OBJ (1<<0) -@@ -107,6 +108,18 @@ static const char *str_acl_type(SMB_ACL_TYPE_T type) +@@ -110,6 +111,18 @@ static const char *str_acl_type(SMB_ACL_TYPE_T type) return "unknown ACL type!"; } @@ -39,7 +40,7 @@ diff --git a/acls.c b/acls.c static int calc_sacl_entries(const rsync_acl *racl) { /* A System ACL always gets user/group/other permission entries. */ -@@ -554,6 +567,96 @@ int get_acl(const char *fname, stat_x *sxp) +@@ -555,6 +568,96 @@ int get_acl(const char *fname, stat_x *sxp) return 0; } @@ -136,9 +137,9 @@ diff --git a/acls.c b/acls.c /* === Send functions === */ /* Send the ida list over the file descriptor. */ -@@ -629,6 +732,11 @@ static void send_rsync_acl(rsync_acl *racl, SMB_ACL_TYPE_T type, +@@ -630,6 +733,11 @@ static void send_rsync_acl(int f, rsync_acl *racl, SMB_ACL_TYPE_T type, * This also frees the ACL data. */ - void send_acl(stat_x *sxp, int f) + void send_acl(int f, stat_x *sxp) { + if (protocol_version < 30) { + old_send_acl(sxp, f); @@ -148,7 +149,7 @@ diff --git a/acls.c b/acls.c if (!sxp->acc_acl) { sxp->acc_acl = create_racl(); rsync_acl_fake_perms(sxp->acc_acl, sxp->st.st_mode); -@@ -646,6 +754,160 @@ void send_acl(stat_x *sxp, int f) +@@ -647,6 +755,160 @@ void send_acl(int f, stat_x *sxp) } } @@ -308,23 +309,23 @@ diff --git a/acls.c b/acls.c + /* === Receive functions === */ - static uint32 recv_acl_access(uchar *name_follows_ptr, int f) -@@ -768,6 +1030,11 @@ static int recv_rsync_acl(item_list *racl_list, SMB_ACL_TYPE_T type, int f) + static uint32 recv_acl_access(int f, uchar *name_follows_ptr) +@@ -768,6 +1030,11 @@ static int recv_rsync_acl(int f, item_list *racl_list, SMB_ACL_TYPE_T type, mode /* Receive the ACL info the sender has included for this file-list entry. */ - void receive_acl(struct file_struct *file, int f) + void receive_acl(int f, struct file_struct *file) { + if (protocol_version < 30) { + old_recv_acl(file, f); + return; + } + - F_ACL(file) = recv_rsync_acl(&access_acl_list, SMB_ACL_TYPE_ACCESS, f); + F_ACL(file) = recv_rsync_acl(f, &access_acl_list, SMB_ACL_TYPE_ACCESS, file->mode); if (S_ISDIR(file->mode)) diff --git a/compat.c b/compat.c --- a/compat.c +++ b/compat.c -@@ -190,13 +190,6 @@ void setup_protocol(int f_out,int f_in) +@@ -191,13 +191,6 @@ void setup_protocol(int f_out,int f_in) if (protocol_version < 30) { if (append_mode == 1) append_mode = 2;