Changeset 594 for vendor/current/source3/smbd
- Timestamp:
- Jul 1, 2011, 4:02:23 PM (14 years ago)
- Location:
- vendor/current/source3/smbd
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/smbd/conn.c
r414 r594 198 198 pipes_struct *plist = NULL; 199 199 connection_struct *conn; 200 bool ret = true; 200 201 201 202 if (deadtime <= 0) … … 210 211 conn->lastused = t; 211 212 conn->lastused_count = t; 213 age = 0; 212 214 } 213 215 … … 218 220 219 221 if (conn->num_files_open > 0 || age < deadtime) { 220 ret urn False;222 ret = false; 221 223 } 222 224 } … … 230 232 plist = get_next_internal_pipe(plist)) { 231 233 if (num_pipe_handles(plist->pipe_handles) != 0) { 232 return False; 234 ret = false; 235 break; 233 236 } 234 237 } 235 238 236 return True;239 return ret; 237 240 } 238 241 -
vendor/current/source3/smbd/dosmode.c
r414 r594 412 412 */ 413 413 414 if (!NT_STATUS_IS_OK(open_file_fchmod( NULL,conn, smb_fname,414 if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname, 415 415 &fsp))) 416 416 return ret; … … 422 422 } 423 423 unbecome_root(); 424 close_file _fchmod(NULL, fsp);424 close_file(NULL, fsp, NORMAL_CLOSE); 425 425 return ret; 426 426 } … … 821 821 * still in our current user context. This ensures we 822 822 * are not violating security in doing the fchmod. 823 * This file open does *not* break any oplocks we are824 * holding. We need to review this.... may need to825 * break batch oplocks open by others. JRA.826 823 */ 827 824 files_struct *fsp; 828 if (!NT_STATUS_IS_OK(open_file_fchmod( NULL,conn, smb_fname,825 if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname, 829 826 &fsp))) 830 827 return -1; … … 832 829 ret = SMB_VFS_FCHMOD(fsp, unixmode); 833 830 unbecome_root(); 834 close_file _fchmod(NULL, fsp);831 close_file(NULL, fsp, NORMAL_CLOSE); 835 832 if (!newfile) { 836 833 notify_fname(conn, NOTIFY_ACTION_MODIFIED, -
vendor/current/source3/smbd/msdfs.c
r478 r594 796 796 797 797 NTSTATUS get_referred_path(TALLOC_CTX *ctx, 798 struct auth_serversupplied_info *server_info, 798 799 const char *dfs_path, 799 800 struct junction_map *jucn, … … 917 918 918 919 status = create_conn_struct(ctx, &conn, snum, lp_pathname(snum), 919 NULL, &oldpath);920 server_info, &oldpath); 920 921 if (!NT_STATUS_IS_OK(status)) { 921 922 TALLOC_FREE(pdp); … … 1222 1223 1223 1224 /* The following call can change cwd. */ 1224 *pstatus = get_referred_path(ctx, pathnamep, junction, 1225 &consumedcnt, &self_referral); 1225 *pstatus = get_referred_path(ctx, orig_conn->server_info, 1226 pathnamep, junction, 1227 &consumedcnt, &self_referral); 1226 1228 if (!NT_STATUS_IS_OK(*pstatus)) { 1227 1229 vfs_ChDir(orig_conn,orig_conn->connectpath); -
vendor/current/source3/smbd/nttrans.c
r581 r594 834 834 NTSTATUS status; 835 835 836 if (sd_len == 0 || !lp_nt_acl_support(SNUM(fsp->conn))) { 836 if (sd_len == 0) { 837 return NT_STATUS_INVALID_PARAMETER; 838 } 839 840 if (!CAN_WRITE(fsp->conn)) { 841 return NT_STATUS_ACCESS_DENIED; 842 } 843 844 if (!lp_nt_acl_support(SNUM(fsp->conn))) { 837 845 return NT_STATUS_OK; 838 846 } … … 851 859 } 852 860 853 /* Convert all the generic bits. */ 854 security_acl_map_generic(psd->dacl, &file_generic_mapping); 855 security_acl_map_generic(psd->sacl, &file_generic_mapping); 861 /* Ensure we have at least one thing set. */ 862 if ((security_info_sent & (SECINFO_OWNER|SECINFO_GROUP|SECINFO_DACL|SECINFO_SACL)) == 0) { 863 return NT_STATUS_INVALID_PARAMETER; 864 } 865 866 /* Ensure we have the rights to do this. */ 867 if (security_info_sent & SECINFO_OWNER) { 868 if (!(fsp->access_mask & SEC_STD_WRITE_OWNER)) { 869 return NT_STATUS_ACCESS_DENIED; 870 } 871 } 872 873 if (security_info_sent & SECINFO_GROUP) { 874 if (!(fsp->access_mask & SEC_STD_WRITE_OWNER)) { 875 return NT_STATUS_ACCESS_DENIED; 876 } 877 } 878 879 if (security_info_sent & SECINFO_DACL) { 880 if (!(fsp->access_mask & SEC_STD_WRITE_DAC)) { 881 return NT_STATUS_ACCESS_DENIED; 882 } 883 /* Convert all the generic bits. */ 884 if (psd->dacl) { 885 security_acl_map_generic(psd->dacl, &file_generic_mapping); 886 } 887 } 888 889 if (security_info_sent & SECINFO_SACL) { 890 if (!(fsp->access_mask & SEC_FLAG_SYSTEM_SECURITY)) { 891 return NT_STATUS_ACCESS_DENIED; 892 } 893 /* Convert all the generic bits. */ 894 if (psd->sacl) { 895 security_acl_map_generic(psd->sacl, &file_generic_mapping); 896 } 897 } 856 898 857 899 if (DEBUGLEVEL >= 10) { … … 1796 1838 */ 1797 1839 1840 if ((security_info_wanted & SECINFO_SACL) && 1841 !(fsp->access_mask & SEC_FLAG_SYSTEM_SECURITY)) { 1842 reply_nterror(req, NT_STATUS_ACCESS_DENIED); 1843 return; 1844 } 1845 1846 if ((security_info_wanted & (SECINFO_DACL|SECINFO_OWNER|SECINFO_GROUP)) && 1847 !(fsp->access_mask & SEC_STD_READ_CONTROL)) { 1848 reply_nterror(req, NT_STATUS_ACCESS_DENIED); 1849 return; 1850 } 1851 1798 1852 if (!lp_nt_acl_support(SNUM(conn))) { 1799 1853 status = get_null_nt_acl(talloc_tos(), &psd); … … 1805 1859 reply_nterror(req, status); 1806 1860 return; 1861 } 1862 1863 if (!(security_info_wanted & SECINFO_OWNER)) { 1864 psd->owner_sid = NULL; 1865 } 1866 if (!(security_info_wanted & SECINFO_GROUP)) { 1867 psd->group_sid = NULL; 1868 } 1869 if (!(security_info_wanted & SECINFO_DACL)) { 1870 psd->dacl = NULL; 1871 } 1872 if (!(security_info_wanted & SECINFO_SACL)) { 1873 psd->sacl = NULL; 1807 1874 } 1808 1875 -
vendor/current/source3/smbd/open.c
r587 r594 23 23 #include "smbd/globals.h" 24 24 25 extern struct current_user current_user; 25 26 extern const struct generic_mapping file_generic_mapping; 26 27 … … 1479 1480 ZERO_STRUCT(id); 1480 1481 1482 /* Windows allows a new file to be created and 1483 silently removes a FILE_ATTRIBUTE_DIRECTORY 1484 sent by the client. Do the same. */ 1485 1486 new_dos_attributes &= ~FILE_ATTRIBUTE_DIRECTORY; 1487 1481 1488 if (conn->printer) { 1482 1489 /* … … 1961 1968 if ((flags2 & O_CREAT) && lp_inherit_acls(SNUM(conn)) && 1962 1969 (def_acl = directory_has_default_acl(conn, parent_dir))) { 1963 unx_mode = 0777;1970 unx_mode = (0777 & lp_create_mask(SNUM(conn))); 1964 1971 } 1965 1972 … … 2265 2272 ****************************************************************************/ 2266 2273 2267 NTSTATUS open_file_fchmod( struct smb_request *req,connection_struct *conn,2274 NTSTATUS open_file_fchmod(connection_struct *conn, 2268 2275 struct smb_filename *smb_fname, 2269 2276 files_struct **result) 2270 2277 { 2271 files_struct *fsp = NULL;2272 NTSTATUS status;2273 2274 2278 if (!VALID_STAT(smb_fname->st)) { 2275 2279 return NT_STATUS_INVALID_PARAMETER; 2276 2280 } 2277 2281 2278 status = file_new(req, conn, &fsp); 2279 if(!NT_STATUS_IS_OK(status)) { 2280 return status; 2281 } 2282 2283 status = SMB_VFS_CREATE_FILE( 2282 return SMB_VFS_CREATE_FILE( 2284 2283 conn, /* conn */ 2285 2284 NULL, /* req */ … … 2292 2291 0, /* create_options */ 2293 2292 0, /* file_attributes */ 2294 0,/* oplock_request */2293 INTERNAL_OPEN_ONLY, /* oplock_request */ 2295 2294 0, /* allocation_size */ 2296 2295 NULL, /* sd */ 2297 2296 NULL, /* ea_list */ 2298 &fsp, /* result */2297 result, /* result */ 2299 2298 NULL); /* pinfo */ 2300 2301 /*2302 * This is not a user visible file open.2303 * Don't set a share mode.2304 */2305 2306 if (!NT_STATUS_IS_OK(status)) {2307 file_free(req, fsp);2308 return status;2309 }2310 2311 *result = fsp;2312 return NT_STATUS_OK;2313 }2314 2315 /****************************************************************************2316 Close the fchmod file fd - ensure no locks are lost.2317 ****************************************************************************/2318 2319 NTSTATUS close_file_fchmod(struct smb_request *req, files_struct *fsp)2320 {2321 NTSTATUS status = fd_close(fsp);2322 file_free(req, fsp);2323 return status;2324 2299 } 2325 2300 … … 2440 2415 SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname)); 2441 2416 2417 /* Ensure we have a directory attribute. */ 2418 file_attributes |= FILE_ATTRIBUTE_DIRECTORY; 2419 2442 2420 DEBUG(5,("open_directory: opening directory %s, access_mask = 0x%x, " 2443 2421 "share_access = 0x%x create_options = 0x%x, " … … 2468 2446 } 2469 2447 2470 /* We need to support SeSecurityPrivilege for this. */2471 if (access_mask & SEC_FLAG_SYSTEM_SECURITY) {2448 if ((access_mask & SEC_FLAG_SYSTEM_SECURITY) && 2449 !user_has_privileges(current_user.nt_user_token, &se_security)) { 2472 2450 DEBUG(10, ("open_directory: open on %s " 2473 2451 "failed - SEC_FLAG_SYSTEM_SECURITY denied.\n", … … 2978 2956 } 2979 2957 2980 #if 02981 /* We need to support SeSecurityPrivilege for this. */2982 2958 if ((access_mask & SEC_FLAG_SYSTEM_SECURITY) && 2983 !user_has_privileges(current_user.nt_user_token, 2984 &se_security)) { 2959 !user_has_privileges(current_user.nt_user_token, &se_security)) { 2960 DEBUG(10, ("create_file_unixpath:: open on %s " 2961 "failed - SEC_FLAG_SYSTEM_SECURITY denied.\n", 2962 smb_fname_str_dbg(smb_fname))); 2985 2963 status = NT_STATUS_PRIVILEGE_NOT_HELD; 2986 2964 goto fail; 2987 2965 } 2988 #else2989 /* We need to support SeSecurityPrivilege for this. */2990 if (access_mask & SEC_FLAG_SYSTEM_SECURITY) {2991 status = NT_STATUS_PRIVILEGE_NOT_HELD;2992 goto fail;2993 }2994 /* Don't allow a SACL set from an NTtrans create until we2995 * support SeSecurityPrivilege. */2996 if (!VALID_STAT(smb_fname->st) &&2997 lp_nt_acl_support(SNUM(conn)) &&2998 sd && (sd->sacl != NULL)) {2999 status = NT_STATUS_PRIVILEGE_NOT_HELD;3000 goto fail;3001 }3002 #endif3003 2966 3004 2967 if ((conn->fs_capabilities & FILE_NAMED_STREAMS) … … 3271 3234 struct smb_request *req, 3272 3235 uint16_t root_dir_fid, 3273 struct smb_filename *smb_fname) 3236 const struct smb_filename *smb_fname, 3237 struct smb_filename **smb_fname_out) 3274 3238 { 3275 3239 files_struct *dir_fsp; … … 3359 3323 } 3360 3324 3361 new_base_name = talloc_asprintf( smb_fname, "%s%s", parent_fname,3325 new_base_name = talloc_asprintf(talloc_tos(), "%s%s", parent_fname, 3362 3326 smb_fname->base_name); 3363 3327 if (new_base_name == NULL) { … … 3366 3330 } 3367 3331 3368 TALLOC_FREE(smb_fname->base_name); 3369 smb_fname->base_name = new_base_name; 3370 status = NT_STATUS_OK; 3332 status = filename_convert(req, 3333 conn, 3334 req->flags2 & FLAGS2_DFS_PATHNAMES, 3335 new_base_name, 3336 0, 3337 NULL, 3338 smb_fname_out); 3339 if (!NT_STATUS_IS_OK(status)) { 3340 goto out; 3341 } 3371 3342 3372 3343 out: … … 3415 3386 3416 3387 if (root_dir_fid != 0) { 3388 struct smb_filename *smb_fname_out = NULL; 3417 3389 status = get_relative_fid_filename(conn, req, root_dir_fid, 3418 smb_fname );3390 smb_fname, &smb_fname_out); 3419 3391 if (!NT_STATUS_IS_OK(status)) { 3420 3392 goto fail; 3421 3393 } 3394 smb_fname = smb_fname_out; 3422 3395 } 3423 3396 -
vendor/current/source3/smbd/password.c
r414 r594 211 211 } 212 212 213 pwd = getpwnam_alloc(talloc_tos(), username);213 pwd = Get_Pwnam_alloc(talloc_tos(), username); 214 214 215 215 if ((pwd == NULL) || (pwd->pw_dir[0] == '\0')) { -
vendor/current/source3/smbd/posix_acls.c
r427 r594 1746 1746 sid_string_dbg(&psa->trustee))); 1747 1747 SAFE_FREE(current_ace); 1748 continue; 1749 } 1750 1751 if (lp_force_unknown_acl_user(SNUM(fsp->conn))) { 1752 DEBUG(10, ("create_canon_ace_lists: ignoring " 1753 "unknown or foreign SID %s\n", 1754 sid_string_dbg(&psa->trustee))); 1755 SAFE_FREE(current_ace); 1748 1756 continue; 1749 1757 } … … 3592 3600 } 3593 3601 3594 if (!NT_STATUS_IS_OK(open_file_fchmod( NULL,conn, smb_fname, &fsp))) {3602 if (!NT_STATUS_IS_OK(open_file_fchmod(conn, smb_fname, &fsp))) { 3595 3603 return -1; 3596 3604 } … … 3611 3619 unbecome_root(); 3612 3620 3613 close_file _fchmod(NULL, fsp);3621 close_file(NULL, fsp, NORMAL_CLOSE); 3614 3622 3615 3623 return ret; … … 3823 3831 ****************************************************************************/ 3824 3832 3825 NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, const SEC_DESC *psd )3833 NTSTATUS set_nt_acl(files_struct *fsp, uint32 security_info_sent, const SEC_DESC *psd_orig) 3826 3834 { 3827 3835 connection_struct *conn = fsp->conn; … … 3838 3846 bool acl_set_support = false; 3839 3847 bool ret = false; 3848 SEC_DESC *psd = NULL; 3840 3849 3841 3850 DEBUG(10,("set_nt_acl: called for file %s\n", … … 3847 3856 } 3848 3857 3858 if (!psd_orig) { 3859 return NT_STATUS_INVALID_PARAMETER; 3860 } 3861 3862 psd = dup_sec_desc(talloc_tos(), psd_orig); 3863 if (!psd) { 3864 return NT_STATUS_NO_MEMORY; 3865 } 3866 3849 3867 /* 3850 3868 * Get the current state of the file. … … 3862 3880 * Unpack the user/group/world id's. 3863 3881 */ 3882 3883 /* POSIX can't cope with missing owner/group. */ 3884 if ((security_info_sent & SECINFO_OWNER) && (psd->owner_sid == NULL)) { 3885 security_info_sent &= ~SECINFO_OWNER; 3886 } 3887 if ((security_info_sent & SECINFO_GROUP) && (psd->group_sid == NULL)) { 3888 security_info_sent &= ~SECINFO_GROUP; 3889 } 3864 3890 3865 3891 status = unpack_nt_owners( SNUM(conn), &user, &grp, security_info_sent, psd); … … 3912 3938 3913 3939 create_file_sids(&fsp->fsp_name->st, &file_owner_sid, &file_grp_sid); 3940 3941 if((security_info_sent & SECINFO_DACL) && 3942 (psd->type & SEC_DESC_DACL_PRESENT) && 3943 (psd->dacl == NULL)) { 3944 SEC_ACE ace[3]; 3945 3946 /* We can't have NULL DACL in POSIX. 3947 Use owner/group/Everyone -> full access. */ 3948 3949 init_sec_ace(&ace[0], 3950 &file_owner_sid, 3951 SEC_ACE_TYPE_ACCESS_ALLOWED, 3952 GENERIC_ALL_ACCESS, 3953 0); 3954 init_sec_ace(&ace[1], 3955 &file_grp_sid, 3956 SEC_ACE_TYPE_ACCESS_ALLOWED, 3957 GENERIC_ALL_ACCESS, 3958 0); 3959 init_sec_ace(&ace[2], 3960 &global_sid_World, 3961 SEC_ACE_TYPE_ACCESS_ALLOWED, 3962 GENERIC_ALL_ACCESS, 3963 0); 3964 psd->dacl = make_sec_acl(talloc_tos(), 3965 NT4_ACL_REVISION, 3966 3, 3967 ace); 3968 if (psd->dacl == NULL) { 3969 return NT_STATUS_NO_MEMORY; 3970 } 3971 security_acl_map_generic(psd->dacl, &file_generic_mapping); 3972 } 3914 3973 3915 3974 acl_perms = unpack_canon_ace(fsp, &fsp->fsp_name->st, &file_owner_sid, … … 4757 4816 return ret_sd; 4758 4817 } 4818 4819 /* Stolen shamelessly from pvfs_default_acl() in source4 :-). */ 4820 4821 NTSTATUS make_default_filesystem_acl(TALLOC_CTX *ctx, 4822 const char *name, 4823 SMB_STRUCT_STAT *psbuf, 4824 SEC_DESC **ppdesc) 4825 { 4826 struct dom_sid owner_sid, group_sid; 4827 size_t size = 0; 4828 SEC_ACE aces[4]; 4829 uint32_t access_mask = 0; 4830 mode_t mode = psbuf->st_ex_mode; 4831 SEC_ACL *new_dacl = NULL; 4832 int idx = 0; 4833 4834 DEBUG(10,("make_default_filesystem_acl: file %s mode = 0%o\n", 4835 name, (int)mode )); 4836 4837 uid_to_sid(&owner_sid, psbuf->st_ex_uid); 4838 gid_to_sid(&group_sid, psbuf->st_ex_gid); 4839 4840 /* 4841 We provide up to 4 ACEs 4842 - Owner 4843 - Group 4844 - Everyone 4845 - NT System 4846 */ 4847 4848 if (mode & S_IRUSR) { 4849 if (mode & S_IWUSR) { 4850 access_mask |= SEC_RIGHTS_FILE_ALL; 4851 } else { 4852 access_mask |= SEC_RIGHTS_FILE_READ | SEC_FILE_EXECUTE; 4853 } 4854 } 4855 if (mode & S_IWUSR) { 4856 access_mask |= SEC_RIGHTS_FILE_WRITE | SEC_STD_DELETE; 4857 } 4858 4859 init_sec_ace(&aces[idx], 4860 &owner_sid, 4861 SEC_ACE_TYPE_ACCESS_ALLOWED, 4862 access_mask, 4863 0); 4864 idx++; 4865 4866 access_mask = 0; 4867 if (mode & S_IRGRP) { 4868 access_mask |= SEC_RIGHTS_FILE_READ | SEC_FILE_EXECUTE; 4869 } 4870 if (mode & S_IWGRP) { 4871 /* note that delete is not granted - this matches posix behaviour */ 4872 access_mask |= SEC_RIGHTS_FILE_WRITE; 4873 } 4874 if (access_mask) { 4875 init_sec_ace(&aces[idx], 4876 &group_sid, 4877 SEC_ACE_TYPE_ACCESS_ALLOWED, 4878 access_mask, 4879 0); 4880 idx++; 4881 } 4882 4883 access_mask = 0; 4884 if (mode & S_IROTH) { 4885 access_mask |= SEC_RIGHTS_FILE_READ | SEC_FILE_EXECUTE; 4886 } 4887 if (mode & S_IWOTH) { 4888 access_mask |= SEC_RIGHTS_FILE_WRITE; 4889 } 4890 if (access_mask) { 4891 init_sec_ace(&aces[idx], 4892 &global_sid_World, 4893 SEC_ACE_TYPE_ACCESS_ALLOWED, 4894 access_mask, 4895 0); 4896 idx++; 4897 } 4898 4899 init_sec_ace(&aces[idx], 4900 &global_sid_System, 4901 SEC_ACE_TYPE_ACCESS_ALLOWED, 4902 SEC_RIGHTS_FILE_ALL, 4903 0); 4904 idx++; 4905 4906 new_dacl = make_sec_acl(ctx, 4907 NT4_ACL_REVISION, 4908 idx, 4909 aces); 4910 4911 if (!new_dacl) { 4912 return NT_STATUS_NO_MEMORY; 4913 } 4914 4915 *ppdesc = make_sec_desc(ctx, 4916 SECURITY_DESCRIPTOR_REVISION_1, 4917 SEC_DESC_SELF_RELATIVE|SEC_DESC_DACL_PRESENT, 4918 &owner_sid, 4919 &group_sid, 4920 NULL, 4921 new_dacl, 4922 &size); 4923 if (!*ppdesc) { 4924 return NT_STATUS_NO_MEMORY; 4925 } 4926 return NT_STATUS_OK; 4927 } -
vendor/current/source3/smbd/process.c
r587 r594 836 836 END_PROFILE(smbd_idle); 837 837 errno = sav; 838 } 839 840 if (selrtn == -1 && errno != EINTR) { 841 return map_nt_error_from_unix(errno); 838 842 } 839 843 … … 1857 1861 * may have updated them. 1858 1862 */ 1859 S CVAL(req->chain_outbuf, smb_tid, CVAL(req->outbuf, smb_tid));1860 S CVAL(req->chain_outbuf, smb_uid, CVAL(req->outbuf, smb_uid));1863 SSVAL(req->chain_outbuf, smb_tid, SVAL(req->outbuf, smb_tid)); 1864 SSVAL(req->chain_outbuf, smb_uid, SVAL(req->outbuf, smb_uid)); 1861 1865 1862 1866 if (!smb_splice_chain(&req->chain_outbuf, -
vendor/current/source3/smbd/uid.c
r414 r594 32 32 struct passwd *pass; 33 33 34 pass = getpwnam_alloc(talloc_autofree_context(), lp_guestaccount());34 pass = Get_Pwnam_alloc(talloc_autofree_context(), lp_guestaccount()); 35 35 if (!pass) { 36 36 return false; -
vendor/current/source3/smbd/vfs.c
r414 r594 583 583 } 584 584 585 #ifdef S_ISFIFO 586 if (S_ISFIFO(st.st_ex_mode)) { 587 return 0; 588 } 589 #endif 590 585 591 DEBUG(10,("vfs_fill_sparse: write zeros in file %s from len %.0f to " 586 592 "len %.0f (%.0f bytes)\n", fsp_str_dbg(fsp), … … 591 597 592 598 flush_write_cache(fsp, SIZECHANGE_FLUSH); 599 600 601 offset = st.st_ex_size; 602 num_to_write = len - st.st_ex_size; 603 604 /* Only do this on non-stream file handles. */ 605 if (fsp->base_fsp == NULL) { 606 /* for allocation try posix_fallocate first. This can fail on some 607 * platforms e.g. when the filesystem doesn't support it and no 608 * emulation is being done by the libc (like on AIX with JFS1). In that 609 * case we do our own emulation. posix_fallocate implementations can 610 * return ENOTSUP or EINVAL in cases like that. */ 611 ret = sys_posix_fallocate(fsp->fh->fd, offset, num_to_write); 612 if (ret == ENOSPC) { 613 errno = ENOSPC; 614 ret = -1; 615 goto out; 616 } 617 if (ret == 0) { 618 set_filelen_write_cache(fsp, len); 619 goto out; 620 } 621 622 DEBUG(10,("vfs_fill_sparse: sys_posix_fallocate failed with " 623 "error %d. Falling back to slow manual allocation\n", ret)); 624 } 593 625 594 626 if (!sparse_buf) { … … 601 633 } 602 634 603 offset = st.st_ex_size;604 num_to_write = len - st.st_ex_size;605 635 total = 0; 606 636 … … 929 959 } 930 960 default: 931 DEBUG( 1,("check_reduced_name: couldn't get "961 DEBUG(3,("check_reduced_name: couldn't get " 932 962 "realpath for %s\n", fname)); 933 963 return map_nt_error_from_unix(errno);
Note:
See TracChangeset
for help on using the changeset viewer.