evm_posix_acl.c 714 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (C) 2011 IBM Corporation
  3. *
  4. * Author:
  5. * Mimi Zohar <zohar@us.ibm.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, version 2 of the License.
  10. */
  11. #include <linux/module.h>
  12. #include <linux/xattr.h>
  13. int posix_xattr_acl(char *xattr)
  14. {
  15. int xattr_len = strlen(xattr);
  16. if ((strlen(XATTR_NAME_POSIX_ACL_ACCESS) == xattr_len)
  17. && (strncmp(XATTR_NAME_POSIX_ACL_ACCESS, xattr, xattr_len) == 0))
  18. return 1;
  19. if ((strlen(XATTR_NAME_POSIX_ACL_DEFAULT) == xattr_len)
  20. && (strncmp(XATTR_NAME_POSIX_ACL_DEFAULT, xattr, xattr_len) == 0))
  21. return 1;
  22. return 0;
  23. }