diff options
Diffstat (limited to 'lib/libaccess/aclcache.cpp')
| -rw-r--r-- | lib/libaccess/aclcache.cpp | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/lib/libaccess/aclcache.cpp b/lib/libaccess/aclcache.cpp index e474601a..10588879 100644 --- a/lib/libaccess/aclcache.cpp +++ b/lib/libaccess/aclcache.cpp @@ -432,110 +432,6 @@ ACL_CacheEnterGet(char *uri, ACLListHandle_t **acllistp) return; } -/* ACL_AddAclName - * Adds the ACLs for just the terminal object specified in a pathname. - * INPUT - * path The filesystem pathname of the terminal object. - * acllistp The address of the list of ACLs found thus far. - * Could be NULL. If so, a new acllist will be allocated (if any - * acls are found). Otherwise the existing list will be added to. - * masterlist Usually acl_root_30. - */ -void -ACL_AddAclName(char *path, ACLListHandle_t **acllistp, ACLListHandle_t -*masterlist) -{ - ACLHandle_t *acl; - NSErr_t *errp = 0; - -#ifdef XP_WIN32 - acl = ACL_ListFind(errp, masterlist, path, ACL_CASE_INSENSITIVE); -#else - acl = ACL_ListFind(errp, masterlist, path, ACL_CASE_SENSITIVE); -#endif - if (!acl) - return; - - PR_ASSERT(ACL_AssertAcl(acl)); - - if (!*acllistp) - *acllistp = ACL_ListNew(errp); - ACL_ListAppend(NULL, *acllistp, acl, 0); - - PR_ASSERT(ACL_AssertAcllist(*acllistp)); - return; -} - - -/* ACL_GetPathAcls - * Adds the ACLs for all directories plus the terminal object along a given - * filesystem pathname. For each pathname component, look for the name, the - * name + "/", and the name + "/*". The last one is because the resource - * picker likes to postpend "/*" for directories. - * INPUT - * path The filesystem pathname of the terminal object. - * acllistp The address of the list of ACLs found thus far. - * Could be NULL. If so, a new acllist will be allocated (if any - * acls are found). Otherwise the existing list will be added to. - * prefix A string to be prepended to the path component when looking - * for a matching ACL tag. - */ -void -ACL_GetPathAcls(char *path, ACLListHandle_t **acllistp, char *prefix, -ACLListHandle_t *masterlist) -{ - char *slashp=path; - int slashidx; - char ppath[ACL_PATH_MAX]; - int prefixlen; - char *dst; - - PR_ASSERT(path); - PR_ASSERT(prefix); - - dst = strncpy(ppath, prefix, ACL_PATH_MAX); - if (dst >= (ppath+ACL_PATH_MAX-1)) { - ereport(LOG_SECURITY, "Abort - the path is too long for ACL_GetPathAcls to handle\n"); - abort(); - } - prefixlen = strlen(ppath); - - /* Handle the first "/". i.e. the root directory */ - if (*path == '/') { - ppath[prefixlen]='/'; - ppath[prefixlen+1]='\0'; - ACL_AddAclName(ppath, acllistp, masterlist); - strcat(ppath, "*"); - ACL_AddAclName(ppath, acllistp, masterlist); - slashp = path; - } - - do { - slashp = strchr(++slashp, '/'); - if (slashp) { - slashidx = slashp - path; - strncpy(&ppath[prefixlen], path, slashidx); - ppath[slashidx+prefixlen] = '\0'; - ACL_AddAclName(ppath, acllistp, masterlist); - /* Must also handle "/a/b/" in addition to "/a/b" */ - strcat(ppath, "/"); - ACL_AddAclName(ppath, acllistp, masterlist); - strcat(ppath, "*"); - ACL_AddAclName(ppath, acllistp, masterlist); - continue; - } - strcpy(&ppath[prefixlen], path); - ACL_AddAclName(ppath, acllistp, masterlist); - strcat(ppath, "/"); - ACL_AddAclName(ppath, acllistp, masterlist); - strcat(ppath, "*"); - ACL_AddAclName(ppath, acllistp, masterlist); - break; - } while (slashp); - -} - - static int get_is_owner_default (NSErr_t *errp, PList_t subject, PList_t resource, PList_t auth_info, PList_t global_auth, void *unused) |
