+
+bool has_default_tag_perm(const char* path, acl_perm_t, perm) {
+ acl_permset_t permset;
+ int ps_result = get_default_tag_permset(path, tag, &permset);
+
+ if (ps_result == -1) {
+ perror("has_default_tag_perm - get_default_tag_permset");
+ return false;
+ }
+
+ int p_result = acl_get_perm(permset, perm);
+ if (p_result == 1) {
+ return true;
+ }
+ else if (p_result == 0) {
+ return false;
+ }
+ else {
+ /* p_result == -1 */
+ perror("has_default_tag_perm - get_default_tag_permset");
+ return false;
+ }
+}
+
+bool has_default_user_obj_read(const char* path) {
+ return has_default_tag_perm(ACL_USER_OBJ, ACL_READ);
+}
+
+bool has_default_user_obj_write(const char* path) {
+ return has_default_tag_perm(ACL_USER_OBJ, ACL_WRITE);
+}
+
+bool has_default_user_obj_execute(const char* path) {
+ return has_default_tag_perm(ACL_USER_OBJ, ACL_EXECUTE);
+}
+