From owner-freebsd-fs Sun Jul 22 17:42:52 2001 Delivered-To: freebsd-fs@freebsd.org Received: from ns.caldera.de (ns.caldera.de [212.34.180.1]) by hub.freebsd.org (Postfix) with ESMTP id 2B3CA37B405; Sun, 22 Jul 2001 17:42:46 -0700 (PDT) (envelope-from hch@ns.caldera.de) Received: (from hch@localhost) by ns.caldera.de (8.11.1/8.11.1) id f6N0gKs20365; Mon, 23 Jul 2001 02:42:20 +0200 Date: Mon, 23 Jul 2001 02:42:20 +0200 From: Christoph Hellwig To: Bakul Shah Cc: tlambert2@mindspring.com, Joshua Goodall , Bruce Evans , freebsd-fs@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG Subject: Re: flags on symlinks Message-ID: <20010723024220.A19865@caldera.de> References: <3B5B4F7E.8C48801E@mindspring.com> <200107230016.UAA17001@renown.cnchost.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200107230016.UAA17001@renown.cnchost.com>; from bakul@bitblocks.com on Sun, Jul 22, 2001 at 05:16:11PM -0700 Sender: owner-freebsd-fs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, Jul 22, 2001 at 05:16:11PM -0700, Bakul Shah wrote: > Well, I won't mind if {,l}ch{mod,own,flags} etc become library > routines. Something like: > > int > chown(const char* path, uid_t owner, gid_t group) { > int fd, err; > > fd = open(path, O_EXCL); > if (!fd) > return errno; > err = fchown(fd, owner, group); > close(fd); > return err; > } The problem is that it uses a file-descriptor, which means it will fail if the maximum number of fds (process-wide or globally) is execeeded. Another problem is that open on devices may give all kinds of side-effects (e.g. enabling interrups, awaking from suspend state, not to mention clone devices) that it is generally considered a bad idea to open for a metadata change. And I think this was discusses as zillion times before :P Christoph -- Whip me. Beat me. Make me maintain AIX. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-fs" in the body of the message