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

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

Contents


MAC_GET_FILE(3C)					      MAC_GET_FILE(3C)


NAME    [Toc]    [Back]

     mac_get_file, mac_set_file	 - get or set the MAC label for	a pathname

SYNOPSIS    [Toc]    [Back]

     #include <sys/mac.h>

     mac_t mac_get_file(const char *path);
     int mac_set_file(const char *path,	mac_t macp);

DESCRIPTION    [Toc]    [Back]

     mac_get_file returns a mac_t, a pointer to	an allocated struct mac_label
     associated	with the pathname pointed to by	path.  If _POSIX_MAC is	in
     effect, then the process must have	MAC read access	to the object.

     mac_set_file sets the MAC label of	the specified pathname.	The MAC	label
     is	first checked for validity by mac_valid(3c).  The effective UID	of the
     process must match	the owner of the object	or the process must have
     appropriate privilege to set the MAC label	of path.  If _POSIX_CAP	is in
     effect, then the appropriate capability must include CAP_FOWNER.  In
     addition, if _POSIX_MAC is	in effect, then	the process must have MAC
     write access to the object.

RETURN VALUES    [Toc]    [Back]

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

     mac_set_file returns 0 if successful, -1 otherwise.

ERRORS    [Toc]    [Back]

     mac_get_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 mac_t failed.

     ENOSYS	     MAC support is not	available (not installed).

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

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



									Page 1






MAC_GET_FILE(3C)					      MAC_GET_FILE(3C)



     EINVAL	     macp points to an invalid MAC label.

     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.

     ENOSPC	     The file system is	full or	some other resource needed for
		     the MAC storage is	not available.

     ENOSYS	     MAC 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 MAC.

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


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
acl_get_file IRIX get or set the ACL for a pathname
NDINIT OpenBSD pathname lookup
relookup OpenBSD pathname lookup
NDINIT NetBSD pathname lookup
realpath Tru64 Resolve pathname
namei OpenBSD pathname lookup
cap_get_file IRIX get or set the capabilities for a pathname
relookup NetBSD pathname lookup
namei NetBSD pathname lookup
lookup NetBSD pathname lookup
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service