From owner-freebsd-questions@FreeBSD.ORG Fri Sep 30 14:19:25 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2DBF416A41F for ; Fri, 30 Sep 2005 14:19:25 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from smtp-out5.blueyonder.co.uk (smtp-out5.blueyonder.co.uk [195.188.213.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9F04743D48 for ; Fri, 30 Sep 2005 14:19:23 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [82.41.253.249] ([82.41.253.249]) by smtp-out5.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Fri, 30 Sep 2005 15:20:11 +0100 Message-ID: <433D4969.1060900@dial.pipex.com> Date: Fri, 30 Sep 2005 15:19:21 +0100 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.11) Gecko/20050917 X-Accept-Language: en-us, pl MIME-Version: 1.0 To: Rajarajan Rajamani References: <20050930140639.GA7111@rajarajan.homeunix.net> In-Reply-To: <20050930140639.GA7111@rajarajan.homeunix.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 30 Sep 2005 14:20:11.0983 (UTC) FILETIME=[11A21DF0:01C5C5CA] Cc: freebsd-questions@freebsd.org Subject: Re: rsync unable to sync suid files X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Sep 2005 14:19:25 -0000 Rajarajan Rajamani wrote: >I am running Release 5.4 with 2 disks and am using rsync to sync between the >two. On installing the second disk I used dump/restore to mirror them and >am since using rsync for incremental changes. > >However I have a problem that rsync is unable to copy some files >and I suspect it is has something to do with the suid files. > >Am I missing some switch to rsync ? > >This is the output ---- ># rsync --archive --times --verbose --delete --links --hard-links /usr/ /backup/usr >[...] >rsync: rename "/backup/usr/bin/.login.afaGPu" -> "bin/login": Operation not permitted (1) > > It's a problem with the schg flag (and sunlnk might be similar). See man chflags. It just so happens that suid files have been made schg to stop them being tampered with, but otherwise suid is just a coincidence. % ls -lsaFko /usr/bin/login 18 -r-sr-xr-x 1 root wheel schg 17192 Aug 8 23:06 /usr/bin/login* The only solutions I could think of were 1) fix rsync to be flag aware (hard) 2) implement something based on mtree which parsed your source tree, chflags -R on your dest tree, did the rsync, then ran mtree on the dest tree to fix the flags back. I haven't done either yet :-( so if anyone has a better solution I'd love to know. 2) won't work if you run at higher securelevel since you can't un-schg files (because it's not secure :-)), IIRC. --Alex