Skip site navigation (1)Skip section navigation (2)
Date:      28 Mar 2002 17:23:17 -0800
From:      "Gary W. Swearingen" <swear@blarg.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   docs/36447: chown(8) manual misdescribes handling of symlinks
Message-ID:  <bgvgbggoai.gbg@localhost.localdomain>

next in thread | raw e-mail | index | archive | help


>Number:         36447
>Category:       docs
>Synopsis:       chown(8) manual misdescribes handling of symlinks
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 28 17:30:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Gary W. Swearingen
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
none
>Environment:
n/a
================
>Description:

The chown(8) manual says:

    Chown sets the user ID and/or the group ID of the specified files.

and

-h  If the file is a symbolic link, change the user ID and/or the
    group ID of the link itself rather than the file that the link
    points to.

But without the -h option, symlinks given as arguments do not have
their IDs changed (as implied by the first quote) nor are the symlinks
followed (as implied by the second quote).
================
>How-To-Repeat:

su
cd /tmp
touch jjjr
ln -s jjjr jjjl
l jjj*
chown bin.bin jjjl
l jjj*
chown -h bin.bin jjjl
l jjj*
================
>Fix:

It should say:

    Chown changes the user ID and/or the group ID of the specified files.
    Symbolic links named by arguments are silently left unchanged unless
    "-h" is used.  See the symlink(7) manual for the handling of
    symlinks with a trailing slash.

and

-h  If the file is a symbolic link, change the user ID and/or the
    group ID of the link itself rather than silently leaving the link
    unchanged.

Maybe the "symlink(7)" sentence should be omitted.  No other manuals
currently discuss the trailing slash feature/bug including symlink(7).
I'll file a PR on the latter soon, so I say include the sentence.

On the other hand, maybe the "-h" description SHOULD mention that it
is ignored for symlinks with a trailing slash.  But maybe not, if we
assume that people are supposed to learn in the symlink(7) manual that
a name with a trailing slash is never naming a symlink, but what it
points to.  I'm saying "not", for now.
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bgvgbggoai.gbg>