libacl.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. File: libacl.h
  3. (C) 1999, 2000 Andreas Gruenbacher, <a.gruenbacher@computer.org>
  4. This program is free software: you can redistribute it and/or modify it
  5. under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation, either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. */
  15. #ifndef __ACL_LIBACL_H
  16. #define __ACL_LIBACL_H
  17. #include <sys/acl.h>
  18. #ifdef __cplusplus
  19. extern "C" {
  20. #endif
  21. /* Flags for acl_to_any_text() */
  22. /* Print NO, SOME or ALL effective permissions comments. SOME prints
  23. effective rights comments for entries which have different permissions
  24. than effective permissions. */
  25. #define TEXT_SOME_EFFECTIVE 0x01
  26. #define TEXT_ALL_EFFECTIVE 0x02
  27. /* Align effective permission comments to column 32 using tabs or
  28. use a single tab. */
  29. #define TEXT_SMART_INDENT 0x04
  30. /* User and group IDs instead of names. */
  31. #define TEXT_NUMERIC_IDS 0x08
  32. /* Only output the first letter of entry types
  33. ("u::rwx" instead of "user::rwx"). */
  34. #define TEXT_ABBREVIATE 0x10
  35. /* acl_check error codes */
  36. #define ACL_MULTI_ERROR (0x1000) /* multiple unique objects */
  37. #define ACL_DUPLICATE_ERROR (0x2000) /* duplicate Id's in entries */
  38. #define ACL_MISS_ERROR (0x3000) /* missing required entry */
  39. #define ACL_ENTRY_ERROR (0x4000) /* wrong entry type */
  40. extern char *acl_to_any_text(acl_t acl, const char *prefix,
  41. char separator, int options);
  42. extern int acl_cmp(acl_t acl1, acl_t acl2);
  43. extern int acl_check(acl_t acl, int *last);
  44. extern acl_t acl_from_mode(mode_t mode);
  45. extern int acl_equiv_mode(acl_t acl, mode_t *mode_p);
  46. int acl_extended_file(const char *path_p);
  47. int acl_extended_file_nofollow(const char *path_p);
  48. int acl_extended_fd(int fd);
  49. extern int acl_entries(acl_t acl);
  50. extern const char *acl_error(int code);
  51. extern int acl_get_perm(acl_permset_t permset_d, acl_perm_t perm);
  52. /* Copying permissions between files */
  53. struct error_context;
  54. extern int perm_copy_file (const char *, const char *,
  55. struct error_context *);
  56. extern int perm_copy_fd (const char *, int, const char *, int,
  57. struct error_context *);
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif /* __ACL_LIBACL_H */