From owner-freebsd-stable@FreeBSD.ORG Wed Nov 29 17:19:05 2006 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A4AB416A812 for ; Wed, 29 Nov 2006 17:19:05 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4C3534439B for ; Wed, 29 Nov 2006 17:10:37 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (vcpahe@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id kATHAXHE082923; Wed, 29 Nov 2006 18:10:38 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id kATHAXIs082922; Wed, 29 Nov 2006 18:10:33 +0100 (CET) (envelope-from olli) Date: Wed, 29 Nov 2006 18:10:33 +0100 (CET) Message-Id: <200611291710.kATHAXIs082922@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, stefan.lambrev@sun-fish.com In-Reply-To: <456DB725.6060105@sun-fish.com> X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Wed, 29 Nov 2006 18:10:38 +0100 (CET) Cc: Subject: Re: weird permitions X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, stefan.lambrev@sun-fish.com List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Nov 2006 17:19:05 -0000 Stefan Lambrev wrote: > Can someone explain to me why next can happened on freebsd: > 1. add 2 users in same group - user test and test-ro in group test > 2. as user test: cd /home/test ; mkdir test; chmod 775 test; echo > "asdasd" > ~/test/del.me What was your umask? I assume 022, i.e. the file was created with mdoe 644. > 3. su - test-ro ; cd /home/test; vim del.me - make changes; force save (:x!) I suspect that vim -- upon force save -- deleted the original file, which is perfectly possible because the test-ro user had write permission to the directory. Then vim created a new file with the same name, which is again perfectly possible because of the writability of the directory. The new file belongs to the test-ro user, of course. So ... > ls -l > total 2 > -rw-r--r-- 1 test-ro test 10 Nov 29 18:19 del.me (how is that possible ?) > > back "su - test" and try to edit this file - impossible! .. That's to be expected. > I do not know what the RFC says about it, but it is ultra weird for me > that such ownership takeover is possible. It is standard and perfectly correct behaviour. There was no "ownership takeover". One file was deleted, and a new file was created, all allowed by the given permissions. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd Any opinions expressed in this message may be personal to the author and may not necessarily reflect the opinions of secnetix in any way. "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell