critical impact:
open, creat - file access permission differences (CrCh129)
Problem description
The open and creat functions are basically identical on Tru64 UNIX and HP-UX. However, there are file access permission differences.
The open and creat functions open a file for reading and writing.
There is a difference regarding group ID between Tru64 UNIX and HP-UX when creating a new file in a directory not owned by the process using the O_CREAT flag. On Tru64 UNIX, the default behavior is to set the group ID of the file to the group ID of its parent directory. On HP-UX, however, the default behavior is to set the group ID of the file to either the group ID of the process or, if the set-group-ID bit of the parent directory is set, to the group ID of the parent directory. To achieve the same behavior as on HP-UX, set the vfs subsystem attribute sys_v_mode to 1 on Tru64 UNIX.
On Tru64 UNIX, the file permission and attribute bits are set to the value of the mode parameter, which is modified as follows:
All bits in the file mode whose corresponding bits in the file mode creation mask are set are cleared.
The set-user ID attribute (S_ISUID bit) is cleared.
The set-group ID attribute (S_ISGID bit) is cleared.
The access control list of the new file is set to WILDCARD (discretionary access to the file according to traditional UNIX rules).
On HP-UX, the file access permission bits of the new file mode are set to the value of mode, and modified as follows:
For each bit set in the file mode creation mask of the process, the corresponding bit in the new file mode is cleared. See umask(2).
The "save text image after execution" bit of the new file mode is cleared. See chmod(2).
On HFS file systems with access control lists, three base ACL entries are created corresponding to the file access permissions. See acl(5).
On JFS file systems that support access control lists, optional ACL entries are created corresponding to the parent directory's default ACL entries. See aclv(5). Identifiers
 creat |
 open |
|
|
|
|
|
See also
Solution description
Review the applicable manpages and code to determine if unexpected behavior will result.
See also
Problem summary
| classifications |
source types |
OS release |
severity |
type |
| IO |
C, C++ |
any HP-UX 11i version |
critical |
changed |
|