modules/nfs4_acls.h

説明を見る。
00001 /*
00002  * NFS4 ACL handling
00003  *
00004  * Copyright (C) Jim McDonough, 2006
00005  * Reused & renamed some parts of AIX 5.3 sys/acl.h structures
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020  */
00021 
00022 #ifndef __NFS4_ACLS_H__
00023 #define __NFS4_ACLS_H__
00024 
00025 #define SMB_ACLTYPE_NONE 0
00026 #define SMB_ACLTYPE_UNKNOWN 1
00027 #define SMB_ACLTYPE_POSIX 2
00028 #define SMB_ACLTYPE_NFS4 4
00029 
00030 /* 
00031  * Following union captures the identity as 
00032  * used in the NFS4 ACL structures. 
00033  */
00034 typedef union _SMB_NFS4_ACEWHOID_T {
00035         uid_t   uid;    /* User id */
00036         gid_t   gid;    /* Group id */
00037         uint32  special_id;     /* Identifies special identities in NFS4 */
00038 
00039 #define SMB_ACE4_WHO_OWNER         0x00000001 /*The owner of the file. */
00040 #define SMB_ACE4_WHO_GROUP         0x00000002 /*The group associated with the file. */
00041 #define SMB_ACE4_WHO_EVERYONE      0x00000003 /*The world. */
00042 #define SMB_ACE4_WHO_INTERACTIVE   0x00000004 /*Accessed from an interactive terminal. */
00043 #define SMB_ACE4_WHO_NETWORK       0x00000005 /*Accessed via the network. */
00044 #define SMB_ACE4_WHO_DIALUP        0x00000006 /*Accessed as a dialup user to the server. */
00045 #define SMB_ACE4_WHO_BATCH         0x00000007 /*Accessed from a batch job. */
00046 #define SMB_ACE4_WHO_ANONYMOUS     0x00000008 /*Accessed without any authentication. */
00047 #define SMB_ACE4_WHO_AUTHENTICATED 0x00000009 /*Any authenticated user (opposite of ANONYMOUS) */
00048 #define SMB_ACE4_WHO_SERVICE       0x0000000A /*Access from a system service. */
00049 #define SMB_ACE4_WHO_MAX                SMB_ACE4_WHO_SERVICE  /* largest valid ACE4_WHO */
00050         uint32 id;
00051 } SMB_NFS4_ACEWHOID_T;
00052 
00053 typedef struct _SMB_ACE4PROP_T { 
00054         uint32  flags;  /* Bit mask defining details of ACE */
00055 /*The following are constants for flags field */
00056 /* #define      SMB_ACE4_ID_NOT_VALID   0x00000001 - from aix/jfs2 */
00057 #define SMB_ACE4_ID_SPECIAL             0x00000002
00058 
00059         SMB_NFS4_ACEWHOID_T     who;    /* Identifies to whom this ACE applies */
00060 
00061         /* The following part of ACE has the same layout as NFSv4 wire format. */
00062 
00063         uint32  aceType;        /* Type of ACE PERMIT/ALLOW etc*/
00064 /*The constants used for the type field (acetype4) are as follows: */
00065 #define SMB_ACE4_ACCESS_ALLOWED_ACE_TYPE        0x00000000
00066 #define SMB_ACE4_ACCESS_DENIED_ACE_TYPE 0x00000001
00067 #define SMB_ACE4_SYSTEM_AUDIT_ACE_TYPE  0x00000002
00068 #define SMB_ACE4_SYSTEM_ALARM_ACE_TYPE  0x00000003
00069 #define SMB_ACE4_MAX_TYPE       ACE4_SYSTEM_ALARM_ACE_TYPE  /* largest valid ACE4_TYPE */
00070 
00071         uint32  aceFlags;       /* Controls Inheritance and such */
00072 /*The bitmask constants used for the flag field are as follows: */
00073 #define SMB_ACE4_FILE_INHERIT_ACE             0x00000001
00074 #define SMB_ACE4_DIRECTORY_INHERIT_ACE        0x00000002
00075 #define SMB_ACE4_NO_PROPAGATE_INHERIT_ACE     0x00000004
00076 #define SMB_ACE4_INHERIT_ONLY_ACE             0x00000008
00077 #define SMB_ACE4_SUCCESSFUL_ACCESS_ACE_FLAG   0x00000010
00078 #define SMB_ACE4_FAILED_ACCESS_ACE_FLAG       0x00000020
00079 #define SMB_ACE4_IDENTIFIER_GROUP             0x00000040
00080 #define SMB_ACE4_ALL_FLAGS      ( SMB_ACE4_FILE_INHERIT_ACE | SMB_ACE4_DIRECTORY_INHERIT_ACE \
00081 | SMB_ACE4_NO_PROPAGATE_INHERIT_ACE | SMB_ACE4_INHERIT_ONLY_ACE | SMB_ACE4_SUCCESSFUL_ACCESS_ACE_FLAG \
00082 | SMB_ACE4_FAILED_ACCESS_ACE_FLAG | SMB_ACE4_IDENTIFIER_GROUP )
00083 
00084         uint32  aceMask;        /* Access rights */
00085 /*The bitmask constants used for the access mask field are as follows: */
00086 #define SMB_ACE4_READ_DATA            0x00000001
00087 #define SMB_ACE4_LIST_DIRECTORY       0x00000001
00088 #define SMB_ACE4_WRITE_DATA           0x00000002
00089 #define SMB_ACE4_ADD_FILE             0x00000002
00090 #define SMB_ACE4_APPEND_DATA          0x00000004
00091 #define SMB_ACE4_ADD_SUBDIRECTORY     0x00000004
00092 #define SMB_ACE4_READ_NAMED_ATTRS     0x00000008
00093 #define SMB_ACE4_WRITE_NAMED_ATTRS    0x00000010
00094 #define SMB_ACE4_EXECUTE              0x00000020
00095 #define SMB_ACE4_DELETE_CHILD         0x00000040
00096 #define SMB_ACE4_READ_ATTRIBUTES      0x00000080
00097 #define SMB_ACE4_WRITE_ATTRIBUTES     0x00000100
00098 #define SMB_ACE4_DELETE               0x00010000
00099 #define SMB_ACE4_READ_ACL             0x00020000
00100 #define SMB_ACE4_WRITE_ACL            0x00040000
00101 #define SMB_ACE4_WRITE_OWNER          0x00080000
00102 #define SMB_ACE4_SYNCHRONIZE          0x00100000
00103 #define SMB_ACE4_ALL_MASKS      ( SMB_ACE4_READ_DATA | SMB_ACE4_LIST_DIRECTORY \
00104 | SMB_ACE4_WRITE_DATA | SMB_ACE4_ADD_FILE | SMB_ACE4_APPEND_DATA | SMB_ACE4_ADD_SUBDIRECTORY \
00105 | SMB_ACE4_READ_NAMED_ATTRS | SMB_ACE4_WRITE_NAMED_ATTRS | SMB_ACE4_EXECUTE | SMB_ACE4_DELETE_CHILD \
00106 | SMB_ACE4_READ_ATTRIBUTES | SMB_ACE4_WRITE_ATTRIBUTES | SMB_ACE4_DELETE | SMB_ACE4_READ_ACL \
00107 | SMB_ACE4_WRITE_ACL | SMB_ACE4_WRITE_OWNER | SMB_ACE4_SYNCHRONIZE )
00108 } SMB_ACE4PROP_T;
00109 
00110 /*
00111  * Never allocate these structures on your own
00112  * use create_smb4acl instead
00113  */
00114 typedef struct _SMB4ACL_T {char dontuse;} SMB4ACL_T;
00115 typedef struct _SMB4ACE_T {char dontuse;} SMB4ACE_T;
00116 
00117 SMB4ACL_T *smb_create_smb4acl(void);
00118 
00119 /* prop's contents are copied */
00120 /* it doesn't change the order, appends */
00121 SMB4ACE_T *smb_add_ace4(SMB4ACL_T *acl, SMB_ACE4PROP_T *prop);
00122 
00123 SMB_ACE4PROP_T *smb_get_ace4(SMB4ACE_T *ace);
00124 
00125 /* Returns NULL if none - or error */
00126 SMB4ACE_T *smb_first_ace4(SMB4ACL_T *acl);
00127 
00128 /* Returns NULL in the end - or error */
00129 SMB4ACE_T *smb_next_ace4(SMB4ACE_T *ace);
00130 
00131 uint32 smb_get_naces(SMB4ACL_T *acl);
00132 
00133 size_t smb_get_nt_acl_nfs4(files_struct *fsp,
00134         uint32 security_info,
00135         SEC_DESC **ppdesc, SMB4ACL_T *acl);
00136 
00137 /* Callback function needed to set the native acl
00138  * when applicable */
00139 typedef BOOL (*set_nfs4acl_native_fn_t)(files_struct *, SMB4ACL_T *);
00140 
00141 BOOL smb_set_nt_acl_nfs4(files_struct *fsp,
00142         uint32 security_info_sent,
00143         SEC_DESC *psd,
00144         set_nfs4acl_native_fn_t set_nfs4_native);
00145 
00146 #endif /* __NFS4_ACLS_H__ */

Sambaに対してSat Aug 29 21:23:06 2009に生成されました。  doxygen 1.4.7