chacl(1)

chacl(1)

continues, and eventually returns non-zero.

-ffromfile tofile

Copy the ACL from from®le to the speci®ed to®le, transferring ownership, if necessary (see acl(5), chown(2), or chownacl(3C)). from®le can be - to represent standard input.

 

This option implies the -roption. If the owner and group of from®le are identical to those

 

of to®le, chacl -fis identical to:

 

chacl -r `lsacl fromfile` tofile ...

 

To copy an ACL without transferring ownership, the above command is suggested instead of

 

chacl -f.

-z

Delete (``zap'') all optional entries in the speci®ed ®le's ACLs, leaving only base entries.

-Z

Delete (``zap'') all optional entries in the speci®ed ®le's ACLs, and set the access modes in all

 

base entries to zero (no access). This is identical to replacing the old ACL with a null ACL:

 

chacl -r '' file ...

 

or using chmod(1), which deletes optional entries as a side effect:

 

chmod 0 ®le ...

-F

Incorporate (``fold'') optional ACL entries into base ACL entries. The base ACL entry's per-

 

mission bits are altered, if necessary, to re¯ect the caller's effective access rights to the ®le;

 

all optional entries, if any, are deleted.

 

For ordinary users, only the access mode of the owner base ACL entry can be altered.

 

Unlike getaccess, the write bit is not turned off for a ®le on a read-only ®le system or a

 

shared-text program being executed (see getaccess(1)).

 

For super-users, only the execute mode bit in the owner base ACL entry might be changed,

 

only if the ®le is not an regular ®le or if an execute bit is not already set in a base ACL entry

 

mode, but is set in an optional ACL entry mode.

acl also can be obtained from a string in a ®le:

chacl `cat file` ®les ...

Using @ in acl to represent ``®le owner or group'' can cause chacl to run more slowly because it must reparse the ACL for each ®le (except with the -doption).

EXTERNAL INFLUENCES

Environment Variables

LANG determines the language in which messages are displayed.

If LANG is not speci®ed or is set to the empty string, a default of "C" (see lang(5)) is used instead of LANG. If any internationalization variable contains an invalid setting, chacl behaves as if all internationalization variables are set to "C". See environ(5).

RETURN VALUE

If chacl succeeds, it returns a value of zero.

If chacl encounters an error before it changes any ®le's ACL, it prints an error message to standard error and returns 1. Such errors include invalid invocation, invalid syntax of acl (aclpatt), a given user name or group name is unknown, or inability to get an ACL from from®le with the -foption.

If chacl cannot execute the requested operation, it prints an error message to standard error, continues, and later returns 2. This includes cases when a ®le does not exist, a ®le's ACL cannot be altered, more ACL entries would result than are allowed, or an attempt is made to delete a non-existing ACL entry.

EXAMPLES

The following command adds read access for user jpc in any group, and removes write access for any user in the ®les's groups, for ®les x and y.

chacl "jpc.%+r, %.@-w" x y

This command replaces the ACL on the ®le open as standard input and on ®le test with one which only allows the ®le owner read and write access.

HP-UX Release 11i: December 2000

− 2 −

Section 171

c