Project

General

Profile

Bug #3779

ksh93's builtin chown handling is busted

Added by Garrett D'Amore over 7 years ago. Updated over 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
cmd - userland programs
Start date:
2013-05-22
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

I discovered some surprising things lately.

builtin chown in ksh fails when chown -h if the link target is missing. /usr/bin/chown is fine with it.

garrett@openindiana:/tmp/usr/bin$ pfexec ksh
garrett@openindiana:/tmp/usr/bin$ id
uid=0(root) gid=0(root)
garrett@openindiana:/tmp/usr/bin$ ls -la /tmp/file
lrwxrwxrwx 1 garrett staff 11 May 20 08:34 /tmp/file -> /nosuchfile
garrett@openindiana:/tmp/usr/bin$ cat /tmp/file
cat: /tmp/file: cannot open [No such file or directory]
garrett@openindiana:/tmp/usr/bin$ whence -v chown
chown is a shell builtin version of /usr/bin/chown
garrett@openindiana:/tmp/usr/bin$ chown -h root /tmp/file
chown: /tmp/file: cannot change owner [No such file or directory]
garrett@openindiana:/tmp/usr/bin$ /bin/chown -h root /tmp/file
garrett@openindiana:/tmp/usr/bin$ ls -la /tmp/file
lrwxrwxrwx 1 root staff 11 May 20 08:34 /tmp/file -> /nosuchfile

Also available in: Atom PDF