diff options
| author | Robert Watson <rwatson@FreeBSD.org> | 2002-12-29 20:47:05 +0000 |
|---|---|---|
| committer | Robert Watson <rwatson@FreeBSD.org> | 2002-12-29 20:47:05 +0000 |
| commit | 6394f703dcdf80f1fd010d508645732880f46d93 (patch) | |
| tree | 985bdae2196acf3128685ad7f46fecd574f00a3f /lib/libc/posix1e/acl_valid.c | |
| parent | a95f262c6b67d086d3bffa6c87d4b0c909519d27 (diff) | |
Notes
Diffstat (limited to 'lib/libc/posix1e/acl_valid.c')
| -rw-r--r-- | lib/libc/posix1e/acl_valid.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/lib/libc/posix1e/acl_valid.c b/lib/libc/posix1e/acl_valid.c index 179e47e1e466..9b1f9b96c4d2 100644 --- a/lib/libc/posix1e/acl_valid.c +++ b/lib/libc/posix1e/acl_valid.c @@ -1,7 +1,9 @@ /*- - * Copyright (c) 1999, 2000, 20001 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,7 +72,6 @@ acl_valid(acl_t acl) } } - int acl_valid_file_np(const char *pathp, acl_type_t type, acl_t acl) { @@ -91,6 +92,25 @@ acl_valid_file_np(const char *pathp, acl_type_t type, acl_t acl) return (__acl_aclcheck_file(pathp, type, &acl->ats_acl)); } +int +acl_valid_link_np(const char *pathp, acl_type_t type, acl_t acl) +{ + int error; + + if (pathp == NULL || acl == NULL) { + errno = EINVAL; + return (-1); + } + if (_posix1e_acl(acl, type)) { + error = _posix1e_acl_sort(acl); + if (error) { + errno = error; + return (-1); + } + } + + return (__acl_aclcheck_link(pathp, type, &acl->ats_acl)); +} int acl_valid_fd_np(int fd, acl_type_t type, acl_t acl) |
