Changeset 988 for vendor/current/source4/ntvfs/posix
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/source4/ntvfs/posix
- Files:
-
- 3 added
- 1 deleted
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/ntvfs/posix/pvfs_acl.c
r740 r988 21 21 22 22 #include "includes.h" 23 #include "system/passwd.h" 23 24 #include "auth/auth.h" 24 25 #include "vfs_posix.h" … … 27 28 #include "param/param.h" 28 29 #include "../lib/util/unix_privs.h" 29 30 #if defined(UID_WRAPPER) 31 #if !defined(UID_WRAPPER_REPLACE) && !defined(UID_WRAPPER_NOT_REPLACE) 32 #define UID_WRAPPER_REPLACE 33 #include "../uid_wrapper/uid_wrapper.h" 34 #endif 35 #else 36 #define uwrap_enabled() 0 37 #endif 30 #include "lib/util/samba_modules.h" 38 31 39 32 /* the list of currently registered ACL backends */ … … 90 83 } 91 84 92 NTSTATUS pvfs_acl_init( struct loadparm_context *lp_ctx)85 NTSTATUS pvfs_acl_init(void) 93 86 { 94 87 static bool initialized = false; … … 101 94 initialized = true; 102 95 103 shared_init = load_samba_modules(NULL, lp_ctx,"pvfs_acl");96 shared_init = load_samba_modules(NULL, "pvfs_acl"); 104 97 105 98 run_init_functions(static_init); … … 159 152 mode_t mode; 160 153 struct id_map *ids; 161 struct composite_context *ctx;162 154 163 155 *psd = security_descriptor_initialise(req); … … 178 170 ids[1].sid = NULL; 179 171 180 ctx = wbc_xids_to_sids_send(pvfs->wbc_ctx, ids, 2, ids); 181 NT_STATUS_HAVE_NO_MEMORY(ctx); 182 183 status = wbc_xids_to_sids_recv(ctx, &ids); 172 status = wbc_xids_to_sids(pvfs->ntvfs->ctx->event_ctx, ids, 2); 184 173 NT_STATUS_NOT_OK_RETURN(status); 185 174 … … 276 265 sd->sacl = NULL; 277 266 } 267 } 268 269 static bool pvfs_privileged_access(uid_t uid) 270 { 271 uid_t euid; 272 273 if (uid_wrapper_enabled()) { 274 setenv("UID_WRAPPER_MYUID", "1", 1); 275 } 276 277 euid = geteuid(); 278 279 if (uid_wrapper_enabled()) { 280 unsetenv("UID_WRAPPER_MYUID"); 281 } 282 283 return (uid == euid); 278 284 } 279 285 … … 295 301 gid_t new_gid = -1; 296 302 struct id_map *ids; 297 struct composite_context *ctx;298 303 299 304 if (pvfs->acl_ops != NULL) { … … 326 331 if (!dom_sid_equal(sd->owner_sid, new_sd->owner_sid)) { 327 332 ids->sid = new_sd->owner_sid; 328 ctx = wbc_sids_to_xids_send(pvfs->wbc_ctx, ids, 1, ids); 329 NT_STATUS_HAVE_NO_MEMORY(ctx); 330 status = wbc_sids_to_xids_recv(ctx, &ids); 333 status = wbc_sids_to_xids(pvfs->ntvfs->ctx->event_ctx, 334 ids, 1); 331 335 NT_STATUS_NOT_OK_RETURN(status); 332 336 … … 338 342 sd->owner_sid = new_sd->owner_sid; 339 343 } 344 340 345 if (secinfo_flags & SECINFO_GROUP) { 341 346 if (!(access_mask & SEC_STD_WRITE_OWNER)) { … … 344 349 if (!dom_sid_equal(sd->group_sid, new_sd->group_sid)) { 345 350 ids->sid = new_sd->group_sid; 346 ctx = wbc_sids_to_xids_send(pvfs->wbc_ctx, ids, 1, ids); 347 NT_STATUS_HAVE_NO_MEMORY(ctx); 348 status = wbc_sids_to_xids_recv(ctx, &ids); 351 status = wbc_sids_to_xids(pvfs->ntvfs->ctx->event_ctx, 352 ids, 1); 349 353 NT_STATUS_NOT_OK_RETURN(status); 350 354 … … 357 361 sd->group_sid = new_sd->group_sid; 358 362 } 363 359 364 if (secinfo_flags & SECINFO_DACL) { 360 365 if (!(access_mask & SEC_STD_WRITE_DAC)) { … … 363 368 sd->dacl = new_sd->dacl; 364 369 pvfs_translate_generic_bits(sd->dacl); 365 } 370 sd->type |= SEC_DESC_DACL_PRESENT; 371 } 372 366 373 if (secinfo_flags & SECINFO_SACL) { 367 374 if (!(access_mask & SEC_FLAG_SYSTEM_SECURITY)) { … … 370 377 sd->sacl = new_sd->sacl; 371 378 pvfs_translate_generic_bits(sd->sacl); 379 sd->type |= SEC_DESC_SACL_PRESENT; 380 } 381 382 if (secinfo_flags & SECINFO_PROTECTED_DACL) { 383 if (new_sd->type & SEC_DESC_DACL_PROTECTED) { 384 sd->type |= SEC_DESC_DACL_PROTECTED; 385 } else { 386 sd->type &= ~SEC_DESC_DACL_PROTECTED; 387 } 388 } 389 390 if (secinfo_flags & SECINFO_PROTECTED_SACL) { 391 if (new_sd->type & SEC_DESC_SACL_PROTECTED) { 392 sd->type |= SEC_DESC_SACL_PROTECTED; 393 } else { 394 sd->type &= ~SEC_DESC_SACL_PROTECTED; 395 } 372 396 } 373 397 … … 389 413 } 390 414 if (errno == EPERM) { 391 if ( uwrap_enabled()) {415 if (pvfs_privileged_access(name->st.st_uid)) { 392 416 ret = 0; 393 417 } else { … … 484 508 } 485 509 ngroups = getgroups(0, NULL); 486 if (ngroups == 0) {510 if (ngroups <= 0) { 487 511 return false; 488 512 } … … 515 539 uint32_t *access_mask) 516 540 { 517 uid_t uid = geteuid(); 518 uint32_t max_bits = SEC_RIGHTS_FILE_READ | SEC_FILE_ALL; 541 uint32_t max_bits = 0; 519 542 struct security_token *token = req->session_info->security_token; 520 543 … … 523 546 } 524 547 525 if (name == NULL || uid == name->st.st_uid) { 526 max_bits |= SEC_STD_ALL; 527 } else if (security_token_has_privilege(token, SEC_PRIV_RESTORE)) { 528 max_bits |= SEC_STD_DELETE; 529 } 530 531 if (name == NULL || 532 (name->st.st_mode & S_IWOTH) || 533 ((name->st.st_mode & S_IWGRP) && 534 pvfs_group_member(pvfs, name->st.st_gid))) { 535 max_bits |= SEC_STD_ALL; 536 } 537 538 if (uwrap_enabled()) { 539 /* when running with the uid wrapper, files will be created 540 owned by the ruid, but we may have a different simulated 541 euid. We need to force the permission bits as though the 542 files owner matches the euid */ 543 max_bits |= SEC_STD_ALL; 548 if (name == NULL) { 549 max_bits |= SEC_RIGHTS_FILE_ALL | SEC_STD_ALL; 550 } else if (pvfs_privileged_access(name->st.st_uid)) { 551 /* use the IxUSR bits */ 552 if ((name->st.st_mode & S_IWUSR)) { 553 max_bits |= SEC_RIGHTS_FILE_ALL | SEC_STD_ALL; 554 } else if ((name->st.st_mode & (S_IRUSR | S_IXUSR))) { 555 max_bits |= SEC_RIGHTS_FILE_READ | SEC_RIGHTS_FILE_EXECUTE | SEC_STD_ALL; 556 } 557 } else if (pvfs_group_member(pvfs, name->st.st_gid)) { 558 /* use the IxGRP bits */ 559 if ((name->st.st_mode & S_IWGRP)) { 560 max_bits |= SEC_RIGHTS_FILE_ALL | SEC_STD_ALL; 561 } else if ((name->st.st_mode & (S_IRGRP | S_IXGRP))) { 562 max_bits |= SEC_RIGHTS_FILE_READ | SEC_RIGHTS_FILE_EXECUTE | SEC_STD_ALL; 563 } 564 } else { 565 /* use the IxOTH bits */ 566 if ((name->st.st_mode & S_IWOTH)) { 567 max_bits |= SEC_RIGHTS_FILE_ALL | SEC_STD_ALL; 568 } else if ((name->st.st_mode & (S_IROTH | S_IXOTH))) { 569 max_bits |= SEC_RIGHTS_FILE_READ | SEC_RIGHTS_FILE_EXECUTE | SEC_STD_ALL; 570 } 544 571 } 545 572 … … 564 591 565 592 if (*access_mask & ~max_bits) { 566 DEBUG( 0,(__location__ " denied access to '%s' - wanted 0x%08x but got 0x%08x (missing 0x%08x)\n",593 DEBUG(5,(__location__ " denied access to '%s' - wanted 0x%08x but got 0x%08x (missing 0x%08x)\n", 567 594 name?name->full_name:"(new file)", *access_mask, max_bits, *access_mask & ~max_bits)); 568 595 return NT_STATUS_ACCESS_DENIED; 569 596 } 570 597 571 if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {598 if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) { 572 599 /* on SMB, this bit is always granted, even if not 573 600 asked for */ … … 596 623 597 624 /* on SMB2 a blank access mask is always denied */ 598 if (pvfs->ntvfs->ctx->protocol == PROTOCOL_SMB2 &&625 if (pvfs->ntvfs->ctx->protocol >= PROTOCOL_SMB2_02 && 599 626 *access_mask == 0) { 600 627 return NT_STATUS_ACCESS_DENIED; … … 622 649 /* expand the generic access bits to file specific bits */ 623 650 *access_mask = pvfs_translate_mask(*access_mask); 624 if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {651 if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) { 625 652 *access_mask &= ~SEC_FILE_READ_ATTRIBUTE; 626 653 } … … 647 674 status = se_access_check(sd, token, *access_mask, access_mask); 648 675 talloc_free(acl); 676 677 /* if we used a NT acl, then allow access override if the 678 share allows for posix permission override 679 */ 680 if (NT_STATUS_IS_OK(status)) { 681 name->allow_override = (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE) != 0; 682 } 683 649 684 done: 650 if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {685 if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) { 651 686 /* on SMB, this bit is always granted, even if not 652 687 asked for */ … … 746 781 } 747 782 748 if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {783 if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) { 749 784 /* on SMB, this bit is always granted, even if not 750 785 asked for */ … … 775 810 } 776 811 777 return pvfs_access_check_simple(pvfs, req, parent, access_mask); 812 status = pvfs_access_check_simple(pvfs, req, parent, access_mask); 813 if (NT_STATUS_IS_OK(status) && parent->allow_override) { 814 name->allow_override = true; 815 } 816 return status; 778 817 } 779 818 … … 899 938 struct security_descriptor *parent_sd, *sd; 900 939 struct id_map *ids; 901 struct composite_context *ctx;902 940 TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); 903 941 … … 905 943 906 944 acl = talloc(req, struct xattr_NTACL); 907 NT_STATUS_HAVE_NO_MEMORY_AND_FREE(acl, tmp_ctx); 945 if (acl == NULL) { 946 TALLOC_FREE(tmp_ctx); 947 return NT_STATUS_NO_MEMORY; 948 } 908 949 909 950 status = pvfs_acl_load(pvfs, parent, -1, acl); … … 912 953 return NT_STATUS_OK; 913 954 } 914 NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx); 955 if (!NT_STATUS_IS_OK(status)) { 956 TALLOC_FREE(tmp_ctx); 957 return status; 958 } 915 959 916 960 switch (acl->version) { … … 933 977 /* create the new sd */ 934 978 sd = security_descriptor_initialise(req); 935 NT_STATUS_HAVE_NO_MEMORY_AND_FREE(sd, tmp_ctx); 979 if (sd == NULL) { 980 TALLOC_FREE(tmp_ctx); 981 return NT_STATUS_NO_MEMORY; 982 } 936 983 937 984 ids = talloc_array(sd, struct id_map, 2); 938 NT_STATUS_HAVE_NO_MEMORY_AND_FREE(ids, tmp_ctx); 985 if (ids == NULL) { 986 TALLOC_FREE(tmp_ctx); 987 return NT_STATUS_NO_MEMORY; 988 } 939 989 940 990 ids[0].xid.id = geteuid(); … … 948 998 ids[1].status = ID_UNKNOWN; 949 999 950 ctx = wbc_xids_to_sids_send(pvfs->wbc_ctx, ids, 2, ids);951 NT_STATUS_HAVE_NO_MEMORY_AND_FREE(ctx, tmp_ctx);952 953 status = wbc_xids_to_sids_recv(ctx, &ids);954 NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx);1000 status = wbc_xids_to_sids(pvfs->ntvfs->ctx->event_ctx, ids, 2); 1001 if (!NT_STATUS_IS_OK(status)) { 1002 TALLOC_FREE(tmp_ctx); 1003 return status; 1004 } 955 1005 956 1006 sd->owner_sid = talloc_steal(sd, ids[0].sid); … … 961 1011 /* fill in the aces from the parent */ 962 1012 status = pvfs_acl_inherit_aces(pvfs, parent_sd, sd, container); 963 NT_STATUS_NOT_OK_RETURN_AND_FREE(status, tmp_ctx); 1013 if (!NT_STATUS_IS_OK(status)) { 1014 TALLOC_FREE(tmp_ctx); 1015 return status; 1016 } 964 1017 965 1018 /* if there is nothing to inherit then we fallback to the -
vendor/current/source4/ntvfs/posix/pvfs_acl_nfs4.c
r740 r988 27 27 #include "libcli/security/security.h" 28 28 29 NTSTATUS pvfs_acl_nfs4_init(void); 30 29 31 #define ACE4_IDENTIFIER_GROUP 0x40 30 32 … … 41 43 int i, num_ids; 42 44 struct id_map *ids; 43 struct composite_context *ctx;44 45 45 46 acl = talloc_zero(mem_ctx, struct nfs4acl); … … 90 91 /* Allocate memory for the sids from the security descriptor to be on 91 92 * the safe side. */ 92 ctx = wbc_xids_to_sids_send(pvfs->wbc_ctx, sd, num_ids, ids); 93 NT_STATUS_HAVE_NO_MEMORY(ctx); 94 status = wbc_xids_to_sids_recv(ctx, &ids); 93 status = wbc_xids_to_sids(pvfs->ntvfs->ctx->event_ctx, ids, num_ids); 95 94 NT_STATUS_NOT_OK_RETURN(status); 96 95 … … 123 122 TALLOC_CTX *tmp_ctx; 124 123 struct id_map *ids; 125 struct composite_context *ctx;126 124 127 125 tmp_ctx = talloc_new(pvfs); … … 158 156 } 159 157 160 ctx = wbc_sids_to_xids_send(pvfs->wbc_ctx,ids, acl.a_count, ids); 161 if (ctx == NULL) { 162 talloc_free(tmp_ctx); 163 return NT_STATUS_NO_MEMORY; 164 } 165 status = wbc_sids_to_xids_recv(ctx, &ids); 158 status = wbc_sids_to_xids(pvfs->ntvfs->ctx->event_ctx, ids, 159 acl.a_count); 166 160 if (!NT_STATUS_IS_OK(status)) { 167 161 talloc_free(tmp_ctx); -
vendor/current/source4/ntvfs/posix/pvfs_acl_xattr.c
r740 r988 24 24 #include "../lib/util/unix_privs.h" 25 25 #include "librpc/gen_ndr/ndr_xattr.h" 26 27 NTSTATUS pvfs_acl_xattr_init(void); 26 28 27 29 /* -
vendor/current/source4/ntvfs/posix/pvfs_dirlist.c
r414 r988 200 200 (*ofs) = DIR_OFFSET_DOTDOT; 201 201 dir->offset = *ofs; 202 if (ms_fnmatch (dir->pattern, ".", protocol) == 0) {202 if (ms_fnmatch_protocol(dir->pattern, ".", protocol) == 0) { 203 203 dcache_add(dir, "."); 204 204 return "."; … … 209 209 (*ofs) = DIR_OFFSET_BASE; 210 210 dir->offset = *ofs; 211 if (ms_fnmatch (dir->pattern, "..", protocol) == 0) {211 if (ms_fnmatch_protocol(dir->pattern, "..", protocol) == 0) { 212 212 dcache_add(dir, ".."); 213 213 return ".."; … … 229 229 } 230 230 231 if (ms_fnmatch (dir->pattern, dname, protocol) != 0) {231 if (ms_fnmatch_protocol(dir->pattern, dname, protocol) != 0) { 232 232 char *short_name = pvfs_short_name_component(dir->pvfs, dname); 233 233 if (short_name == NULL || 234 ms_fnmatch (dir->pattern, short_name, protocol) != 0) {234 ms_fnmatch_protocol(dir->pattern, short_name, protocol) != 0) { 235 235 talloc_free(short_name); 236 236 continue; -
vendor/current/source4/ntvfs/posix/pvfs_fileinfo.c
r740 r988 82 82 name->dos.alloc_size = pvfs_round_alloc_size(pvfs, name->st.st_size); 83 83 name->dos.nlink = name->st.st_nlink; 84 name->dos.ea_size = 4; 85 if (pvfs->ntvfs->ctx->protocol == PROTOCOL_SMB2) {84 name->dos.ea_size = 4; /* TODO: Fill this in without hitting the stream bad in pvfs_doseas_load() */ 85 if (pvfs->ntvfs->ctx->protocol >= PROTOCOL_SMB2_02) { 86 86 /* SMB2 represents a null EA with zero bytes */ 87 87 name->dos.ea_size = 0; -
vendor/current/source4/ntvfs/posix/pvfs_fsinfo.c
r740 r988 202 202 return NT_STATUS_OK; 203 203 204 case RAW_QFS_SECTOR_SIZE_INFORMATION: 205 fs->sector_size_info.out.logical_bytes_per_sector = block_size; 206 fs->sector_size_info.out.phys_bytes_per_sector_atomic 207 = block_size; 208 fs->sector_size_info.out.phys_bytes_per_sector_perf 209 = block_size; 210 fs->sector_size_info.out.fs_effective_phys_bytes_per_sector_atomic 211 = block_size; 212 fs->sector_size_info.out.flags 213 = QFS_SSINFO_FLAGS_ALIGNED_DEVICE 214 | QFS_SSINFO_FLAGS_PARTITION_ALIGNED_ON_DEVICE; 215 fs->sector_size_info.out.byte_off_sector_align = 0; 216 fs->sector_size_info.out.byte_off_partition_align = 0; 217 return NT_STATUS_OK; 218 204 219 default: 205 220 break; -
vendor/current/source4/ntvfs/posix/pvfs_ioctl.c
r414 r988 22 22 #include "includes.h" 23 23 #include "vfs_posix.h" 24 #include " libcli/raw/ioctl.h"24 #include "../libcli/smb/smb_constants.h" 25 25 26 26 /* -
vendor/current/source4/ntvfs/posix/pvfs_lock.c
r740 r988 40 40 } 41 41 42 return brl _locktest(pvfs->brl_context,42 return brlock_locktest(pvfs->brl_context, 43 43 f->brl_handle, 44 44 smbpid, … … 71 71 /* undo the locks we just did */ 72 72 for (i--;i>=0;i--) { 73 brl _unlock(pvfs->brl_context,73 brlock_unlock(pvfs->brl_context, 74 74 f->brl_handle, 75 75 locks[i].pid, … … 117 117 /* we don't retry on a cancel */ 118 118 if (reason == PVFS_WAIT_CANCEL) { 119 if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {119 if (pvfs->ntvfs->ctx->protocol < PROTOCOL_SMB2_02) { 120 120 status = NT_STATUS_FILE_LOCK_CONFLICT; 121 121 } else { … … 128 128 * FILE_LOCK_CONFLICT in the error case 129 129 */ 130 status = brl _lock(pvfs->brl_context,130 status = brlock_lock(pvfs->brl_context, 131 131 f->brl_handle, 132 132 locks[pending->pending_lock].pid, … … 144 144 if (NT_STATUS_IS_OK(status) || timed_out) { 145 145 NTSTATUS status2; 146 status2 = brl _remove_pending(pvfs->brl_context,146 status2 = brlock_remove_pending(pvfs->brl_context, 147 147 f->brl_handle, pending); 148 148 if (!NT_STATUS_IS_OK(status2)) { … … 178 178 } 179 179 180 status = brl _lock(pvfs->brl_context,180 status = brlock_lock(pvfs->brl_context, 181 181 f->brl_handle, 182 182 locks[i].pid, … … 226 226 DEBUG(5,("pvfs_lock: removing %.0f locks on close\n", 227 227 (double)f->lock_count)); 228 brl _close(f->pvfs->brl_context, f->brl_handle);228 brlock_close(f->pvfs->brl_context, f->brl_handle); 229 229 f->lock_count = 0; 230 230 } … … 325 325 326 326 pending->end_time = 327 timeval_current_ofs(lck->lockx.in.timeout/1000, 328 1000*(lck->lockx.in.timeout%1000)); 327 timeval_current_ofs_msec(lck->lockx.in.timeout); 329 328 } 330 329 … … 351 350 352 351 for (i=0;i<lck->lockx.in.ulock_cnt;i++) { 353 status = brl _unlock(pvfs->brl_context,352 status = brlock_unlock(pvfs->brl_context, 354 353 f->brl_handle, 355 354 locks[i].pid, … … 370 369 } 371 370 372 status = brl _lock(pvfs->brl_context,371 status = brlock_lock(pvfs->brl_context, 373 372 f->brl_handle, 374 373 locks[i].pid, … … 395 394 /* undo the locks we just did */ 396 395 for (i--;i>=0;i--) { 397 brl _unlock(pvfs->brl_context,396 brlock_unlock(pvfs->brl_context, 398 397 f->brl_handle, 399 398 locks[i].pid, -
vendor/current/source4/ntvfs/posix/pvfs_mkdir.c
r740 r988 52 52 mode = pvfs_fileperms(pvfs, FILE_ATTRIBUTE_DIRECTORY); 53 53 54 if (pvfs_sys_mkdir(pvfs, name->full_name, mode ) == -1) {54 if (pvfs_sys_mkdir(pvfs, name->full_name, mode, name->allow_override) == -1) { 55 55 return pvfs_map_errno(pvfs, errno); 56 56 } … … 70 70 status = pvfs_acl_inherit(pvfs, req, name, -1); 71 71 if (!NT_STATUS_IS_OK(status)) { 72 pvfs_sys_rmdir(pvfs, name->full_name );72 pvfs_sys_rmdir(pvfs, name->full_name, name->allow_override); 73 73 return status; 74 74 } … … 79 79 md->t2mkdir.in.eas); 80 80 if (!NT_STATUS_IS_OK(status)) { 81 pvfs_sys_rmdir(pvfs, name->full_name );81 pvfs_sys_rmdir(pvfs, name->full_name, name->allow_override); 82 82 return status; 83 83 } … … 128 128 mode = pvfs_fileperms(pvfs, FILE_ATTRIBUTE_DIRECTORY); 129 129 130 if (pvfs_sys_mkdir(pvfs, name->full_name, mode ) == -1) {130 if (pvfs_sys_mkdir(pvfs, name->full_name, mode, name->allow_override) == -1) { 131 131 return pvfs_map_errno(pvfs, errno); 132 132 } … … 137 137 status = pvfs_acl_inherit(pvfs, req, name, -1); 138 138 if (!NT_STATUS_IS_OK(status)) { 139 pvfs_sys_rmdir(pvfs, name->full_name );139 pvfs_sys_rmdir(pvfs, name->full_name, name->allow_override); 140 140 return status; 141 141 } … … 180 180 } 181 181 182 if (pvfs_sys_rmdir(pvfs, name->full_name ) == -1) {182 if (pvfs_sys_rmdir(pvfs, name->full_name, name->allow_override) == -1) { 183 183 /* some olders systems don't return ENOTEMPTY to rmdir() */ 184 184 if (errno == EEXIST) { -
vendor/current/source4/ntvfs/posix/pvfs_notify.c
r740 r988 110 110 would free the request, and the ntvfs modules above us 111 111 could use it, so call it on the next event */ 112 event_add_timed(req->ctx->event_ctx,112 tevent_add_timer(req->ctx->event_ctx, 113 113 req, timeval_zero(), pvfs_notify_send_next, req); 114 114 } … … 279 279 pending->info = info; 280 280 281 DLIST_ADD_END(f->notify_buffer->pending, pending , struct notify_pending *);281 DLIST_ADD_END(f->notify_buffer->pending, pending); 282 282 283 283 /* if the buffer is empty then start waiting */ -
vendor/current/source4/ntvfs/posix/pvfs_open.c
r740 r988 74 74 delete_path, nt_errstr(status))); 75 75 } 76 if (pvfs_sys_rmdir(h->pvfs, delete_path ) != 0) {76 if (pvfs_sys_rmdir(h->pvfs, delete_path, h->name->allow_override) != 0) { 77 77 DEBUG(0,("pvfs_dir_handle_destructor: failed to rmdir '%s' - %s\n", 78 78 delete_path, strerror(errno))); … … 345 345 mode_t mode = pvfs_fileperms(pvfs, attrib); 346 346 347 if (pvfs_sys_mkdir(pvfs, name->full_name, mode ) == -1) {347 if (pvfs_sys_mkdir(pvfs, name->full_name, mode, name->allow_override) == -1) { 348 348 return pvfs_map_errno(pvfs,errno); 349 349 } … … 433 433 434 434 cleanup_delete: 435 pvfs_sys_rmdir(pvfs, name->full_name );435 pvfs_sys_rmdir(pvfs, name->full_name, name->allow_override); 436 436 return status; 437 437 } … … 515 515 delete_path, nt_errstr(status))); 516 516 } 517 if (pvfs_sys_unlink(h->pvfs, delete_path ) != 0) {517 if (pvfs_sys_unlink(h->pvfs, delete_path, h->name->allow_override) != 0) { 518 518 DEBUG(0,("pvfs_close: failed to delete '%s' - %s\n", 519 519 delete_path, strerror(errno))); … … 591 591 } 592 592 593 h = brl _create_handle(mem_ctx, ntvfs, &key);593 h = brlock_create_handle(mem_ctx, ntvfs, &key); 594 594 NT_STATUS_HAVE_NO_MEMORY(h); 595 595 … … 678 678 679 679 /* create the file */ 680 fd = pvfs_sys_open(pvfs, name->full_name, flags | O_CREAT | O_EXCL| O_NONBLOCK, mode );680 fd = pvfs_sys_open(pvfs, name->full_name, flags | O_CREAT | O_EXCL| O_NONBLOCK, mode, name->allow_override); 681 681 if (fd == -1) { 682 682 return pvfs_map_errno(pvfs, errno); … … 718 718 status = pvfs_access_maximal_allowed(pvfs, req, name, 719 719 &io->generic.out.maximal_access); 720 NT_STATUS_NOT_OK_RETURN(status); 720 if (!NT_STATUS_IS_OK(status)) { 721 goto cleanup_delete; 722 } 721 723 } 722 724 … … 857 859 cleanup_delete: 858 860 close(fd); 859 pvfs_sys_unlink(pvfs, name->full_name );861 pvfs_sys_unlink(pvfs, name->full_name, name->allow_override); 860 862 return status; 861 863 } … … 1175 1177 pvfs->oplock_break_timeout, 1176 1178 0); 1177 end_time = timeval_current_ofs (0,(pvfs->sharing_violation_delay*4)/5);1179 end_time = timeval_current_ofs_usec((pvfs->sharing_violation_delay*4)/5); 1178 1180 end_time = timeval_min(final_timeout, &end_time); 1179 1181 } else { … … 1285 1287 1286 1288 /* what does this bit really mean?? */ 1287 if (req->ctx->protocol == PROTOCOL_SMB2 &&1289 if (req->ctx->protocol >= PROTOCOL_SMB2_02 && 1288 1290 access_mask == SEC_STD_SYNCHRONIZE) { 1289 1291 return NT_STATUS_ACCESS_DENIED; … … 1503 1505 */ 1504 1506 if (create_options & NTCREATEX_OPTIONS_DELETE_ON_CLOSE && 1505 req->ctx->protocol == PROTOCOL_SMB2) {1507 req->ctx->protocol >= PROTOCOL_SMB2_02) { 1506 1508 del_on_close = true; 1507 1509 } else { … … 1550 1552 1551 1553 /* do the actual open */ 1552 fd = pvfs_sys_open(pvfs, f->handle->name->full_name, flags | O_NONBLOCK, 0 );1554 fd = pvfs_sys_open(pvfs, f->handle->name->full_name, flags | O_NONBLOCK, 0, name->allow_override); 1553 1555 if (fd == -1) { 1554 1556 status = pvfs_map_errno(f->pvfs, errno); … … 1570 1572 f->handle->fd = fd; 1571 1573 1572 status = brl _count(f->pvfs->brl_context, f->brl_handle, &count);1574 status = brlock_count(f->pvfs->brl_context, f->brl_handle, &count); 1573 1575 if (!NT_STATUS_IS_OK(status)) { 1574 1576 talloc_free(lck); … … 1636 1638 if (f->handle->name->st.st_mode != mode && 1637 1639 f->handle->name->dos.attrib != attrib && 1638 pvfs_sys_fchmod(pvfs, fd, mode ) == -1) {1640 pvfs_sys_fchmod(pvfs, fd, mode, name->allow_override) == -1) { 1639 1641 talloc_free(lck); 1640 1642 return pvfs_map_errno(pvfs, errno); -
vendor/current/source4/ntvfs/posix/pvfs_oplock.c
r414 r988 33 33 struct timeval break_to_level_II; 34 34 struct timeval break_to_none; 35 struct messaging_context *msg_ctx;35 struct imessaging_context *msg_ctx; 36 36 }; 37 37 … … 159 159 } 160 160 161 static void pvfs_oplock_break_dispatch(struct messaging_context *msg,161 static void pvfs_oplock_break_dispatch(struct imessaging_context *msg, 162 162 void *private_data, uint32_t msg_type, 163 163 struct server_id src, DATA_BLOB *data) … … 170 170 171 171 /* we need to check that this one is for us. See 172 messaging_send_ptr() for the other side of this.172 imessaging_send_ptr() for the other side of this. 173 173 */ 174 174 if (data->length == sizeof(struct opendb_oplock_break)) { … … 193 193 static int pvfs_oplock_destructor(struct pvfs_oplock *opl) 194 194 { 195 messaging_deregister(opl->msg_ctx, MSG_NTVFS_OPLOCK_BREAK, opl);195 imessaging_deregister(opl->msg_ctx, MSG_NTVFS_OPLOCK_BREAK, opl); 196 196 return 0; 197 197 } … … 229 229 opl->msg_ctx = f->pvfs->ntvfs->ctx->msg_ctx; 230 230 231 status = messaging_register(opl->msg_ctx,231 status = imessaging_register(opl->msg_ctx, 232 232 opl, 233 233 MSG_NTVFS_OPLOCK_BREAK, -
vendor/current/source4/ntvfs/posix/pvfs_qfileinfo.c
r740 r988 103 103 if (strcasecmp_m(eas->eas[i].name.s, 104 104 ealist->eas[j].name) == 0) { 105 if (ealist->eas[j].value.length == 0) { 106 continue; 107 } 105 108 eas->eas[i].value = ealist->eas[j].value; 106 109 break; … … 135 138 eas->eas[eas->num_eas].flags = 0; 136 139 eas->eas[eas->num_eas].name.s = ealist->eas[i].name; 140 if (ealist->eas[i].value.length == 0) { 141 continue; 142 } 137 143 eas->eas[eas->num_eas].value = ealist->eas[i].value; 138 144 eas->num_eas++; … … 150 156 { 151 157 switch (info->generic.level) { 152 case RAW_FILEINFO_GENERIC:153 return NT_STATUS_INVALID_LEVEL;154 155 158 case RAW_FILEINFO_GETATTR: 156 159 info->getattr.out.attrib = name->dos.attrib; … … 226 229 case RAW_FILEINFO_NAME_INFO: 227 230 case RAW_FILEINFO_NAME_INFORMATION: 228 if (req->ctx->protocol == PROTOCOL_SMB2) {231 if (req->ctx->protocol >= PROTOCOL_SMB2_02) { 229 232 /* strange that SMB2 doesn't have this */ 230 233 return NT_STATUS_NOT_SUPPORTED; … … 334 337 NT_STATUS_HAVE_NO_MEMORY(info->all_info2.out.fname.s); 335 338 return NT_STATUS_OK; 339 340 case RAW_FILEINFO_GENERIC: 341 case RAW_FILEINFO_UNIX_BASIC: 342 case RAW_FILEINFO_UNIX_INFO2: 343 case RAW_FILEINFO_UNIX_LINK: 344 return NT_STATUS_INVALID_LEVEL; 336 345 } 337 346 -
vendor/current/source4/ntvfs/posix/pvfs_read.c
r740 r988 60 60 61 61 maxcnt = rd->readx.in.maxcnt; 62 if (maxcnt > 2*UINT16_MAX && req->ctx->protocol < PROTOCOL_SMB2 ) {62 if (maxcnt > 2*UINT16_MAX && req->ctx->protocol < PROTOCOL_SMB2_02) { 63 63 DEBUG(3,(__location__ ": Invalid SMB maxcnt 0x%x\n", maxcnt)); 64 64 return NT_STATUS_INVALID_PARAMETER; … … 97 97 98 98 /* only SMB2 honors mincnt */ 99 if (req->ctx->protocol == PROTOCOL_SMB2) {99 if (req->ctx->protocol >= PROTOCOL_SMB2_02) { 100 100 if (rd->readx.in.mincnt > ret || 101 101 (ret == 0 && maxcnt > 0)) { -
vendor/current/source4/ntvfs/posix/pvfs_rename.c
r740 r988 38 38 NTSTATUS status; 39 39 40 if (pvfs_sys_rename(pvfs, name1->full_name, name2) == -1) { 40 if (pvfs_sys_rename(pvfs, name1->full_name, name2, 41 name1->allow_override) == -1) { 41 42 return pvfs_map_errno(pvfs, errno); 42 43 } … … 625 626 status = pvfs_access_check_parent(pvfs, req, name2, SEC_DIR_ADD_FILE); 626 627 NT_STATUS_NOT_OK_RETURN(status); 627 return pvfs_copy_file(pvfs, name1, name2 );628 return pvfs_copy_file(pvfs, name1, name2, name1->allow_override && name2->allow_override); 628 629 629 630 case RENAME_FLAG_MOVE_CLUSTER_INFORMATION: -
vendor/current/source4/ntvfs/posix/pvfs_resolve.c
r740 r988 519 519 (*name)->exists = false; 520 520 (*name)->stream_exists = false; 521 (*name)->allow_override = false; 521 522 522 523 if (!(pvfs->fs_attribs & FS_ATTR_NAMED_STREAMS)) { … … 525 526 526 527 /* SMB2 doesn't allow a leading slash */ 527 if (req->ctx->protocol == PROTOCOL_SMB2 &&528 if (req->ctx->protocol >= PROTOCOL_SMB2_02 && 528 529 *cifs_name == '\\') { 529 530 return NT_STATUS_INVALID_PARAMETER; … … 631 632 (*name)->stream_name = NULL; 632 633 (*name)->stream_id = 0; 634 (*name)->allow_override = false; 633 635 634 636 status = pvfs_fill_dos_info(pvfs, *name, flags, -1); … … 693 695 if (h->have_opendb_entry) { 694 696 struct odb_lock *lck; 695 c har *name = NULL;697 const char *name = NULL; 696 698 697 699 lck = odb_lock(h, h->pvfs->odb_context, &h->odb_locking_key); … … 704 706 } 705 707 706 status = odb_get_path(lck, (const char **)&name);708 status = odb_get_path(lck, &name); 707 709 if (NT_STATUS_IS_OK(status)) { 708 710 /* … … 718 720 char *new_orig; 719 721 char *delim; 722 char *full_name = discard_const_p(char, name); 720 723 721 724 delim = strrchr(name, '/'); … … 746 749 talloc_free(h->name->original_name); 747 750 talloc_free(h->name->full_name); 748 h->name->full_name = talloc_steal(h->name, name);751 h->name->full_name = talloc_steal(h->name, full_name); 749 752 h->name->original_name = new_orig; 750 753 } … … 816 819 (*name)->stream_name = NULL; 817 820 (*name)->stream_id = 0; 821 (*name)->allow_override = false; 818 822 819 823 status = pvfs_fill_dos_info(pvfs, *name, PVFS_RESOLVE_NO_OPENDB, -1); -
vendor/current/source4/ntvfs/posix/pvfs_search.c
r740 r988 62 62 if (search->handle == INVALID_SEARCH_HANDLE) return; 63 63 talloc_free(search->te); 64 search->te = event_add_timed(ev, search,64 search->te = tevent_add_timer(ev, search, 65 65 timeval_current_ofs(search->pvfs->search.inactivity_time, 0), 66 66 pvfs_search_timer, search); … … 222 222 223 223 case RAW_SEARCH_DATA_GENERIC: 224 break; 224 case RAW_SEARCH_DATA_UNIX_INFO: 225 case RAW_SEARCH_DATA_UNIX_INFO2: 226 return NT_STATUS_INVALID_LEVEL; 225 227 } 226 228 -
vendor/current/source4/ntvfs/posix/pvfs_setfileinfo.c
r740 r988 131 131 /* renames are only allowed within a directory */ 132 132 if (strchr_m(info->rename_information.in.new_name, '\\') && 133 (req->ctx->protocol != PROTOCOL_SMB2)) {133 (req->ctx->protocol < PROTOCOL_SMB2_02)) { 134 134 return NT_STATUS_NOT_SUPPORTED; 135 135 } … … 144 144 but I suspect it is just uninitialised memory */ 145 145 if (info->rename_information.in.root_fid != 0 && 146 (req->ctx->protocol != PROTOCOL_SMB2)) {146 (req->ctx->protocol < PROTOCOL_SMB2_02)) { 147 147 return NT_STATUS_INVALID_PARAMETER; 148 148 } 149 149 150 150 /* construct the fully qualified windows name for the new file name */ 151 if (req->ctx->protocol == PROTOCOL_SMB2) {151 if (req->ctx->protocol >= PROTOCOL_SMB2_02) { 152 152 /* SMB2 sends the full path of the new name */ 153 153 new_name = talloc_asprintf(req, "\\%s", info->rename_information.in.new_name); … … 368 368 369 369 case RAW_SFILEINFO_EA_SET: 370 return pvfs_setfileinfo_ea_set(pvfs, h->name, h->fd, 370 return pvfs_setfileinfo_ea_set(pvfs, h->name, h->fd, 371 371 info->ea_set.in.num_eas, 372 372 info->ea_set.in.eas); … … 420 420 h->position = info->position_information.in.position; 421 421 break; 422 423 case RAW_SFILEINFO_FULL_EA_INFORMATION: 424 return pvfs_setfileinfo_ea_set(pvfs, h->name, h->fd, 425 info->full_ea_information.in.eas.num_eas, 426 info->full_ea_information.in.eas.eas); 422 427 423 428 case RAW_SFILEINFO_MODE_INFORMATION: … … 535 540 mode = pvfs_fileperms(pvfs, newstats.dos.attrib); 536 541 if (!(h->name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY)) { 537 if (pvfs_sys_fchmod(pvfs, h->fd, mode ) == -1) {542 if (pvfs_sys_fchmod(pvfs, h->fd, mode, h->name->allow_override) == -1) { 538 543 return pvfs_map_errno(pvfs, errno); 539 544 } … … 860 865 if (newstats.dos.attrib != name->dos.attrib) { 861 866 mode_t mode = pvfs_fileperms(pvfs, newstats.dos.attrib); 862 if (pvfs_sys_chmod(pvfs, name->full_name, mode ) == -1) {867 if (pvfs_sys_chmod(pvfs, name->full_name, mode, name->allow_override) == -1) { 863 868 return pvfs_map_errno(pvfs, errno); 864 869 } -
vendor/current/source4/ntvfs/posix/pvfs_sys.c
r740 r988 197 197 return NULL; 198 198 } 199 199 200 ctx->old_wd = talloc_strdup(ctx, cwd); 201 free(cwd); 202 200 203 if (ctx->old_wd == NULL) { 201 free(cwd);202 204 talloc_free(ctx); 203 205 return NULL; … … 257 259 wrap open for system override 258 260 */ 259 int pvfs_sys_open(struct pvfs_state *pvfs, const char *filename, int flags, mode_t mode )261 int pvfs_sys_open(struct pvfs_state *pvfs, const char *filename, int flags, mode_t mode, bool allow_override) 260 262 { 261 263 int fd, ret; … … 268 270 fd = open(filename, flags, mode); 269 271 if (fd != -1 || 270 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||272 !allow_override || 271 273 errno != EACCES) { 272 274 return fd; … … 367 369 wrap unlink for system override 368 370 */ 369 int pvfs_sys_unlink(struct pvfs_state *pvfs, const char *filename )371 int pvfs_sys_unlink(struct pvfs_state *pvfs, const char *filename, bool allow_override) 370 372 { 371 373 int ret; … … 377 379 ret = unlink(filename); 378 380 if (ret != -1 || 379 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||381 !allow_override || 380 382 errno != EACCES) { 381 383 return ret; … … 406 408 { 407 409 int fd = open(path, PVFS_NOFOLLOW | O_RDONLY); 410 int posix_errno = errno; 408 411 if (fd != -1) { 409 412 close(fd); 410 413 return false; 411 414 } 412 return (errno == ELOOP); 415 416 #if defined(ENOTSUP) && defined(OSF1) 417 /* handle special Tru64 errno */ 418 if (errno == ENOTSUP) { 419 posix_errno = ELOOP; 420 } 421 #endif /* ENOTSUP */ 422 423 #ifdef EFTYPE 424 /* fix broken NetBSD errno */ 425 if (errno == EFTYPE) { 426 posix_errno = ELOOP; 427 } 428 #endif /* EFTYPE */ 429 430 /* fix broken FreeBSD errno */ 431 if (errno == EMLINK) { 432 posix_errno = ELOOP; 433 } 434 435 return (posix_errno == ELOOP); 413 436 } 414 437 … … 416 439 wrap rename for system override 417 440 */ 418 int pvfs_sys_rename(struct pvfs_state *pvfs, const char *name1, const char *name2 )441 int pvfs_sys_rename(struct pvfs_state *pvfs, const char *name1, const char *name2, bool allow_override) 419 442 { 420 443 int ret; … … 426 449 ret = rename(name1, name2); 427 450 if (ret != -1 || 428 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||451 !allow_override || 429 452 errno != EACCES) { 430 453 return ret; … … 481 504 wrap mkdir for system override 482 505 */ 483 int pvfs_sys_mkdir(struct pvfs_state *pvfs, const char *dirname, mode_t mode )506 int pvfs_sys_mkdir(struct pvfs_state *pvfs, const char *dirname, mode_t mode, bool allow_override) 484 507 { 485 508 int ret; … … 491 514 ret = mkdir(dirname, mode); 492 515 if (ret != -1 || 493 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||516 !allow_override || 494 517 errno != EACCES) { 495 518 return ret; … … 513 536 if (ret == -1) { 514 537 rmdir(dirname); 515 talloc_free(ctx);516 errno = saved_errno;517 return -1;518 }519 520 talloc_free(ctx);521 return ret;522 }523 524 525 /*526 wrap rmdir for system override527 */528 int pvfs_sys_rmdir(struct pvfs_state *pvfs, const char *dirname)529 {530 int ret;531 struct pvfs_sys_ctx *ctx;532 int saved_errno, orig_errno;533 534 orig_errno = errno;535 536 ret = rmdir(dirname);537 if (ret != -1 ||538 !(pvfs->flags & PVFS_FLAG_PERM_OVERRIDE) ||539 errno != EACCES) {540 return ret;541 }542 543 saved_errno = errno;544 545 ctx = pvfs_sys_pushdir(pvfs, &dirname);546 if (ctx == NULL) {547 errno = saved_errno;548 return -1;549 }550 551 ret = rmdir(dirname);552 if (ret == -1) {553 538 talloc_free(ctx); 554 539 errno = saved_errno; … … 561 546 } 562 547 563 /* 564 wrap fchmod for system override 565 */ 566 int pvfs_sys_fchmod(struct pvfs_state *pvfs, int fd, mode_t mode) 548 549 /* 550 wrap rmdir for system override 551 */ 552 int pvfs_sys_rmdir(struct pvfs_state *pvfs, const char *dirname, bool allow_override) 567 553 { 568 554 int ret; … … 572 558 orig_errno = errno; 573 559 574 ret = fchmod(fd, mode);560 ret = rmdir(dirname); 575 561 if (ret != -1 || 576 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||562 !allow_override || 577 563 errno != EACCES) { 578 564 return ret; … … 581 567 saved_errno = errno; 582 568 583 ctx = pvfs_sys_pushdir(pvfs, NULL);584 if (ctx == NULL) { 585 errno = saved_errno; 586 return -1; 587 } 588 589 ret = fchmod(fd, mode);569 ctx = pvfs_sys_pushdir(pvfs, &dirname); 570 if (ctx == NULL) { 571 errno = saved_errno; 572 return -1; 573 } 574 575 ret = rmdir(dirname); 590 576 if (ret == -1) { 591 577 talloc_free(ctx); … … 599 585 } 600 586 601 602 /* 603 wrap chmod for system override 604 */ 605 int pvfs_sys_chmod(struct pvfs_state *pvfs, const char *filename, mode_t mode) 587 /* 588 wrap fchmod for system override 589 */ 590 int pvfs_sys_fchmod(struct pvfs_state *pvfs, int fd, mode_t mode, bool allow_override) 606 591 { 607 592 int ret; … … 611 596 orig_errno = errno; 612 597 613 ret = chmod(filename, mode);598 ret = fchmod(fd, mode); 614 599 if (ret != -1 || 615 ! (pvfs->flags & PVFS_FLAG_PERM_OVERRIDE)||600 !allow_override || 616 601 errno != EACCES) { 617 602 return ret; … … 620 605 saved_errno = errno; 621 606 622 ctx = pvfs_sys_pushdir(pvfs, &filename);623 if (ctx == NULL) { 624 errno = saved_errno; 625 return -1; 626 } 627 628 ret = chmod(filename, mode);607 ctx = pvfs_sys_pushdir(pvfs, NULL); 608 if (ctx == NULL) { 609 errno = saved_errno; 610 return -1; 611 } 612 613 ret = fchmod(fd, mode); 629 614 if (ret == -1) { 630 615 talloc_free(ctx); … … 637 622 return ret; 638 623 } 624 625 626 /* 627 wrap chmod for system override 628 */ 629 int pvfs_sys_chmod(struct pvfs_state *pvfs, const char *filename, mode_t mode, bool allow_override) 630 { 631 int ret; 632 struct pvfs_sys_ctx *ctx; 633 int saved_errno, orig_errno; 634 635 orig_errno = errno; 636 637 ret = chmod(filename, mode); 638 if (ret != -1 || 639 !allow_override || 640 errno != EACCES) { 641 return ret; 642 } 643 644 saved_errno = errno; 645 646 ctx = pvfs_sys_pushdir(pvfs, &filename); 647 if (ctx == NULL) { 648 errno = saved_errno; 649 return -1; 650 } 651 652 ret = chmod(filename, mode); 653 if (ret == -1) { 654 talloc_free(ctx); 655 errno = saved_errno; 656 return -1; 657 } 658 659 talloc_free(ctx); 660 errno = orig_errno; 661 return ret; 662 } -
vendor/current/source4/ntvfs/posix/pvfs_unlink.c
r740 r988 124 124 125 125 /* finally try the actual unlink */ 126 if (pvfs_sys_unlink(pvfs, name->full_name ) == -1) {126 if (pvfs_sys_unlink(pvfs, name->full_name, name->allow_override) == -1) { 127 127 status = pvfs_map_errno(pvfs, errno); 128 128 } -
vendor/current/source4/ntvfs/posix/pvfs_util.c
r740 r988 41 41 { 42 42 NTSTATUS status; 43 status = map_nt_error_from_unix (unix_errno);43 status = map_nt_error_from_unix_common(unix_errno); 44 44 DEBUG(10,(__location__ " mapped unix errno %d -> %s\n", unix_errno, nt_errstr(status))); 45 45 return status; … … 91 91 NTSTATUS pvfs_copy_file(struct pvfs_state *pvfs, 92 92 struct pvfs_filename *name1, 93 struct pvfs_filename *name2) 93 struct pvfs_filename *name2, 94 bool allow_override) 94 95 { 95 96 int fd1, fd2; … … 103 104 } 104 105 105 fd1 = pvfs_sys_open(pvfs, name1->full_name, O_RDONLY, 0 );106 fd1 = pvfs_sys_open(pvfs, name1->full_name, O_RDONLY, 0, allow_override); 106 107 if (fd1 == -1) { 107 108 talloc_free(buf); … … 109 110 } 110 111 111 fd2 = pvfs_sys_open(pvfs, name2->full_name, O_CREAT|O_EXCL|O_WRONLY, 0 );112 fd2 = pvfs_sys_open(pvfs, name2->full_name, O_CREAT|O_EXCL|O_WRONLY, 0, allow_override); 112 113 if (fd2 == -1) { 113 114 close(fd1); … … 134 135 close(fd2); 135 136 talloc_free(buf); 136 pvfs_sys_unlink(pvfs, name2->full_name );137 pvfs_sys_unlink(pvfs, name2->full_name, allow_override); 137 138 if (ret2 == -1) { 138 139 return pvfs_map_errno(pvfs, errno); … … 146 147 147 148 mode = pvfs_fileperms(pvfs, name1->dos.attrib); 148 if (pvfs_sys_fchmod(pvfs, fd2, mode ) == -1) {149 if (pvfs_sys_fchmod(pvfs, fd2, mode, allow_override) == -1) { 149 150 status = pvfs_map_errno(pvfs, errno); 150 151 close(fd2); 151 pvfs_sys_unlink(pvfs, name2->full_name );152 pvfs_sys_unlink(pvfs, name2->full_name, allow_override); 152 153 return status; 153 154 } … … 159 160 if (!NT_STATUS_IS_OK(status)) { 160 161 close(fd2); 161 pvfs_sys_unlink(pvfs, name2->full_name );162 pvfs_sys_unlink(pvfs, name2->full_name, allow_override); 162 163 return status; 163 164 } -
vendor/current/source4/ntvfs/posix/pvfs_wait.c
r740 r988 34 34 void *private_data; 35 35 int msg_type; 36 struct messaging_context *msg_ctx;36 struct imessaging_context *msg_ctx; 37 37 struct tevent_context *ev; 38 38 struct ntvfs_request *req; … … 57 57 receive a completion message for a wait 58 58 */ 59 static void pvfs_wait_dispatch(struct messaging_context *msg,59 static void pvfs_wait_dispatch(struct imessaging_context *msg, 60 60 void *private_data, uint32_t msg_type, 61 61 struct server_id src, DATA_BLOB *data) … … 67 67 68 68 /* we need to check that this one is for us. See 69 messaging_send_ptr() for the other side of this.69 imessaging_send_ptr() for the other side of this. 70 70 */ 71 71 if (data->length == sizeof(void *)) { … … 117 117 { 118 118 if (pwait->msg_type != -1) { 119 messaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait);119 imessaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait); 120 120 } 121 121 DLIST_REMOVE(pwait->pvfs->wait_list, pwait); … … 157 157 if (!timeval_is_zero(&end_time)) { 158 158 /* setup a timer */ 159 event_add_timed(pwait->ev, pwait, end_time, pvfs_wait_timeout, pwait);159 tevent_add_timer(pwait->ev, pwait, end_time, pvfs_wait_timeout, pwait); 160 160 } 161 161 … … 163 163 type */ 164 164 if (msg_type != -1) { 165 messaging_register(pwait->msg_ctx,165 imessaging_register(pwait->msg_ctx, 166 166 pwait, 167 167 msg_type, -
vendor/current/source4/ntvfs/posix/pvfs_write.c
r414 r988 65 65 } 66 66 67 tv = timeval_current_ofs (0,pvfs->writetime_delay);67 tv = timeval_current_ofs_usec(pvfs->writetime_delay); 68 68 69 69 h->write_time.update_triggered = true; 70 70 h->write_time.update_on_close = true; 71 h->write_time.update_event = event_add_timed(pvfs->ntvfs->ctx->event_ctx,71 h->write_time.update_event = tevent_add_timer(pvfs->ntvfs->ctx->event_ctx, 72 72 h, tv, 73 73 pvfs_write_time_update_handler, 74 74 h); 75 75 if (!h->write_time.update_event) { 76 DEBUG(0,("Failed event_add_timed\n"));76 DEBUG(0,("Failed tevent_add_timer\n")); 77 77 } 78 78 } -
vendor/current/source4/ntvfs/posix/pvfs_xattr.c
r740 r988 25 25 #include "librpc/gen_ndr/ndr_xattr.h" 26 26 #include "param/param.h" 27 #include "ntvfs/posix/posix_eadb_proto.h" 27 28 28 29 /* … … 82 83 { 83 84 if (pvfs->ea_db) { 84 return delete_ xattr_tdb(pvfs, attr_name, fname, fd);85 return delete_posix_eadb(pvfs, attr_name, fname, fd); 85 86 } 86 87 return delete_xattr_system(pvfs, attr_name, fname, fd); … … 93 94 { 94 95 if (pvfs->ea_db) { 95 return unlink_ xattr_tdb(pvfs, fname);96 return unlink_posix_eadb(pvfs, fname); 96 97 } 97 98 return unlink_xattr_system(pvfs, fname); … … 284 285 NTSTATUS status; 285 286 ZERO_STRUCTP(eas); 287 288 if (name->stream_name) { 289 /* We don't support EAs on streams */ 290 return NT_STATUS_INVALID_PARAMETER; 291 } 292 286 293 if (!(pvfs->flags & PVFS_FLAG_XATTR_ENABLE)) { 287 294 return NT_STATUS_OK; -
vendor/current/source4/ntvfs/posix/python/pyxattr_native.c
r740 r988 22 22 #include "includes.h" 23 23 #include "librpc/ndr/libndr.h" 24 #include "lib/util/wrap_xattr.h" 24 #include "system/filesys.h" 25 26 void initxattr_native(void); 25 27 26 28 static PyObject *py_is_xattr_supported(PyObject *self) … … 37 39 char *filename, *attribute; 38 40 int ret = 0; 39 int blobsize;41 Py_ssize_t blobsize; 40 42 DATA_BLOB blob; 41 43 … … 45 47 46 48 blob.length = blobsize; 47 ret = wrap_setxattr(filename, attribute, blob.data, blob.length, 0);49 ret = setxattr(filename, attribute, blob.data, blob.length, 0); 48 50 if( ret < 0 ) { 49 51 if (errno == ENOTSUP) { … … 67 69 return NULL; 68 70 mem_ctx = talloc_new(NULL); 69 len = wrap_getxattr(filename,attribute,NULL,0);71 len = getxattr(filename,attribute,NULL,0); 70 72 if( len < 0 ) { 71 73 if (errno == ENOTSUP) { … … 79 81 /* check length ... */ 80 82 buf = talloc_zero_array(mem_ctx, char, len); 81 len = wrap_getxattr(filename, attribute, buf, len);83 len = getxattr(filename, attribute, buf, len); 82 84 if( len < 0 ) { 83 85 if (errno == ENOTSUP) { … … 97 99 { "wrap_getxattr", (PyCFunction)py_wrap_getxattr, METH_VARARGS, 98 100 "wrap_getxattr(filename,attribute) -> blob\n" 99 "Retr eive given attribute on the given file." },101 "Retrieve given attribute on the given file." }, 100 102 { "wrap_setxattr", (PyCFunction)py_wrap_setxattr, METH_VARARGS, 101 103 "wrap_setxattr(filename,attribute,value)\n" -
vendor/current/source4/ntvfs/posix/python/pyxattr_tdb.c
r740 r988 21 21 #include <Python.h> 22 22 #include "includes.h" 23 #include "system/filesys.h" 23 24 #include <tdb.h> 24 #include "lib/ util/tdb_wrap.h"25 #include "lib/tdb_wrap/tdb_wrap.h" 25 26 #include "librpc/ndr/libndr.h" 26 #include "lib/util/wrap_xattr.h" 27 #include "ntvfs/posix/vfs_posix.h" 27 #include "ntvfs/posix/posix_eadb.h" 28 28 #include "libcli/util/pyerrors.h" 29 #include "param/pyparam.h" 30 #include "lib/dbwrap/dbwrap.h" 31 #include "lib/dbwrap/dbwrap_open.h" 32 #include "lib/dbwrap/dbwrap_tdb.h" 33 #include "source3/lib/xattr_tdb.h" 34 35 void initxattr_tdb(void); 29 36 30 37 static PyObject *py_is_xattr_supported(PyObject *self) … … 37 44 char *filename, *attribute, *tdbname; 38 45 DATA_BLOB blob; 39 int blobsize;40 NTSTATUS status;46 Py_ssize_t blobsize; 47 int ret; 41 48 TALLOC_CTX *mem_ctx; 42 struct tdb_wrap *eadb; 49 struct loadparm_context *lp_ctx; 50 struct db_context *eadb = NULL; 51 struct file_id id; 52 struct stat sbuf; 43 53 44 54 if (!PyArg_ParseTuple(args, "ssss#", &tdbname, &filename, &attribute, … … 48 58 blob.length = blobsize; 49 59 mem_ctx = talloc_new(NULL); 50 eadb = tdb_wrap_open(mem_ctx, tdbname, 50000, 51 TDB_DEFAULT, O_RDWR|O_CREAT, 0600); 60 61 lp_ctx = py_default_loadparm_context(mem_ctx); 62 eadb = db_open_tdb(mem_ctx, tdbname, 50000, 63 lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT), 64 O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2, 65 DBWRAP_FLAG_NONE); 52 66 53 67 if (eadb == NULL) { … … 56 70 return NULL; 57 71 } 58 status = push_xattr_blob_tdb_raw(eadb, mem_ctx, attribute, filename, -1, 59 &blob); 60 if (!NT_STATUS_IS_OK(status)) { 61 PyErr_FromNTSTATUS(status); 72 73 ret = stat(filename, &sbuf); 74 if (ret < 0) { 75 PyErr_SetFromErrno(PyExc_IOError); 76 talloc_free(mem_ctx); 77 return NULL; 78 } 79 80 ZERO_STRUCT(id); 81 id.devid = sbuf.st_dev; 82 id.inode = sbuf.st_ino; 83 84 ret = xattr_tdb_setattr(eadb, &id, attribute, blob.data, blob.length, 0); 85 if (ret < 0) { 86 PyErr_SetFromErrno(PyExc_TypeError); 62 87 talloc_free(mem_ctx); 63 88 return NULL; … … 71 96 char *filename, *attribute, *tdbname; 72 97 TALLOC_CTX *mem_ctx; 98 struct loadparm_context *lp_ctx; 73 99 DATA_BLOB blob; 74 PyObject *ret; 75 NTSTATUS status; 76 struct tdb_wrap *eadb = NULL; 100 PyObject *ret_obj; 101 int ret; 102 ssize_t xattr_size; 103 struct db_context *eadb = NULL; 104 struct file_id id; 105 struct stat sbuf; 77 106 78 107 if (!PyArg_ParseTuple(args, "sss", &tdbname, &filename, &attribute)) … … 80 109 81 110 mem_ctx = talloc_new(NULL); 82 eadb = tdb_wrap_open(mem_ctx, tdbname, 50000, 83 TDB_DEFAULT, O_RDWR|O_CREAT, 0600); 111 112 lp_ctx = py_default_loadparm_context(mem_ctx); 113 eadb = db_open_tdb(mem_ctx, tdbname, 50000, 114 lpcfg_tdb_flags(lp_ctx, TDB_DEFAULT), 115 O_RDWR|O_CREAT, 0600, DBWRAP_LOCK_ORDER_2, 116 DBWRAP_FLAG_NONE); 117 84 118 if (eadb == NULL) { 85 119 PyErr_SetFromErrno(PyExc_IOError); … … 87 121 return NULL; 88 122 } 89 status = pull_xattr_blob_tdb_raw(eadb, mem_ctx, attribute, filename, 90 -1, 100, &blob);91 if ( !NT_STATUS_IS_OK(status) || blob.length< 0) {92 PyErr_ FromNTSTATUS(status);123 124 ret = stat(filename, &sbuf); 125 if (ret < 0) { 126 PyErr_SetFromErrno(PyExc_IOError); 93 127 talloc_free(mem_ctx); 94 128 return NULL; 95 129 } 96 ret = PyString_FromStringAndSize((char *)blob.data, blob.length); 130 131 ZERO_STRUCT(id); 132 id.devid = sbuf.st_dev; 133 id.inode = sbuf.st_ino; 134 135 xattr_size = xattr_tdb_getattr(eadb, mem_ctx, &id, attribute, &blob); 136 if (xattr_size < 0) { 137 PyErr_SetFromErrno(PyExc_TypeError); 138 talloc_free(mem_ctx); 139 return NULL; 140 } 141 ret_obj = PyString_FromStringAndSize((char *)blob.data, xattr_size); 97 142 talloc_free(mem_ctx); 98 return ret ;143 return ret_obj; 99 144 } 100 145 … … 102 147 { "wrap_getxattr", (PyCFunction)py_wrap_getxattr, METH_VARARGS, 103 148 "wrap_getxattr(filename,attribute) -> blob\n" 104 "Retr eive given attribute on the given file." },149 "Retrieve given attribute on the given file." }, 105 150 { "wrap_setxattr", (PyCFunction)py_wrap_setxattr, METH_VARARGS, 106 151 "wrap_setxattr(filename,attribute,value)\n" -
vendor/current/source4/ntvfs/posix/vfs_posix.c
r740 r988 28 28 #include "librpc/gen_ndr/security.h" 29 29 #include <tdb.h> 30 #include "lib/ util/tdb_wrap.h"30 #include "lib/tdb_wrap/tdb_wrap.h" 31 31 #include "libcli/security/security.h" 32 32 #include "lib/events/events.h" … … 39 39 { 40 40 struct share_config *scfg = pvfs->ntvfs->ctx->config; 41 const char *eadb; 41 char *eadb; 42 char *xattr_backend; 42 43 bool def_perm_override = false; 43 44 … … 114 115 FS_ATTR_CASE_SENSITIVE_SEARCH | 115 116 FS_ATTR_CASE_PRESERVED_NAMES | 116 FS_ATTR_UNICODE_ON_DISK | 117 FS_ATTR_SPARSE_FILES; 117 FS_ATTR_UNICODE_ON_DISK; 118 118 119 119 /* allow xattrs to be stored in a external tdb */ 120 eadb = share_string_option( scfg, PVFS_EADB, NULL);120 eadb = share_string_option(pvfs, scfg, PVFS_EADB, NULL); 121 121 if (eadb != NULL) { 122 pvfs->ea_db = tdb_wrap_open(pvfs, eadb, 50000, 123 TDB_DEFAULT, O_RDWR|O_CREAT, 0600); 122 pvfs->ea_db = tdb_wrap_open( 123 pvfs, eadb, 50000, 124 lpcfg_tdb_flags(pvfs->ntvfs->ctx->lp_ctx, TDB_DEFAULT), 125 O_RDWR|O_CREAT, 0600); 126 TALLOC_FREE(eadb); 124 127 if (pvfs->ea_db != NULL) { 125 128 pvfs->flags |= PVFS_FLAG_XATTR_ENABLE; … … 147 150 148 151 /* enable an ACL backend */ 149 pvfs->acl_ops = pvfs_acl_backend_byname(share_string_option(scfg, PVFS_ACL, "xattr")); 152 xattr_backend = share_string_option(pvfs, scfg, PVFS_ACL, "xattr"); 153 pvfs->acl_ops = pvfs_acl_backend_byname(xattr_backend); 154 TALLOC_FREE(xattr_backend); 150 155 } 151 156 … … 213 218 * but currently we don't have a lp_ctx there 214 219 */ 215 status = pvfs_acl_init( ntvfs->ctx->lp_ctx);220 status = pvfs_acl_init(); 216 221 NT_STATUS_NOT_OK_RETURN(status); 217 222 … … 220 225 221 226 /* for simplicity of path construction, remove any trailing slash now */ 222 base_directory = talloc_strdup(pvfs, share_string_option(ntvfs->ctx->config, SHARE_PATH, ""));227 base_directory = share_string_option(pvfs, ntvfs->ctx->config, SHARE_PATH, ""); 223 228 NT_STATUS_HAVE_NO_MEMORY(base_directory); 224 229 if (strcmp(base_directory, "/") != 0) { … … 250 255 ntvfs->private_data = pvfs; 251 256 252 pvfs->brl_context = brl _init(pvfs,257 pvfs->brl_context = brlock_init(pvfs, 253 258 pvfs->ntvfs->ctx->server_id, 254 259 pvfs->ntvfs->ctx->lp_ctx, … … 271 276 pvfs->ntvfs->ctx->config); 272 277 273 pvfs->wbc_ctx = wbc_init(pvfs,274 pvfs->ntvfs->ctx->msg_ctx,275 pvfs->ntvfs->ctx->event_ctx);276 if (pvfs->wbc_ctx == NULL) {277 return NT_STATUS_INTERNAL_DB_CORRUPTION;278 }279 280 278 /* allocate the search handle -> ptr tree */ 281 279 pvfs->search.idtree = idr_init(pvfs); … … 373 371 374 372 /* fill in all the operations */ 375 ops.connect = pvfs_connect;376 ops.disconnect = pvfs_disconnect;377 ops.unlink = pvfs_unlink;378 ops.chkpath = pvfs_chkpath;379 ops.qpathinfo = pvfs_qpathinfo;380 ops.setpathinfo = pvfs_setpathinfo;381 ops.open = pvfs_open;382 ops.mkdir = pvfs_mkdir;383 ops.rmdir = pvfs_rmdir;384 ops.rename = pvfs_rename;385 ops.copy = pvfs_copy;386 ops.ioctl = pvfs_ioctl;387 ops.read = pvfs_read;388 ops.write = pvfs_write;389 ops.seek = pvfs_seek;390 ops.flush = pvfs_flush;391 ops.close = pvfs_close;392 ops.exit = pvfs_exit;393 ops.lock = pvfs_lock;394 ops.setfileinfo = pvfs_setfileinfo;395 ops.qfileinfo = pvfs_qfileinfo;396 ops.fsinfo = pvfs_fsinfo;397 ops.lpq = pvfs_lpq;398 ops.search_first = pvfs_search_first;399 ops.search_next = pvfs_search_next;400 ops.search_close = pvfs_search_close;401 ops.trans = pvfs_trans;402 ops.logoff = pvfs_logoff;403 ops.async_setup = pvfs_async_setup;404 ops.cancel = pvfs_cancel;405 ops.notify = pvfs_notify;373 ops.connect_fn = pvfs_connect; 374 ops.disconnect_fn = pvfs_disconnect; 375 ops.unlink_fn = pvfs_unlink; 376 ops.chkpath_fn = pvfs_chkpath; 377 ops.qpathinfo_fn = pvfs_qpathinfo; 378 ops.setpathinfo_fn = pvfs_setpathinfo; 379 ops.open_fn = pvfs_open; 380 ops.mkdir_fn = pvfs_mkdir; 381 ops.rmdir_fn = pvfs_rmdir; 382 ops.rename_fn = pvfs_rename; 383 ops.copy_fn = pvfs_copy; 384 ops.ioctl_fn = pvfs_ioctl; 385 ops.read_fn = pvfs_read; 386 ops.write_fn = pvfs_write; 387 ops.seek_fn = pvfs_seek; 388 ops.flush_fn = pvfs_flush; 389 ops.close_fn = pvfs_close; 390 ops.exit_fn = pvfs_exit; 391 ops.lock_fn = pvfs_lock; 392 ops.setfileinfo_fn = pvfs_setfileinfo; 393 ops.qfileinfo_fn = pvfs_qfileinfo; 394 ops.fsinfo_fn = pvfs_fsinfo; 395 ops.lpq_fn = pvfs_lpq; 396 ops.search_first_fn = pvfs_search_first; 397 ops.search_next_fn = pvfs_search_next; 398 ops.search_close_fn = pvfs_search_close; 399 ops.trans_fn = pvfs_trans; 400 ops.logoff_fn = pvfs_logoff; 401 ops.async_setup_fn = pvfs_async_setup; 402 ops.cancel_fn = pvfs_cancel; 403 ops.notify_fn = pvfs_notify; 406 404 407 405 /* register ourselves with the NTVFS subsystem. We register -
vendor/current/source4/ntvfs/posix/vfs_posix.h
r740 r988 48 48 struct odb_context *odb_context; 49 49 struct notify_context *notify_context; 50 struct wbc_context *wbc_ctx;51 50 52 51 /* a list of pending async requests. Needed to support … … 132 131 bool exists; /* true if the base filename exists */ 133 132 bool stream_exists; /* true if the stream exists */ 133 bool allow_override; 134 134 struct stat st; 135 135 struct pvfs_dos_fileinfo dos; … … 205 205 struct brl_handle *brl_handle; 206 206 207 /* a count of active locks - used to avoid calling brl _close on207 /* a count of active locks - used to avoid calling brlock_close on 208 208 file close */ 209 209 uint64_t lock_count; -
vendor/current/source4/ntvfs/posix/wscript_build
r740 r988 4 4 source='pvfs_acl.c', 5 5 autoproto='vfs_acl_proto.h', 6 deps='events ',6 deps='events samba-modules', 7 7 ) 8 8 … … 32 32 33 33 bld.SAMBA_MODULE('ntvfs_posix', 34 source='vfs_posix.c pvfs_util.c pvfs_search.c pvfs_dirlist.c pvfs_fileinfo.c pvfs_unlink.c pvfs_mkdir.c pvfs_open.c pvfs_read.c pvfs_flush.c pvfs_write.c pvfs_fsinfo.c pvfs_qfileinfo.c pvfs_setfileinfo.c pvfs_rename.c pvfs_resolve.c pvfs_shortname.c pvfs_lock.c pvfs_oplock.c pvfs_wait.c pvfs_seek.c pvfs_ioctl.c pvfs_xattr.c pvfs_streams.c pvfs_notify.c pvfs_sys.c xattr_system.c xattr_tdb.c',34 source='vfs_posix.c pvfs_util.c pvfs_search.c pvfs_dirlist.c pvfs_fileinfo.c pvfs_unlink.c pvfs_mkdir.c pvfs_open.c pvfs_read.c pvfs_flush.c pvfs_write.c pvfs_fsinfo.c pvfs_qfileinfo.c pvfs_setfileinfo.c pvfs_rename.c pvfs_resolve.c pvfs_shortname.c pvfs_lock.c pvfs_oplock.c pvfs_wait.c pvfs_seek.c pvfs_ioctl.c pvfs_xattr.c pvfs_streams.c pvfs_notify.c pvfs_sys.c xattr_system.c', 35 35 autoproto='vfs_posix_proto.h', 36 36 subsystem='ntvfs', 37 37 init_function='ntvfs_posix_init', 38 deps='NDR_XATTR wrap_xattr ntvfs_common MESSAGING LIBWBCLIENT_OLD pvfs_acl pvfs_aio',38 deps='NDR_XATTR attr ntvfs_common MESSAGING LIBWBCLIENT_OLD pvfs_acl pvfs_aio posix_eadb', 39 39 internal_module=True 40 40 ) … … 43 43 bld.SAMBA_PYTHON('python_xattr_native', 44 44 source='python/pyxattr_native.c', 45 deps='ndr ldb samdb credentials pyparam_util wrap_xattrattr',45 deps='ndr ldb samdb samba-credentials pyparam_util attr', 46 46 realname='samba/xattr_native.so' 47 47 ) 48 48 49 bld.SAMBA_LIBRARY('posix_eadb', 50 source='posix_eadb.c', 51 deps='tdb tdb-wrap samba-util', 52 autoproto='posix_eadb_proto.h', 53 private_library=True) 54 55 bld.SAMBA_PYTHON('python_posix_eadb', 56 source='python/pyposix_eadb.c', 57 deps='pyparam_util posix_eadb tdb', 58 realname='samba/posix_eadb.so' 59 ) 49 60 50 61 bld.SAMBA_PYTHON('python_xattr_tdb', 51 source='python/pyxattr_tdb.c xattr_tdb.c',52 deps=' ndr ldb pyparam_util share attr',62 source='python/pyxattr_tdb.c', 63 deps='pyparam_util xattr_tdb', 53 64 realname='samba/xattr_tdb.so' 54 65 ) -
vendor/current/source4/ntvfs/posix/xattr_system.c
r414 r988 22 22 #include "includes.h" 23 23 #include "vfs_posix.h" 24 #include "../lib/util/wrap_xattr.h"25 24 26 25 /* … … 44 43 again: 45 44 if (fd != -1) { 46 ret = wrap_fgetxattr(fd, attr_name, blob->data, estimated_size);45 ret = fgetxattr(fd, attr_name, blob->data, estimated_size); 47 46 } else { 48 ret = wrap_getxattr(fname, attr_name, blob->data, estimated_size);47 ret = getxattr(fname, attr_name, blob->data, estimated_size); 49 48 } 50 49 if (ret == -1 && errno == ERANGE) { … … 105 104 106 105 if (fd != -1) { 107 ret = wrap_fsetxattr(fd, attr_name, blob->data, blob->length, 0);106 ret = fsetxattr(fd, attr_name, blob->data, blob->length, 0); 108 107 } else { 109 ret = wrap_setxattr(fname, attr_name, blob->data, blob->length, 0);108 ret = setxattr(fname, attr_name, blob->data, blob->length, 0); 110 109 } 111 110 if (ret == -1) { … … 126 125 127 126 if (fd != -1) { 128 ret = wrap_fremovexattr(fd, attr_name);127 ret = fremovexattr(fd, attr_name); 129 128 } else { 130 ret = wrap_removexattr(fname, attr_name);129 ret = removexattr(fname, attr_name); 131 130 } 132 131 if (ret == -1) {
Note:
See TracChangeset
for help on using the changeset viewer.