---
name: "dpns_getacl"
section: "3"
platform: "linux"
package: "libdpm-dev"
version: "1.10.0-2+b3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/dpns_getacl"
---

# dpns\_getacl(3)

get DPNS directory/file access control lists

## NAME

dpns\_getacl - get DPNS directory/file access control lists

## SYNOPSIS

**#include \<sys/types.h\>**\
 **#include "dpns\_api.h"**

**int dpns\_getacl (const char \****path***,** **int** *nentries***,** **struct dpns\_acl \****acl***)**

## DESCRIPTION

**dpns\_getacl** gets the Access Control List associated with a DPNS directory/file.

- *path*

  specifies the logical pathname relative to the current DPNS directory or the full DPNS pathname.

- *nentries*

  specifies the number of entries that can fit in the buffer. If *nentries* is zero, the *acl* pointer can be NULL and the routine just returns the actual number of entries.

- *acl*

  is a pointer to an array of dpns\_acl structures allocated by the application to receive the reply.

```
struct dpns_acl {
        unsigned char   a_type;
        int             a_id;
        unsigned char   a_perm;
};
```

- *a\_type*

  is the ACL type: CNS\_ACL\_USER\_OBJ, CNS\_ACL\_USER, CNS\_ACL\_GROUP\_OBJ, CNS\_ACL\_GROUP, CNS\_ACL\_MASK or CNS\_ACL\_OTHER. Types for default entries are obtained by OR'ing the flag CNS\_ACL\_DEFAULT with one of the above types.

- *a\_id*

  is the user or group numeric id.

- *a\_perm*

  is the access permission in numeric form obtained by OR'ing some of the bits S\_IROTH, S\_IWOTH, S\_IXOTH.

## RETURN VALUE

This routine returns the actual number of entries if the operation was successful or -1 if the operation failed. In the latter case, **serrno** is set appropriately.

## ERRORS

- **ENOENT**

  The named file/directory does not exist or is a null pathname.

- **EACCES**

  Search permission is denied on a component of the *path* prefix.

- **EFAULT**

  *path* is a NULL pointer or *acl* is a NULL pointer and *nentries* is greater than zero.

- **ENOTDIR**

  A component of *path* prefix is not a directory.

- **EINVAL**

  *nentries* is negative.

- **ENOSPC**

  *nentries* is less than the number of entries returned by the server.

- **ENAMETOOLONG**

  The length of *path* exceeds **CA\_MAXPATHLEN** or the length of a *path* component exceeds **CA\_MAXNAMELEN**.

- **SENOSHOST**

  Host unknown.

- **SENOSSERV**

  Service unknown.

- **SECOMERR**

  Communication error.

- **ENSNACT**

  Name server is not running or is being shutdown.

## SEE ALSO

**[Castor\_limits(4)](/Castor_limits/4.md)**, **[dpns\_chdir(3)](/dpns_chdir/3.md)**, **[dpns\_chmod(3)](/dpns_chmod/3.md)**, **[dpns-getacl(1)](/dpns-getacl/1.md)**

## AUTHOR

**LCG Grid Deployment** Team
