From swear@blarg.net  Thu Mar 28 17:24:44 2002
Return-Path: <swear@blarg.net>
Received: from lists.blarg.net (lists.blarg.net [206.124.128.17])
	by hub.freebsd.org (Postfix) with ESMTP id 19E4937B41C
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Mar 2002 17:24:44 -0800 (PST)
Received: from thig.blarg.net (thig.blarg.net [206.124.128.18])
	by lists.blarg.net (Postfix) with ESMTP id BCE62BDF8
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Mar 2002 17:24:43 -0800 (PST)
Received: from localhost.localdomain ([206.124.139.115])
	by thig.blarg.net (8.9.3/8.9.3) with ESMTP id RAA11297
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Mar 2002 17:24:42 -0800
Received: (from jojo@localhost)
	by localhost.localdomain (8.11.6/8.11.3) id g2T1NH996251;
	Thu, 28 Mar 2002 17:23:17 -0800 (PST)
	(envelope-from swear@blarg.net)
Message-Id: <bgvgbggoai.gbg@localhost.localdomain>
Date: 28 Mar 2002 17:23:17 -0800
From: "Gary W. Swearingen" <swear@blarg.net>
Reply-To: swear@blarg.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: chown(8) manual misdescribes handling of symlinks
X-GNATS-Notify:

>Number:         36447
>Category:       docs
>Synopsis:       chown(8) manual misdescribes handling of symlinks
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    trhodes
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 28 17:30:01 PST 2002
>Closed-Date:    Wed Dec 15 13:41:08 GMT 2004
>Last-Modified:  Wed Dec 15 13:41:08 GMT 2004
>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:

From: Giorgos Keramidas <keramida@freebsd.org>
To: "Gary W. Swearingen" <swear@blarg.net>
Cc: bug-followup@freebsd.org
Subject: Re: docs/36447: chown(8) manual misdescribes handling of symlinks
Date: Fri, 29 Mar 2002 03:35:31 +0200

 True.  But one who has read the descriptionn of -H, -L and -R above already
 knows that chown(1) handles symlinks specially.  No need to repeat what has
 already been written above, IMHO.
 
 - Giorgos
 

From: swear@blarg.net (Gary W. Swearingen)
To: Giorgos Keramidas <keramida@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: docs/36447: chown(8) manual misdescribes handling of symlinks
Date: 28 Mar 2002 22:31:55 -0800

 Giorgos Keramidas <keramida@freebsd.org> writes:
 
 > True.  But one who has read the descriptionn of -H, -L and -R above already
 > knows that chown(1) handles symlinks specially.  No need to repeat what has
 > already been written above, IMHO.
 
 First, those only apply when using -R.  Second, it's not enough to know
 that there is special handling; something needs to describe the handling
 and it shouldn't, like the -h description, describe it wrongly.  I don't
 see that I've repeated anything, except the mention of -h in the program
 description because the current description is not true without -h.
 
 Does not the -h description imply that "the file that the link points
 to" will be changed in the absense of -h?  In fact, that file will not
 be changed (unless that dangerous trailing slash feature/bug is used).

From: <trhodes@FreeBSD.org>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: docs/36447: [PATCH] chown(8)
Date: Mon, 1 Apr 2002 18:50:25 -0800 (PST)

 Gary, how does the following patch look?  I omitted the sentence under
 the description where you asked symlink(7) be mentioned.  symlink(7)
 is in the see also section, I changed the description to one that I
 feel is satisfactory, I also think that -h is good now.  If anything,
 perhaps we should cut everything, including ``rather'' after the
 -h option.  But its your PR.
 
 --
 Tom (darklogik) Rhodes
 
 
 --- chown.8.old	Mon Apr  1 21:41:30 2002
 +++ chown.8	Mon Apr  1 21:52:17 2002
 @@ -57,7 +57,10 @@
  .Ar
  .Sh DESCRIPTION
  .Nm Chown
 -sets the user ID and/or the group ID of the specified files.
 +changes the user ID and/or the group ID of the specified files.
 +Symbolic links named by arguments are silently left unchanged unless
 +.Op Fl h
 +is used.
  .Pp
  The options are as follows:
  .Bl -tag -width Ds
 @@ -82,8 +85,9 @@
  Don't report any failure to change file owner or group, nor modify
  the exit status to reflect such failures.
  .It Fl 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.
 +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.
  .It Fl v
  Cause
  .Nm
Responsible-Changed-From-To: freebsd-doc->trhodes 
Responsible-Changed-By: trhodes 
Responsible-Changed-When: Wed Apr 3 09:58:10 PST 2002 
Responsible-Changed-Why:  
I will close this one also as the current patch is mine 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36447 

From: <trhodes@FreeBSD.org>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: docs/36447: [PATCH] chown(8)
Date: Wed, 3 Apr 2002 09:50:58 -0800 (PST)

 Gary, I have looked over the various comments on -doc, and produced
 this new patch.  How does it look?
 
 --
 Tom (darklogik) Rhodes
 
 --- chown.8.old	Wed Apr  3 11:21:57 2002
 +++ chown.8	Wed Apr  3 11:22:27 2002
 @@ -57,7 +57,10 @@
  .Ar
  .Sh DESCRIPTION
  .Nm Chown
 -sets the user ID and/or the group ID of the specified files.
 +changes the user ID and/or the group ID of the specified files.
 +Symbolic links named by arguments are silently left unchanged unless
 +.Op Fl h
 +is used.
  .Pp
  The options are as follows:
  .Bl -tag -width Ds
 @@ -82,8 +85,8 @@
  Don't report any failure to change file owner or group, nor modify
  the exit status to reflect such failures.
  .It Fl 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.
 +If the file is a symbolic link, change the user ID and/or the
 +group ID of the link itself.
  .It Fl v
  Cause
  .Nm
State-Changed-From-To: open->patched 
State-Changed-By: trhodes 
State-Changed-When: Tue Apr 9 13:24:48 PDT 2002 
State-Changed-Why:  
Patch applied to CURRENT, I'll commit to STABLE in 3 days, thanks 
Gary 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36447 
State-Changed-From-To: patched->closed 
State-Changed-By: trhodes 
State-Changed-When: Fri Apr 12 08:16:18 PDT 2002 
State-Changed-Why:  
Just committed the change to STABLE, thanks Gary! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36447 

From: swear@attbi.com (Gary W. Swearingen)
To: FreeBSD-gnats-submit@freebsd.org
Cc:  
Subject: Re: docs/36447: chown(8) manual misdescribes handling of symlinks
Date: 12 Feb 2003 17:49:25 -0800

 Please reopen this PR; the fix added "[-f]" instead of "-f".
 
 Also, the previously-committed change for the PR said that symlinks were
 not changed, by default, but (importantly) didn't say that symlinks 
 are not followed by default, either.
 
 The patch below fixes both problems (and also the problem of
 capitalizing the command name).
 
 --- /pr/work/chown..orig.8	Wed Feb 12 17:28:53 2003
 +++ /pr/work/chown.8	Wed Feb 12 17:37:50 2003
 @@ -56,11 +56,10 @@
  .No : Ns Ar group
  .Ar
  .Sh DESCRIPTION
 -.Nm Chown
 -changes the user ID and/or the group ID of the specified files.
 -Symbolic links named by arguments are silently left unchanged unless
 -.Op Fl h
 -is used.
 +The
 +.Nm
 +utility changes the user ID and/or the group ID of the specified files.
 +By default, symbolic links are ignored.
  .Pp
  The options are as follows:
  .Bl -tag -width Ds
State-Changed-From-To: closed->analyzed 
State-Changed-By: trhodes 
State-Changed-When: Thu Feb 13 11:38:09 PST 2003 
State-Changed-Why:  
Switch to analyzed at Gary's request. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36447 
State-Changed-From-To: analyzed->patched 
State-Changed-By: trhodes 
State-Changed-When: Wed Dec 15 03:10:33 GMT 2004 
State-Changed-Why:  
This was fixed in current, I'll close after I see if this 
has been fixed in the other branches. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36447 
State-Changed-From-To: patched->closed 
State-Changed-By: trhodes 
State-Changed-When: Wed Dec 15 13:40:38 GMT 2004 
State-Changed-Why:  
RELENG_4 and RELENG_5 have the same information as CURRENT. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36447 
>Unformatted:
