acl_support_nfs4.c (194957) | acl_support_nfs4.c (220465) |
---|---|
1/*- 2 * Copyright (c) 2008, 2009 Edward Tomasz Napiera��a <trasz@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2008, 2009 Edward Tomasz Napiera��a <trasz@FreeBSD.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_support_nfs4.c 194957 2009-06-25 13:08:02Z trasz $"); | 28__FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_support_nfs4.c 220465 2011-04-09 07:42:25Z trasz $"); |
29 30#include <stdio.h> 31#include <stdlib.h> 32#include <string.h> 33#include <assert.h> 34#include <err.h> 35#include <sys/acl.h> 36#include "acl_support.h" --- 28 unchanged lines hidden (view full) --- 65 { ACL_READ_ATTRIBUTES, "read_attributes", 'a'}, 66 { ACL_WRITE_ATTRIBUTES, "write_attributes", 'A'}, 67 { ACL_READ_NAMED_ATTRS, "read_xattr", 'R'}, 68 { ACL_WRITE_NAMED_ATTRS, "write_xattr", 'W'}, 69 { ACL_READ_ACL, "read_acl", 'c'}, 70 { ACL_WRITE_ACL, "write_acl", 'C'}, 71 { ACL_WRITE_OWNER, "write_owner", 'o'}, 72 { ACL_SYNCHRONIZE, "synchronize", 's'}, | 29 30#include <stdio.h> 31#include <stdlib.h> 32#include <string.h> 33#include <assert.h> 34#include <err.h> 35#include <sys/acl.h> 36#include "acl_support.h" --- 28 unchanged lines hidden (view full) --- 65 { ACL_READ_ATTRIBUTES, "read_attributes", 'a'}, 66 { ACL_WRITE_ATTRIBUTES, "write_attributes", 'A'}, 67 { ACL_READ_NAMED_ATTRS, "read_xattr", 'R'}, 68 { ACL_WRITE_NAMED_ATTRS, "write_xattr", 'W'}, 69 { ACL_READ_ACL, "read_acl", 'c'}, 70 { ACL_WRITE_ACL, "write_acl", 'C'}, 71 { ACL_WRITE_OWNER, "write_owner", 'o'}, 72 { ACL_SYNCHRONIZE, "synchronize", 's'}, |
73 { ACL_FULL_SET, "full_set", '\0'}, 74 { ACL_MODIFY_SET, "modify_set", '\0'}, 75 { ACL_READ_SET, "read_set", '\0'}, 76 { ACL_WRITE_SET, "write_set", '\0'}, |
|
73 { 0, 0, 0}}; 74 75static const char * 76format_flag(uint32_t *var, const struct flagnames_struct *flags) 77{ 78 79 for (; flags->name != 0; flags++) { 80 if ((flags->flag & *var) == 0) --- 31 unchanged lines hidden (view full) --- 112} 113 114static int 115format_flags_compact(char *str, size_t size, uint32_t var, 116 const struct flagnames_struct *flags) 117{ 118 size_t i; 119 | 77 { 0, 0, 0}}; 78 79static const char * 80format_flag(uint32_t *var, const struct flagnames_struct *flags) 81{ 82 83 for (; flags->name != 0; flags++) { 84 if ((flags->flag & *var) == 0) --- 31 unchanged lines hidden (view full) --- 116} 117 118static int 119format_flags_compact(char *str, size_t size, uint32_t var, 120 const struct flagnames_struct *flags) 121{ 122 size_t i; 123 |
120 for (i = 0; flags[i].name != NULL; i++) { | 124 for (i = 0; flags[i].letter != '\0'; i++) { |
121 assert(i < size); 122 if ((flags[i].flag & var) == 0) 123 str[i] = '-'; 124 else 125 str[i] = flags[i].letter; 126 } 127 128 str[i] = '\0'; --- 128 unchanged lines hidden --- | 125 assert(i < size); 126 if ((flags[i].flag & var) == 0) 127 str[i] = '-'; 128 else 129 str[i] = flags[i].letter; 130 } 131 132 str[i] = '\0'; --- 128 unchanged lines hidden --- |