Manual Page Result
0
Command: cd_idmap | Section: 3 | Source: Digital UNIX | File: cd_idmap.3.gz
cd_idmap(3) Library Functions Manual cd_idmap(3)
NAME
cd_idmap - Sets or gets mappings of User and Group IDs on a CD-ROM
LIBRARY
Rock Ridge and X/Open Extensions to the CDFS library (libcdrom.so,
libcdrom.a)
SYNOPSIS
#include <sys/cdrom.h> int cd_idmap ( char *path, int cmd,
struct cd_idmap *idmap, int *nmaps );
PARAMETERS
Points to the mount-point of a CD-ROM File System.
Can be set to either {CD_SETUMAP} or {CD_SETGMAP} to set; or to
{CD_GETUMAP} or {CD_GETGMAP} to get the mappings of UIDs or GIDs
on the CD-ROM File System pointed to by *path.
The variables {CD_SETUMAP}, {CD_SETGMAP}, {CD_GETUMAP}, and
{CD_GETGMAP} are defined in cdfs/xcdr.h, an include file that is
called into sys/cdrom.h.
Points to the cd_idmap structure used in conjunction with the
{CD_SETUMAP}, {CD_SETGMAP}, {CD_GETUMAP}, and {CD_GETGMAP} argu-
ments to cmd, to hold the mappings to UIDs or GIDs. The
cd_idmap structure is defined in cdfs/xcdr.h, an include file
that is called into sys/cdrom.h.
Indicates the number of mappings declared in the cd_idmap struc-
ture pointed to by *idmap.
If cmd is set to {CD_SETUMAP} or {CD_SETGMAP}, *nmaps overwrites
any previous values set by a prior call to cd_idmap. When
*nmaps is zero, none of the previously set mappings will stay in
effect.
When calling, if cmd is set to {CD_GETUMAP} or {CD_GETGMAP},
*nmaps must contain the maximum number of mappings that may be
returned; when returning, *nmaps contains the number of map-
pings.
DESCRIPTION
The cd_idmap routine sets or gets the mapping of UIDs or GIDs for a
mounted CD-ROM.
RESTRICTIONS
Setting values is restricted to users with the appropriate privileges.
Only files and directories with an unrestricted final Extended At-
tribute Record (XAR) are subject to this mapping. The ISO 9660 stan-
dard does not permit a UID or GID of zero to appear in an unrestricted
XAR. Consequently, mapping a zero value for a UID or GID may produce
unpredictable results. This function is intended to be used to set
values only directly after the CD-ROM is mounted and before its files
and directories are accessed. Attempting to use this function to set
values after files or directories on the CD-ROM have been accessed may
produce unpredictable results.
RETURN VALUES
If successful, the value zero is returned.
If unsuccessful, the integer -1 is returned and errno is set to indi-
cate the error.
ERRORS
The function will fail if: Search permission is denied for a directory
in *path or read permission is denied on the mount-point. The address
of *idmap or *path is invalid. A signal was caught during execution of
the function. The argument *path points to a file or directory that is
not within the CD-ROM file hierarchy.
The value of cmd or *nmaps is invalid.
A member of the *idmap is invalid; for example, from_id is
larger than 65535, or a value in to_uid or to_gid is not sup-
ported by the system. Note that this error will not be returned
when from_id does not exist on the CD-ROM, when to_uid is not
defined in the User Database, or when to_gid is not in the Group
Database. {OPEN_MAX} file descriptors are currently open in the
calling process.
[DIGITAL] Either the OPEN_MAX value or the per-process soft de-
scriptor limit is checked. The length of the *path string ex-
ceeds {PATH_MAX}, or a pathname component is longer than
{NAME_MAX} while {_POSIX_NO_TRUNC} is in effect. The system
file table is full. A component of *path does not exist, or the
*path argument points to an empty string. A component of the
*path prefix is not a directory. The user does not have the ap-
propriate privileges to set values.
RELATED INFORMATION
Files: cdfs/xcdr.h, sys/cdrom.h. delim off
cd_idmap(3)