Changeset 740 for vendor/current/source4/ntvfs/unixuid
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- Location:
- vendor/current/source4/ntvfs/unixuid
- Files:
-
- 1 added
- 2 deleted
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/ntvfs/unixuid/vfs_unixuid.c
r414 r740 30 30 #include <tevent.h> 31 31 32 #if defined(UID_WRAPPER) 33 #if !defined(UID_WRAPPER_REPLACE) && !defined(UID_WRAPPER_NOT_REPLACE) 34 #define UID_WRAPPER_REPLACE 35 #include "../uid_wrapper/uid_wrapper.h" 36 #endif 37 #else 38 #define uwrap_enabled() 0 39 #endif 40 41 32 42 struct unixuid_private { 33 43 struct wbc_context *wbc_ctx; … … 41 51 uid_t uid; 42 52 gid_t gid; 43 u int_t ngroups;53 unsigned int ngroups; 44 54 gid_t *groups; 45 55 }; … … 163 173 int i; 164 174 NTSTATUS status; 165 struct id_map ping*ids;175 struct id_map *ids; 166 176 struct composite_context *ctx; 167 177 *sec = talloc(req, struct unix_sec_ctx); … … 172 182 } 173 183 174 ids = talloc_array(req, struct id_map ping, token->num_sids);184 ids = talloc_array(req, struct id_map, token->num_sids); 175 185 NT_STATUS_HAVE_NO_MEMORY(ids); 176 177 ids[0].unixid = NULL;178 ids[0].sid = token->user_sid;179 ids[0].status = NT_STATUS_NONE_MAPPED;180 181 ids[1].unixid = NULL;182 ids[1].sid = token->group_sid;183 ids[1].status = NT_STATUS_NONE_MAPPED;184 186 185 187 (*sec)->ngroups = token->num_sids - 2; … … 187 189 NT_STATUS_HAVE_NO_MEMORY((*sec)->groups); 188 190 189 for (i=0;i< (*sec)->ngroups;i++) {190 ids[i+2].unixid = NULL;191 ids[i +2].sid = token->sids[i+2];192 ids[i +2].status = NT_STATUS_NONE_MAPPED;191 for (i=0;i<token->num_sids;i++) { 192 ZERO_STRUCT(ids[i].xid); 193 ids[i].sid = &token->sids[i]; 194 ids[i].status = ID_UNKNOWN; 193 195 } 194 196 … … 199 201 NT_STATUS_NOT_OK_RETURN(status); 200 202 201 if (ids[0]. unixid->type == ID_TYPE_BOTH ||202 ids[0]. unixid->type == ID_TYPE_UID) {203 (*sec)->uid = ids[0]. unixid->id;203 if (ids[0].xid.type == ID_TYPE_BOTH || 204 ids[0].xid.type == ID_TYPE_UID) { 205 (*sec)->uid = ids[0].xid.id; 204 206 } else { 205 207 return NT_STATUS_INVALID_SID; 206 208 } 207 209 208 if (ids[1]. unixid->type == ID_TYPE_BOTH ||209 ids[1]. unixid->type == ID_TYPE_GID) {210 (*sec)->gid = ids[1]. unixid->id;210 if (ids[1].xid.type == ID_TYPE_BOTH || 211 ids[1].xid.type == ID_TYPE_GID) { 212 (*sec)->gid = ids[1].xid.id; 211 213 } else { 212 214 return NT_STATUS_INVALID_SID; … … 214 216 215 217 for (i=0;i<(*sec)->ngroups;i++) { 216 if (ids[i+2]. unixid->type == ID_TYPE_BOTH ||217 ids[i+2]. unixid->type == ID_TYPE_GID) {218 (*sec)->groups[i] = ids[i+2]. unixid->id;218 if (ids[i+2].xid.type == ID_TYPE_BOTH || 219 ids[i+2].xid.type == ID_TYPE_GID) { 220 (*sec)->groups[i] = ids[i+2].xid.id; 219 221 } else { 220 222 return NT_STATUS_INVALID_SID; … … 236 238 NTSTATUS status; 237 239 238 if (req->session_info == NULL) { 240 /* If we are asked to set up, but have not had a successful 241 * session setup or tree connect, then these may not be filled 242 * in. ACCESS_DENIED is the right error code here */ 243 if (req->session_info == NULL || priv == NULL) { 239 244 return NT_STATUS_ACCESS_DENIED; 240 245 }
Note:
See TracChangeset
for help on using the changeset viewer.