diff options
author | rwatson <rwatson@FreeBSD.org> | 2002-12-29 20:47:05 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2002-12-29 20:47:05 +0000 |
commit | bce6bfbbec294637e0155592caaded654445629a (patch) | |
tree | 985bdae2196acf3128685ad7f46fecd574f00a3f /lib/libc/posix1e/acl_set.c | |
parent | 22c41db3e52c6f1d4dc6adf5207326b1259e119b (diff) | |
download | FreeBSD-src-bce6bfbbec294637e0155592caaded654445629a.zip FreeBSD-src-bce6bfbbec294637e0155592caaded654445629a.tar.gz |
Update libc POSIX.1e code and documentation to reflect:
- Updated copyrights, modified dates
- Remove "BUGS" entry indicating that ACLs are unimplemented
- Implement acl_*_link() library wrapper variants for get, set,
delete, aclvalid.
- Document acl_*_link() calls.
Obtained from: TrustedBSD Project
Diffstat (limited to 'lib/libc/posix1e/acl_set.c')
-rw-r--r-- | lib/libc/posix1e/acl_set.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/lib/libc/posix1e/acl_set.c b/lib/libc/posix1e/acl_set.c index b9e6860..34d5a33 100644 --- a/lib/libc/posix1e/acl_set.c +++ b/lib/libc/posix1e/acl_set.c @@ -1,7 +1,9 @@ /*- - * Copyright (c) 1999, 2000, 2001 Robert N. M. Watson + * Copyright (c) 1999, 2000, 2001, 2002 Robert N. M. Watson * All rights reserved. * + * This software was developed by Robert Watson for the TrustedBSD Project. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -70,6 +72,28 @@ acl_set_file(const char *path_p, acl_type_t type, acl_t acl) } int +acl_set_link_np(const char *path_p, acl_type_t type, acl_t acl) +{ + int error; + + if (acl == NULL || path_p == NULL) { + errno = EINVAL; + return (-1); + } + if (_posix1e_acl(acl, type)) { + error = _posix1e_acl_sort(acl); + if (error) { + errno = error; + return (-1); + } + } + + acl->ats_cur_entry = 0; + + return (__acl_set_link(path_p, type, &acl->ats_acl)); +} + +int acl_set_fd(int fd, acl_t acl) { int error; |