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

  man pages->IRIX man pages -> cap_get_file (3c)              
Title
Content
Arch
Section
 

Contents


CAP_GET_FILE(3C)					      CAP_GET_FILE(3C)


NAME    [Toc]    [Back]

     cap_get_file, cap_set_file	- get or set the capabilities for a pathname

SYNOPSIS    [Toc]    [Back]

     #include <sys/capability.h>

     cap_t cap_get_file(const char *path);
     int cap_set_file(const char *path,	cap_t cap);

DESCRIPTION    [Toc]    [Back]

     cap_get_file returns a pointer to an allocated cap_t associated with the
     pathname pointed to by path. If there is no capability set	associated
     with the file, cap_get_file returns a NULL	pointer	and sets errno to
     ENOATTR.  If _POSIX_MAC is	in effect, then	the process must have MAC read
     access to the object.

     cap_set_file sets the capabilities	of the specified pathname.  For	this
     function to succeed, the process must have	the CAP_SETFCAP	capability
     enabled and either	the effective user ID of the process must match	the
     file owner	or the calling process must have the effective flag of the
     CAP_FOWNER	capability set.	In addition, if	_POSIX_MAC is defined, then
     the process must have MAC write access to the file.

RETURN VALUES    [Toc]    [Back]

     cap_get_file a pointer to an allocated cap_t if successful, NULL
     otherwise.	 The storage should be freed with a call to cap_free with the
     returned pointer as an argument when it is	no longer needed.

     cap_set_file returns 0 if successful, -1 otherwise.

ERRORS    [Toc]    [Back]

     cap_get_file:

     ENOATTR	     There is no capability set	associated with	the file.

     EACCESS	     Search permission is denied for a component of the	path
		     prefix or the object exists and the process does not have
		     appropriate access	rights.

     ENAMETOLONG     The pathname or one of its	components is too long.

     ENOENT	     The named object does not exist or	path points to an
		     empty string.

     ENOMEM	     allocation	of the cap failed.

     ENOSYS	     Capability	support	is not available (not installed).

     ENOTDIR	     A component of the	path prefix is not a directory.






									Page 1






CAP_GET_FILE(3C)					      CAP_GET_FILE(3C)



     cap_set_file:

     EACCESS	     Search permission is denied for a component of the	path
		     prefix or the object exists and the process does not have
		     appropriate access	rights.

     ENAMETOLONG     The pathname or one of its	components is too long.

     ENOENT	     The named object does not exist or	path points to an
		     empty string.

     ENOSYS	     Capability	support	is not available (not installed).

     ENOTDIR	     A component of the	path prefix is not a directory.

     EPERM	     The process does not have appropriate privilege to
		     perform the operation to set the capabilities.

     EROFS	     This function requires modification of a file system
		     which is currently	read-only.

SEE ALSO    [Toc]    [Back]

      
      
     capabilities(4)


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
cap_from_text IRIX convert a POSIX capabilities string to internal form, convert capabilities to a POSIX capabilities string, or
cap_acquire IRIX make permitted set capabilities effective or remove effective capabilities
term HP-UX terminal capabilities
cap_get_proc IRIX get or set process capabilities
term_c HP-UX terminal capabilities
term.h HP-UX terminal capabilities
TERM HP-UX terminal capabilities
capget Linux set/get process capabilities
glcenable IRIX enable or disable GLC capabilities
cap_get_fd IRIX get or set the capabilities for an open file
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service