From owner-freebsd-ports-bugs@freebsd.org Fri Apr 8 02:17:25 2016 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8B61B0710A for ; Fri, 8 Apr 2016 02:17:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98ACC15CA for ; Fri, 8 Apr 2016 02:17:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u382HPoc091526 for ; Fri, 8 Apr 2016 02:17:25 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 208627] net/rsync: Rsync compiled with ACL option will always consider ACLs to be different even if they are not. Date: Fri, 08 Apr 2016 02:17:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: chen@starworm.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ehaupt@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2016 02:17:25 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D208627 Bug ID: 208627 Summary: net/rsync: Rsync compiled with ACL option will always consider ACLs to be different even if they are not. Product: Ports & Packages Version: Latest Hardware: amd64 OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: ehaupt@FreeBSD.org Reporter: chen@starworm.com Assignee: ehaupt@FreeBSD.org Flags: maintainer-feedback?(ehaupt@FreeBSD.org) I'm seeing the following results when using rsync 3.1.2 that comes with Fre= eNAS 9.10: $ touch a.txt $ rsync -i -aX --acls a.txt b.txt >f+++++++++ a.txt $ rsync -i -aX --acls a.txt b.txt .f.......a. a.txt $ rsync -i -aX --acls a.txt b.txt .f.......a. a.txt $ getfacl a.txt # file: a.txt # owner: root # group: user owner@:rw-p--aARWcCos:------:allow group@:r-----a-R-c--s:------:allow everyone@:r-----a-R-c--s:------:allow $ getfacl b.txt # file: b.txt # owner: root # group: user owner@:rw-p--aARWcCos:------:allow group@:r-----a-R-c--s:------:allow everyone@:r-----a-R-c--s:------:allow Each run of with "--acls" considers the ACLs to have changed even if they haven't. Rsync built from ports using the standard options (i.e. with the A= CL option unset) doesn't have this bug. Code inspection suggests that the prob= lem is likely caused by "extrapatch-acl" making "set_acl" unconditionally return "changed =3D=3D 1". Compare the code snippet from the patch: if (sxp->brand =3D=3D SMB_ACL_BRAND_NFS4) { ndx =3D F_ACL(file); if (ndx >=3D 0 && (size_t)ndx < nfs4_acl_list.count) { nfs4_duo *duo_item =3D nfs4_acl_list.items; duo_item +=3D ndx; changed =3D 1; if (!duo_item->sacl) { duo_item->sacl =3D acl_from_text(duo_item->nacl.nfs4_acl_te= xt); if (!duo_item->sacl) return -1; } if (!dry_run && fname) { if (sys_acl_set_file(fname, SMB_ACL_TYPE_NFS4, duo_item->sa= cl) < 0) { rsyserr(FERROR_XFER, errno, "set_acl: sys_acl_set_file(= %s, %s)", fname, str_acl_type(SMB_ACL_TYPE_NFS4)); return -1; } return changed; } } } With a code snippet from the rest of the code: ndx =3D F_ACL(file); if (ndx >=3D 0 && (size_t)ndx < access_acl_list.count) { acl_duo *duo_item =3D access_acl_list.items; duo_item +=3D ndx; eq =3D sxp->acc_acl && rsync_acl_equal_enough(sxp->acc_acl, &duo_item->racl, new_mode= ); if (!eq) { changed =3D 1; if (!dry_run && fname && set_rsync_acl(fname, duo_item, SMB_ACL_TYPE_ACCESS, sxp, new_mode) < 0) return -1; } } Today's ACL patch code simply sets "changed", but it should probably check "nfs4_acl_equal(sxp->nfs4_acl, duo_item->nacl)" first. It might also be necessary to move the return out of the inner if-statement for things to be= have nicely (it doesn't make sense to only terminate early for non-dry runs). --=20 You are receiving this mail because: You are the assignee for the bug.=