---
name: "af_protect"
section: "3"
platform: "linux"
package: "atfs-dev"
version: "1.4pl6-15+b1"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/af_protect"
---

# af\_protect(3)

AtFS protection handling

## NAME

af\_chowner, af\_chauthor, af\_chmod - AtFS protection handling

## SYNOPSIS

\#include \<atfs.h\>

int af\_chowner (Af\_key \*aso, Af\_user \*owner)

int af\_chauthor (Af\_key \*aso, Af\_user \*author)

int af\_chmod (Af\_key \*aso, int mode)

## DESCRIPTION

*af\_chowner* and *af\_chauthor* modify the owner and author attribute of an ASO. Only the superuser may change the owner of an object history. The author attribute of an ASO can only be changed by it's owner. The Af\_user structure has the following form

```
typedef struct {
	char	af_username[MAXUSERNAMELEN];
	char	af_userhost[MAXHOSTNAMELEN];
	char	af_userdomain[MAXDOMAIN+1];
	} Af_user;
```

*af\_chmod* changes the mode of an ASO. See chmod(3) for further details.

## SEE ALSO

chown (2), chmod (2)

## DIAGNOSTICS

Upon error, -1 is returned and *af\_errno* is set to the corresponding error number.

## BUGS

*af\_chowner* does not work.
