NetBSD Problem Report #17504

Received: (qmail 21583 invoked by uid 605); 7 Jul 2002 12:24:00 -0000
Message-Id: <Pine.SOL.4.44.0207071304010.20690-100000@draco.cus.cam.ac.uk>
Date: Sun, 7 Jul 2002 13:23:58 +0100 (BST)
From: Ben Harris <bjh21@netbsd.org>
Sender: gnats-bugs-owner@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: POSIX.1-2001: chown -RP doesn't affect symlinks

>Number:         17504
>Category:       standards
>Synopsis:       POSIX.1-2001: chown -RP doesn't affect symlinks
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    standards-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jul 07 12:25:00 +0000 2002
>Closed-Date:    
>Last-Modified:  
>Originator:     Ben Harris
>Release:        1.6_BETA4
>Organization:
>Environment:
NetBSD 1.6_BETA4 (RPC_WSCONS) #0: Fri Jul  5 10:48:27 UTC 2002
    autobuild@tgm.daemon.org:/autobuild/acorn32/OBJ/autobuild/src/sys/arch/acorn32/compile/RPC_WSCONS

>Description:
POSIX.1-2001 says, of chown -P:

    -P  If the -R option is specified and a symbolic link is specified on the
        command line or encountered during the traversal of a file hierarchy,
        chown shall change the owner ID (and group ID, if specified) of the
        symbolic link if the system supports this operation. The chown utility
        shall not follow the symbolic link to any other part of the file
        hierarchy.

However, under NetBSD, chown -RP leaves the ownership of symlinks alone, and
the -h option is needed to change their ownership.  It's debatable whether
this is a bug in NetBSD or in the standard, especially since symlink(7)
specifies our current behaviour, and I have yet to find an implementation
that follows POSIX.

>How-To-Repeat:

southeast-iceland# mkdir foo
southeast-iceland# touch foo/bar
southeast-iceland# ln -s bar foo/baz
southeast-iceland# ls -la foo
total 2
drwxr-xr-x  2 root  wheel  512 Jul  7 12:08 .
drwxrwxrwt  4 root  wheel  512 Jul  7 12:08 ..
-rw-r--r--  1 root  wheel    0 Jul  7 12:08 bar
lrwxr-xr-x  1 root  wheel    3 Jul  7 12:08 baz -> bar
southeast-iceland# chown -RP bjh21 foo
southeast-iceland# ls -la foo
total 2
drwxr-xr-x  2 bjh21  wheel  512 Jul  7 12:08 .
drwxrwxrwt  4 root   wheel  512 Jul  7 12:08 ..
-rw-r--r--  1 bjh21  wheel    0 Jul  7 12:08 bar
lrwxr-xr-x  1 root   wheel    3 Jul  7 12:08 baz -> bar

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.