diff options
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; |