Changeset 746 for vendor/current/source3/smbd/close.c
- Timestamp:
- Nov 27, 2012, 4:56:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/smbd/close.c
r740 r746 202 202 NTSTATUS delete_all_streams(connection_struct *conn, const char *fname) 203 203 { 204 struct stream_struct *stream_info ;204 struct stream_struct *stream_info = NULL; 205 205 int i; 206 unsigned int num_streams ;206 unsigned int num_streams = 0; 207 207 TALLOC_CTX *frame = talloc_stackframe(); 208 208 NTSTATUS status; 209 209 210 status = SMB_VFS_STREAMINFO(conn, NULL, fname, talloc_tos(),211 210 status = vfs_streaminfo(conn, NULL, fname, talloc_tos(), 211 &num_streams, &stream_info); 212 212 213 213 if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)) { … … 218 218 219 219 if (!NT_STATUS_IS_OK(status)) { 220 DEBUG(10, (" SMB_VFS_STREAMINFOfailed: %s\n",220 DEBUG(10, ("vfs_streaminfo failed: %s\n", 221 221 nt_errstr(status))); 222 222 goto fail; … … 281 281 struct file_id id; 282 282 const struct security_unix_token *del_token = NULL; 283 const struct security_token *del_nt_token = NULL; 284 bool got_tokens = false; 283 285 284 286 /* Ensure any pending write time updates are done. */ … … 346 348 } 347 349 fsp->delete_on_close = true; 348 set_delete_on_close_lck(fsp, lck, True, get_current_utok(conn)); 350 set_delete_on_close_lck(fsp, lck, True, 351 get_current_nttok(conn), 352 get_current_utok(conn)); 349 353 if (became_user) { 350 354 unbecome_user(); … … 399 403 fsp->update_write_time_on_close = false; 400 404 401 del_token = get_delete_on_close_token(lck, fsp->name_hash); 402 SMB_ASSERT(del_token != NULL); 405 got_tokens = get_delete_on_close_token(lck, fsp->name_hash, 406 &del_nt_token, &del_token); 407 SMB_ASSERT(got_tokens); 403 408 404 409 if (!unix_token_equal(del_token, get_current_utok(conn))) { … … 419 424 del_token->ngroups, 420 425 del_token->groups, 421 NULL);426 del_nt_token); 422 427 423 428 changed_user = true; … … 492 497 493 498 fsp->delete_on_close = false; 494 set_delete_on_close_lck(fsp, lck, false, NULL );499 set_delete_on_close_lck(fsp, lck, false, NULL, NULL); 495 500 496 501 done: … … 818 823 } 819 824 820 if(((errno == ENOTEMPTY)||(errno == EEXIST)) && lp_veto_files(SNUM(conn))) {825 if(((errno == ENOTEMPTY)||(errno == EEXIST)) && *lp_veto_files(SNUM(conn))) { 821 826 /* 822 827 * Check to see if the only thing in this directory are … … 963 968 NTSTATUS status = NT_STATUS_OK; 964 969 NTSTATUS status1 = NT_STATUS_OK; 970 const struct security_token *del_nt_token = NULL; 965 971 const struct security_unix_token *del_token = NULL; 966 972 … … 999 1005 fsp->fsp_name->base_name); 1000 1006 set_delete_on_close_lck(fsp, lck, true, 1007 get_current_nttok(fsp->conn), 1001 1008 get_current_utok(fsp->conn)); 1002 1009 fsp->delete_on_close = true; … … 1006 1013 } 1007 1014 1008 del _token = get_delete_on_close_token(lck, fsp->name_hash);1009 delete_dir = (del_token != NULL);1015 delete_dir = get_delete_on_close_token(lck, fsp->name_hash, 1016 &del_nt_token, &del_token); 1010 1017 1011 1018 if (delete_dir) { … … 1039 1046 del_token->ngroups, 1040 1047 del_token->groups, 1041 NULL);1048 del_nt_token); 1042 1049 1043 1050 TALLOC_FREE(lck); 1051 1052 if ((fsp->conn->fs_capabilities & FILE_NAMED_STREAMS) 1053 && !is_ntfs_stream_smb_fname(fsp->fsp_name)) { 1054 1055 status = delete_all_streams(fsp->conn, fsp->fsp_name->base_name); 1056 if (!NT_STATUS_IS_OK(status)) { 1057 DEBUG(5, ("delete_all_streams failed: %s\n", 1058 nt_errstr(status))); 1059 goto out; 1060 } 1061 } 1044 1062 1045 1063 status = rmdir_internals(talloc_tos(), fsp);
Note:
See TracChangeset
for help on using the changeset viewer.