*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Tru64 Unix man pages -> cd_idmap (3)              



NAME    [Toc]    [Back]

       cd_idmap  - sets or gets mappings of User and Group IDs on
       a CD-ROM

SYNOPSIS    [Toc]    [Back]

       #include <sys/cdrom.h>

       int cd_idmap(
               char *path,
               int cmd,
               struct cd_idmap *idmap,
               int *nmaps );

LIBRARY    [Toc]    [Back]

       Rock Ridge and  X/Open  Extensions  to  the  CDFS  library
       (libcdrom.so, libcdrom.a)

PARAMETERS    [Toc]    [Back]

       Points to the mount point of a CD-ROM File System.  Can be
       set to either {CD_SETUMAP}  or  {CD_SETGMAP}  to  set,  or
       {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} arguments 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 structure 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 mappings.

DESCRIPTION    [Toc]    [Back]

       The cd_idmap() routine sets or gets the mapping of UIDs or
       GIDs for a mounted CD-ROM.

RESTRICTIONS    [Toc]    [Back]

       Setting values is restricted to users with the appropriate
       privileges.   Only  files  and  directories  with an unrestricted
 final Extended Attribute Record (XAR) are subject
       to  this  mapping. The ISO 9660 standard 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    [Toc]    [Back]

       If  successful,  the value zero is returned. If unsuccessful,
 the integer -1 is returned and errno is set to  indicate
 the error.

ERRORS    [Toc]    [Back]

       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  supported  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.

              [Tru64 UNIX]  Either the OPEN_MAX value or the perprocess
  soft  descriptor  limit  is  checked.  The
              length of the *path string exceeds {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  appropriate
              privileges to set values.

SEE ALSO    [Toc]    [Back]

       Files: cdfs/xcdr.h, sys/cdrom.h

[ Back ]
 Similar pages
Name OS Title
cd_defs Tru64 sets or gets default values for the User or Group ID, or for file or directory permissions
pxfsetgid IRIX Sets group ID
setregid HP-UX sets the real and effective group IDs
setsid Linux creates a session and sets the process group ID
pxfsetuid IRIX Sets user ID
setuid NetBSD set user and group ID
setruid FreeBSD set user and group ID
setruid OpenBSD set user and group ID
setegid FreeBSD set user and group ID
setuid FreeBSD set user and group ID
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service