Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ chown(2) — HP-UX 5.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chown(1)

chmod(2)

CHOWN(2)

NAME

chown, fchown − change owner and group of a file

SYNOPSIS

int chown (path, owner, group)
char ∗path;
int owner, group; fchown (fd, owner, group)
int fd, owner, group;

HP-UX COMPATIBILITY

Level: chown: HP-UX/RUN ONLY
fchown: HP-UX/STANDARD

Origin: System V and UCB

DESCRIPTION

Path points to a path name naming a file.  Fd is a descriptor for a file.  The owner ID and group ID of the file are set to the numeric values contained in owner and group respectively.  Note that owner and group should be less than or equal to 65535, since only the least significant 16 bits are used. 

Only processes with effective user ID equal to the file owner or super-user may change the ownership of a file.  If privilege groups are supported, the owner of a file may change the ownership only if he is a member of a privilege group allowing chown, as set up by setprivgrp. The default gives the chown privilege to all users. 

The group ownership of a file can be changed to any group in the current process’s access list or to the real or effective group id of the current process.  If privilege groups are supported and the user is permitted the chown privilege, the file can be given to any group. 

Chown will fail and the owner and group of the named file will remain unchanged if one or more of the following are true:

­[ENOTDIR] A component of the path prefix is not a directory. 

­[ENOENT] The named file does not exist. 

­[EACCES] Search permission is denied on a component of the path prefix. 

­[EPERM] EPERM is set when the effective user ID is not super-user and one or more of the following conditions exist:

The effective user ID does not match the owner of the file. 

When changing the owner of the file, if the owner of the file is not a member of a privilege group allowing chown.

When changing the group of the file, if the owner of the file is not a member of a privilege group allowing chown and the group number is not in the current process’s access list. 

­[EROFS] The named file resides on a read-only file system. 

­[FAULT] Path points outside the allocated address space of the process. 

HARDWARE DEPENDENCIES

Series 500:
Chown changes the owner and group of files created only in the HP-UX environment (that is, not those created by the HP 9000 BASIC Langauge System). 

Fchown is not implemented on Series 500. 

Integral PC:
32-bit device numbers and 24-bit minor device numbers are supported.

RETURN VALUE

Upon successful completion, a value of 0 is returned.  Otherwise, a value of −1 is returned and errno is set to indicate the error. 

SEE ALSO

chown(1), chmod(2). 

Hewlett-Packard  —  last mod. May 11, 2021

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026