Table of Contents

Name

chownu - change file owner with CAP_CHOWN securely

Synopsis

chownu [-R] [-d depth] username [file(s)]

Description

chownu changes file ownership without having root permissions. Its name may be understood as "chown user" or "chown u" (u like the greek letter micro).
chownu requires the capability CAP_CHOWN to be run ("setcap cap_chown=ep chownu").
The ID of the username supplied is looked up in /etc/passwd.
chown refuses to run if the ID is 0 or below MINUID (default: 500) or above MAXUID (default: 9999). MINUID and MAXUID can be specified at compile time.
chown ignores any files with an owner ID of 0 or below MINUID or above MAXUID.
Symlinks are not followed but taken as files and get also the owner changed if above criteria match.

Options

-R
Step recursively into directories.
-d depth
Specify the maximum recursion depth. Default is 50.

Return Value

On success 0 is returned. Other return values are described in sysexits.h.

Examples

chownu -R puppet deploy-dir

Author

Frank Bergmann


Table of Contents