|
HWRF
trunk@4391
|
ACL class wrapped around the libacl library: More...
ACL class wrapped around the libacl library:
Inquire and manipulate access control lists (ACLs).
Represents a POSIX Access Control List (ACL). This is a wrapper around the libacl library, and implements only widely-supported ACL features. Data is stored internally in C structures, which are allocated and freed automatically as needed.
Public Member Functions | |
| def | __init__ (self) |
| Create a blank, invalid, ACL. More... | |
| def | __del__ (self) |
| Free the memory used by the ACL in libacl. More... | |
| def | free (self) |
| Frees resources used by the libacl library to store this ACL's underlying C structures. More... | |
| def | have_acl (self) |
| Returns True if this ACL has data, and False otherwise. More... | |
| def | from_text (self, acl) |
| Attempts to convert the given string to an ACL, storing the result in this object. More... | |
| def | from_file |
| Copies the files's ACL into this object. More... | |
| def | from_fd (self, fd) |
| Get an access control list from a file descriptor. More... | |
| def | to_fd (self, fd) |
| Updates a file's file descriptor. More... | |
| def | to_file |
| Updates a file's access control list. More... | |
| def | to_text (self) |
| Converts an ACL to text. More... | |
| def | __str__ (self) |
| => self.to_text() | |
| def produtil.acl.ACL.__init__ | ( | self | ) |
| def produtil.acl.ACL.__del__ | ( | self | ) |
| def produtil.acl.ACL.free | ( | self | ) |
Frees resources used by the libacl library to store this ACL's underlying C structures.
Definition at line 155 of file acl.py.
Referenced by produtil.acl.ACL.__del__(), produtil.acl.ACL.from_file(), and produtil.acl.ACL.from_text().
| def produtil.acl.ACL.from_fd | ( | self, | |
| fd | |||
| ) |
Get an access control list from a file descriptor.
Obtains an Access Control List from the specified file object or file descriptor number. You can also pass any object that has a "fileno()" member function. Any prior ACL information in this object will be freed.
| fd | an integer file descriptor or a file object. |
| def produtil.acl.ACL.from_file | ( | self, | |
| filename, | |||
which = ACL_TYPE_ACCESS |
|||
| ) |
Copies the files's ACL into this object.
Specify which type of access control list via the second argument: ACL_TYPE_ACCESS or ACL_TYPE_DEFAULT. Any prior ACL information in this object will be freed.
| filename | the name of the file whose ACL is desired |
| which | which access control list is desired; ACL_TYPE_ACCESS or ACL_TYPE_DEFAULT. |
| def produtil.acl.ACL.from_text | ( | self, | |
| acl | |||
| ) |
| def produtil.acl.ACL.have_acl | ( | self | ) |
| def produtil.acl.ACL.to_fd | ( | self, | |
| fd | |||
| ) |
| def produtil.acl.ACL.to_file | ( | self, | |
| filename, | |||
access = ACL_TYPE_ACCESS |
|||
| ) |
Updates a file's access control list.
Sets the ACL for the specified file to the ACL stored in this object. Specify access=ACL_TYPE_DEFAULT to obtain the default access control list (Default ACL) or ACL_TYPE_ACCESS for the access control list. Raises ACLMissingError if this object has no ACL information.
| filename | the name of the file whose ACL is to be updated |
| access | ACL_TYPE_ACCESS or ACL_TYPE_DEFAULT |
| def produtil.acl.ACL.to_text | ( | self | ) |
1.8.10