Changeset 221 for branches/samba-3.3.x/source/modules
- Timestamp:
- May 24, 2009, 7:17:10 AM (16 years ago)
- Location:
- branches/samba-3.3.x/source/modules
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/modules/nfs4_acls.c
r206 r221 45 45 } SMB_ACL4_INT_T; 46 46 47 static SMB_ACL4_INT_T *get_validated_aclint(SMB4ACL_T * acl)48 { 49 SMB_ACL4_INT_T *aclint = (SMB_ACL4_INT_T *) acl;50 if ( acl==NULL)47 static SMB_ACL4_INT_T *get_validated_aclint(SMB4ACL_T *theacl) 48 { 49 SMB_ACL4_INT_T *aclint = (SMB_ACL4_INT_T *)theacl; 50 if (theacl==NULL) 51 51 { 52 52 DEBUG(2, ("acl is NULL\n")); … … 84 84 { 85 85 TALLOC_CTX *mem_ctx = talloc_tos(); 86 SMB_ACL4_INT_T * acl = (SMB_ACL4_INT_T *)TALLOC_ZERO_SIZE(mem_ctx, sizeof(SMB_ACL4_INT_T));87 if ( acl==NULL)86 SMB_ACL4_INT_T *theacl = (SMB_ACL4_INT_T *)TALLOC_ZERO_SIZE(mem_ctx, sizeof(SMB_ACL4_INT_T)); 87 if (theacl==NULL) 88 88 { 89 89 DEBUG(0, ("TALLOC_SIZE failed\n")); … … 91 91 return NULL; 92 92 } 93 acl->magic = SMB_ACL4_INT_MAGIC;94 /* acl->first, last = NULL not needed */95 return (SMB4ACL_T *) acl;96 } 97 98 SMB4ACE_T *smb_add_ace4(SMB4ACL_T * acl, SMB_ACE4PROP_T *prop)99 { 100 SMB_ACL4_INT_T *aclint = get_validated_aclint( acl);93 theacl->magic = SMB_ACL4_INT_MAGIC; 94 /* theacl->first, last = NULL not needed */ 95 return (SMB4ACL_T *)theacl; 96 } 97 98 SMB4ACE_T *smb_add_ace4(SMB4ACL_T *theacl, SMB_ACE4PROP_T *prop) 99 { 100 SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl); 101 101 TALLOC_CTX *mem_ctx = talloc_tos(); 102 102 SMB_ACE4_INT_T *ace; … … 144 144 } 145 145 146 SMB4ACE_T *smb_first_ace4(SMB4ACL_T * acl)147 { 148 SMB_ACL4_INT_T *aclint = get_validated_aclint( acl);146 SMB4ACE_T *smb_first_ace4(SMB4ACL_T *theacl) 147 { 148 SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl); 149 149 if (aclint==NULL) 150 150 return NULL; … … 153 153 } 154 154 155 uint32 smb_get_naces(SMB4ACL_T * acl)156 { 157 SMB_ACL4_INT_T *aclint = get_validated_aclint( acl);155 uint32 smb_get_naces(SMB4ACL_T *theacl) 156 { 157 SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl); 158 158 if (aclint==NULL) 159 159 return 0; … … 196 196 } 197 197 198 static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx, SMB4ACL_T * acl, /* in */198 static bool smbacl4_nfs42win(TALLOC_CTX *mem_ctx, SMB4ACL_T *theacl, /* in */ 199 199 DOM_SID *psid_owner, /* in */ 200 200 DOM_SID *psid_group, /* in */ 201 bool is_directory, /* in */ 201 202 SEC_ACE **ppnt_ace_list, /* out */ 202 203 int *pgood_aces /* out */ 203 204 ) 204 205 { 205 SMB_ACL4_INT_T *aclint = (SMB_ACL4_INT_T *) acl;206 SMB_ACL4_INT_T *aclint = (SMB_ACL4_INT_T *)theacl; 206 207 SMB_ACE4_INT_T *aceint; 207 208 SEC_ACE *nt_ace_list = NULL; … … 210 211 DEBUG(10, ("smbacl_nfs42win entered")); 211 212 212 aclint = get_validated_aclint( acl);213 /* We do not check for naces being 0 or acl being NULL here because it is done upstream */213 aclint = get_validated_aclint(theacl); 214 /* We do not check for naces being 0 or theacl being NULL here because it is done upstream */ 214 215 /* in smb_get_nt_acl_nfs4(). */ 215 216 nt_ace_list = (SEC_ACE *)TALLOC_ZERO_SIZE(mem_ctx, aclint->naces * sizeof(SEC_ACE)); … … 257 258 sid_string_dbg(&sid))); 258 259 260 if (is_directory && (ace->aceMask & SMB_ACE4_ADD_FILE)) { 261 ace->aceMask |= SMB_ACE4_DELETE_CHILD; 262 } 263 259 264 mask = ace->aceMask; 260 265 init_sec_ace(&nt_ace_list[good_aces++], &sid, … … 271 276 static NTSTATUS smb_get_nt_acl_nfs4_common(const SMB_STRUCT_STAT *sbuf, 272 277 uint32 security_info, 273 SEC_DESC **ppdesc, SMB4ACL_T * acl)278 SEC_DESC **ppdesc, SMB4ACL_T *theacl) 274 279 { 275 280 int good_aces = 0; … … 280 285 TALLOC_CTX *mem_ctx = talloc_tos(); 281 286 282 if ( acl==NULL || smb_get_naces(acl)==0)287 if (theacl==NULL || smb_get_naces(theacl)==0) 283 288 return NT_STATUS_ACCESS_DENIED; /* special because we 284 289 * shouldn't alloc 0 for … … 288 293 gid_to_sid(&sid_group, sbuf->st_gid); 289 294 290 if (smbacl4_nfs42win(mem_ctx, acl, &sid_owner, &sid_group, &nt_ace_list, &good_aces)==False) { 295 if (smbacl4_nfs42win(mem_ctx, theacl, &sid_owner, &sid_group, S_ISDIR(sbuf->st_mode), 296 &nt_ace_list, &good_aces)==False) { 291 297 DEBUG(8,("smbacl4_nfs42win failed\n")); 292 298 return map_nt_error_from_unix(errno); … … 317 323 NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp, 318 324 uint32 security_info, 319 SEC_DESC **ppdesc, SMB4ACL_T * acl)325 SEC_DESC **ppdesc, SMB4ACL_T *theacl) 320 326 { 321 327 SMB_STRUCT_STAT sbuf; … … 327 333 } 328 334 329 return smb_get_nt_acl_nfs4_common(&sbuf, security_info, ppdesc, acl);335 return smb_get_nt_acl_nfs4_common(&sbuf, security_info, ppdesc, theacl); 330 336 } 331 337 … … 333 339 const char *name, 334 340 uint32 security_info, 335 SEC_DESC **ppdesc, SMB4ACL_T * acl)341 SEC_DESC **ppdesc, SMB4ACL_T *theacl) 336 342 { 337 343 SMB_STRUCT_STAT sbuf; … … 343 349 } 344 350 345 return smb_get_nt_acl_nfs4_common(&sbuf, security_info, ppdesc, acl);351 return smb_get_nt_acl_nfs4_common(&sbuf, security_info, ppdesc, theacl); 346 352 } 347 353 … … 394 400 } 395 401 396 static void smbacl4_dump_nfs4acl(int level, SMB4ACL_T * acl)397 { 398 SMB_ACL4_INT_T *aclint = get_validated_aclint( acl);402 static void smbacl4_dump_nfs4acl(int level, SMB4ACL_T *theacl) 403 { 404 SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl); 399 405 SMB_ACE4_INT_T *aceint; 400 406 … … 418 424 */ 419 425 static SMB_ACE4PROP_T *smbacl4_find_equal_special( 420 SMB4ACL_T * acl,426 SMB4ACL_T *theacl, 421 427 SMB_ACE4PROP_T *aceNew) 422 428 { 423 SMB_ACL4_INT_T *aclint = get_validated_aclint( acl);429 SMB_ACL4_INT_T *aclint = get_validated_aclint(theacl); 424 430 SMB_ACE4_INT_T *aceint; 425 431 … … 613 619 static int smbacl4_MergeIgnoreReject( 614 620 enum smbacl4_acedup_enum acedup, 615 SMB4ACL_T * acl, /* may modify it */621 SMB4ACL_T *theacl, /* may modify it */ 616 622 SMB_ACE4PROP_T *ace, /* the "new" ACE */ 617 623 bool *paddNewACE, … … 620 626 { 621 627 int result = 0; 622 SMB_ACE4PROP_T *ace4found = smbacl4_find_equal_special( acl, ace);628 SMB_ACE4PROP_T *ace4found = smbacl4_find_equal_special(theacl, ace); 623 629 if (ace4found) 624 630 { … … 653 659 ) 654 660 { 655 SMB4ACL_T * acl;661 SMB4ACL_T *theacl; 656 662 uint32 i; 657 663 TALLOC_CTX *mem_ctx = talloc_tos(); … … 659 665 DEBUG(10, ("smbacl4_win2nfs4 invoked\n")); 660 666 661 acl = smb_create_smb4acl();662 if ( acl==NULL)667 theacl = smb_create_smb4acl(); 668 if (theacl==NULL) 663 669 return NULL; 664 670 … … 677 683 678 684 if (pparams->acedup!=e_dontcare) { 679 if (smbacl4_MergeIgnoreReject(pparams->acedup, acl,685 if (smbacl4_MergeIgnoreReject(pparams->acedup, theacl, 680 686 &ace_v4, &addNewACE, i)) 681 687 return NULL; … … 683 689 684 690 if (addNewACE) 685 smb_add_ace4( acl, &ace_v4);686 } 687 688 return acl;691 smb_add_ace4(theacl, &ace_v4); 692 } 693 694 return theacl; 689 695 } 690 696 … … 695 701 { 696 702 smbacl4_vfs_params params; 697 SMB4ACL_T * acl = NULL;703 SMB4ACL_T *theacl = NULL; 698 704 bool result; 699 705 … … 754 760 } 755 761 756 acl = smbacl4_win2nfs4(fsp->fsp_name, psd->dacl, ¶ms, sbuf.st_uid, sbuf.st_gid);757 if (! acl)762 theacl = smbacl4_win2nfs4(fsp->fsp_name, psd->dacl, ¶ms, sbuf.st_uid, sbuf.st_gid); 763 if (!theacl) 758 764 return map_nt_error_from_unix(errno); 759 765 760 smbacl4_dump_nfs4acl(10, acl);766 smbacl4_dump_nfs4acl(10, theacl); 761 767 762 768 if (set_acl_as_root) { 763 769 become_root(); 764 770 } 765 result = set_nfs4_native(fsp, acl);771 result = set_nfs4_native(fsp, theacl); 766 772 saved_errno = errno; 767 773 if (set_acl_as_root) { -
branches/samba-3.3.x/source/modules/nfs4_acls.h
r206 r221 118 118 /* prop's contents are copied */ 119 119 /* it doesn't change the order, appends */ 120 SMB4ACE_T *smb_add_ace4(SMB4ACL_T * acl, SMB_ACE4PROP_T *prop);120 SMB4ACE_T *smb_add_ace4(SMB4ACL_T *theacl, SMB_ACE4PROP_T *prop); 121 121 122 122 SMB_ACE4PROP_T *smb_get_ace4(SMB4ACE_T *ace); 123 123 124 124 /* Returns NULL if none - or error */ 125 SMB4ACE_T *smb_first_ace4(SMB4ACL_T * acl);125 SMB4ACE_T *smb_first_ace4(SMB4ACL_T *theacl); 126 126 127 127 /* Returns NULL in the end - or error */ 128 128 SMB4ACE_T *smb_next_ace4(SMB4ACE_T *ace); 129 129 130 uint32 smb_get_naces(SMB4ACL_T * acl);130 uint32 smb_get_naces(SMB4ACL_T *theacl); 131 131 132 132 NTSTATUS smb_fget_nt_acl_nfs4(files_struct *fsp, 133 133 uint32 security_info, 134 SEC_DESC **ppdesc, SMB4ACL_T * acl);134 SEC_DESC **ppdesc, SMB4ACL_T *theacl); 135 135 136 136 NTSTATUS smb_get_nt_acl_nfs4(connection_struct *conn, 137 137 const char *name, 138 138 uint32 security_info, 139 SEC_DESC **ppdesc, SMB4ACL_T * acl);139 SEC_DESC **ppdesc, SMB4ACL_T *theacl); 140 140 141 141 /* Callback function needed to set the native acl -
branches/samba-3.3.x/source/modules/vfs_default.c
r206 r221 671 671 times.actime = convert_timespec_to_time_t(ts[0]); 672 672 times.modtime = convert_timespec_to_time_t(ts[1]); 673 result = utime(path, times);673 result = utime(path, ×); 674 674 } else { 675 675 result = utime(path, NULL); -
branches/samba-3.3.x/source/modules/vfs_extd_audit.c
r206 r221 290 290 (result < 0) ? strerror(errno) : ""); 291 291 DEBUG(1, ("vfs_extd_audit: chmod %s mode 0x%x %s %s\n", 292 path, mode,292 path, (unsigned int)mode, 293 293 (result < 0) ? "failed: " : "", 294 294 (result < 0) ? strerror(errno) : "")); … … 308 308 (result < 0) ? strerror(errno) : ""); 309 309 DEBUG(1, ("vfs_extd_audit: chmod_acl %s mode 0x%x %s %s\n", 310 path, mode,310 path, (unsigned int)mode, 311 311 (result < 0) ? "failed: " : "", 312 312 (result < 0) ? strerror(errno) : "")); … … 326 326 (result < 0) ? strerror(errno) : ""); 327 327 DEBUG(1, ("vfs_extd_audit: fchmod %s mode 0x%x %s %s", 328 fsp->fsp_name, mode,328 fsp->fsp_name, (unsigned int)mode, 329 329 (result < 0) ? "failed: " : "", 330 330 (result < 0) ? strerror(errno) : "")); … … 344 344 (result < 0) ? strerror(errno) : ""); 345 345 DEBUG(1, ("vfs_extd_audit: fchmod_acl %s mode 0x%x %s %s", 346 fsp->fsp_name, mode,346 fsp->fsp_name, (unsigned int)mode, 347 347 (result < 0) ? "failed: " : "", 348 348 (result < 0) ? strerror(errno) : "")); -
branches/samba-3.3.x/source/modules/vfs_smb_traffic_analyzer.c
r206 r221 165 165 char *username = NULL; 166 166 const char *anon_prefix = NULL; 167 const char *total_anonymization = NULL; 167 168 size_t len; 168 169 … … 185 186 /* check if anonymization is required */ 186 187 188 total_anonymization=lp_parm_const_string(SNUM(handle->conn),"smb_traffic_analyzer", 189 "total_anonymization", NULL); 190 187 191 anon_prefix=lp_parm_const_string(SNUM(handle->conn),"smb_traffic_analyzer",\ 188 192 "anonymize_prefix", NULL ); 189 193 if (anon_prefix!=NULL) { 190 username = talloc_asprintf(talloc_tos(), 191 "%s%i", 192 anon_prefix, 193 str_checksum( 194 handle->conn->server_info->sanitized_username ) ); 194 if (total_anonymization!=NULL) { 195 username = talloc_asprintf(talloc_tos(), 196 "%s", 197 anon_prefix); 198 } else { 199 username = talloc_asprintf(talloc_tos(), 200 "%s%i", 201 anon_prefix, 202 str_checksum( 203 handle->conn->server_info->sanitized_username ) ); 204 } 205 195 206 } else { 196 207 username = handle->conn->server_info->sanitized_username; -
branches/samba-3.3.x/source/modules/vfs_solarisacl.c
r206 r221 52 52 int *count); 53 53 static bool solaris_acl_get_fd(int fd, SOLARIS_ACL_T *solarisacl, int *count); 54 static bool solaris_acl_sort(SOLARIS_ACL_T acl, int count);54 static bool solaris_acl_sort(SOLARIS_ACL_T theacl, int count); 55 55 static SMB_ACL_PERM_T solaris_perm_to_smb_perm(const SOLARIS_PERM_T perm); 56 56 static SOLARIS_PERM_T smb_perm_to_solaris_perm(const SMB_ACL_PERM_T perm); 57 #if 0 57 58 static bool solaris_acl_check(SOLARIS_ACL_T solaris_acl, int count); 58 59 #endif 59 60 60 61 /* public functions - the api */ … … 348 349 bool ret = False; 349 350 int i; 350 int check_which, check_rc;351 351 352 352 DEBUG(10, ("entering smb_acl_to_solaris_acl\n")); … … 718 718 } 719 719 720 #if 0 720 721 /* 721 722 * acl check function: … … 747 748 return True; 748 749 } 749 750 #endif 750 751 751 752 /* VFS operations structure */
Note:
See TracChangeset
for help on using the changeset viewer.