chown(3)

DESCRIPTION

Changes the stored owner UID and group GID of the path's target. The final path component is followed.

SYNOPSIS

#include <sys/stat.h>

int chown(const char *path, uid_t owner, gid_t group);

RETURN VALUE

  • Returns zero, or -1 and sets errno.

ERRORS

  • -EFAULT
    • Path is null or cannot be read.
  • -EINVAL
    • Path resolution fails.
  • -ENOENT
    • The target does not exist.

NOTES

Astia applies the change to the resolved file object. The current kernel credential model does not reject an owner or group value on authorization grounds.