Open System Services Porting Guide (G06.29+, H06.06+, J06.03+)

opendir()
readdir()
remove()
rename_oss()
rmdir()
setfilepriv()
unlink()
utime()
For more information about restricted-access filesets and file privileges, see the Open System
Services Management and Operations Guide.
Using the access() Function
For the access() function call, the behavior on OSS files is defined by the POSIX.1 standard
with minor implementation-defined behavior. When the filename resolves to the /G directory, the
permissions are “r-xr-xr-x.” For Guardian volumes and subvolumes, the permissions are
rwxrwxrwx.” For a Guardian disk file, Guardian standard security and Safeguard file-level
protection govern access.
See also “Special Considerations for Files in Restricted-Access Filesets” (page 122).
Using the chdir() Function
The chdir() function call has no implementation-defined behavior on OSS directories, but it does
exhibit some Guardian specific behavior. chdir() can point to a nonexistent (empty) Guardian
subvolume, but pointing to a Guardian subvolume with a reserved name such as
/G/zyq00001/z000002h results in an error.
See also “Special Considerations for Files in Restricted-Access Filesets” (page 122).
Using the chmod() Function
The effect of the chmod() function call on open files is implementation-defined, according to the
POSIX.1 standard. A call to chmod() has no effect on the file descriptor for a file that is open at
the time of the call. New openers of the file are authenticated using the new access permissions
specified in the call. An attempt to set the permission bits on a Guardian file results in an error
because Guardian security rules apply.
In filesets that support OSS ACLs, only a process that has an effective user ID equal to the super
ID or to the file owner, or that has an effective user ID or group affiliation qualifying for membership
in the Safeguard SECURITY-OSS-ADMINISTRATOR group can use the chmod() function to change
the access permissions of a file.
In restricted-access filesets, only a process that has an effective user ID or group affiliation qualifying
for membership in the Safeguard SECURITY-OSS-ADMINISTRATOR (SOA) group has the appropriate
privilege to use this function on any file in the restricted-access fileset. However, if the executable
file used by that process does not have the PRIVSOARFOPEN privilege, the set-user-ID and
set-group-ID bits of the file mode (04000 and 02000 respectively) of the modified file are cleared.
See also “Special Considerations for Files in Restricted-Access Filesets” (page 122).
The value of the S_NONSTOP flag on a regular OSS file can be changed with chmod(), but the
change takes effect at the next open() call.
Using the chown() Function
For OSS files in unrestricted filesets, a process can use the chown() function call to change the
owner ID of a file only if the effective user ID of the process is the super ID. In filesets that support
OSS ACLs, only a process that has an effective user ID equal to the super ID or to the file owner,
or that has an effective user ID or group affiliation qualifying for membership in the Safeguard
SECURITY-OSS-ADMINISTRATOR group can use the chown() function to change the group of a
OSS C Programming Considerations 123