Project

General

Profile

Actions

Bug #3782

closed

ksh93's builtin chown fails with numeric ids

Added by Garrett D'Amore over 8 years ago. Updated 9 months ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

When I want to chown a file using numeric ids, which don't exist in the passwd file, the builtin chown falls down badly. However, /usr/bin/chown is fine with it. (So is xpg4/chown)

$ chown -h 433:434 /tmp/x
chown: /tmp/x: cannot change owner and group [Invalid argument]
$ ls -lad /tmp/x
lrwxrwxrwx 1 garrett staff 6 May 20 03:37 /tmp/x -> /tmp/g
$ /usr/bin/chown -h 433:434 /tmp/x
$ ls -lad /tmp/x
$ /usr/xpg4/bin/chown -h 433:437 /tmp/x
$ ls -lad /tmp/x
lrwxrwxrwx 1 433 437 6 May 20 03:37 /tmp/x -> /tmp/g

This busts using the builtin chown. This affects folks who want to use these builtins to get a speed boost (no fork/exec), and are using it to do image building (as I am), where the users don't exist in the system files.

Actions

Also available in: Atom PDF