bin/102394: ls(1) do not shows inode number symbolic link itself with -P option

TANAKA Hiroyuki kattyo at abk.nu
Tue Aug 22 17:10:20 UTC 2006


>Number:         102394
>Category:       bin
>Synopsis:       ls(1) do not shows inode number symbolic link itself with -P option
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 22 17:10:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     TANAKA Hiroyuki
>Release:        6.1-STABLE
>Organization:
>Environment:
FreeBSD localhost.localdomain 6.1-STABLE FreeBSD 6.1-STABLE #2: Thu May 11 11:09:42 JST 2006     root at localhost.localdomain:/usr/obj/usr/src/sys/mykernel  amd64
>Description:
ls(1) command shows inode number about symblic link references when used with -P option.

In manpage, the -P option shows symbolic link itself instead of it pointed to.
But now ls(1) shows inode number which resolved symbolic link references.
If manpage is correct, please fix this.


following command line option settings is 
conflicted by default when used with only -P option:
>                case 'P':
>                        fts_options &= ~FTS_COMFOLLOW;
>                        fts_options &= ~FTS_LOGICAL;
>                        fts_options |= FTS_PHYSICAL;
>                        break;
..
>        /*
>         * If not -F, -d or -l options, follow any symbolic links listed on
>         * the command line.
>         */
>        if (!f_longform && !f_listdir && !f_type)
>                fts_options |= FTS_COMFOLLOW;
 
>How-To-Repeat:
kattyo@ bin $ \ls -iF /usr/sbin/mailwrapper
1578123 /usr/sbin/mailwrapper*
kattyo@ bin $ \ls -il mailq
1201534 lrwxr-xr-x  1 root  wheel  21 May 11 11:29 mailq -> /usr/sbin/mailwrapper
kattyo@ bin $ \ls -iL mailq
1578123 mailq
kattyo@ bin $ \ls -iH mailq
1578123 mailq
kattyo@ bin $ \ls -iP mailq
1578123 mailq
kattyo@ bin $ \ls -ih mailq
1578123 mailq
kattyo@ bin $ \ls -id mailq
1201534 mailq

>Fix:
This is not tested.

src/bin/ls/ls.c:
 		case 'P':
 			fts_options &= ~FTS_COMFOLLOW;
 			fts_options &= ~FTS_LOGICAL;
 			fts_options |= FTS_PHYSICAL;
+			f_listdir = 1;
 			break;


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


More information about the freebsd-bugs mailing list