Changeset 342 for branches/samba-3.3.x/source/smbd
- Timestamp:
- Oct 30, 2009, 9:39:05 AM (16 years ago)
- Location:
- branches/samba-3.3.x/source/smbd
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/smbd/files.c
r222 r342 408 408 fsp->fsp_name); 409 409 410 if (strnequal(d_fullname, d1_fullname, dlen)) { 410 /* 411 * If the open file has a path that is a longer 412 * component, then it's a subpath. 413 */ 414 if (strnequal(d_fullname, d1_fullname, dlen) && 415 (d1_fullname[dlen] == '/')) { 411 416 TALLOC_FREE(d_fullname); 412 417 TALLOC_FREE(d1_fullname); … … 414 419 } 415 420 TALLOC_FREE(d1_fullname); 416 } 421 } 417 422 418 423 TALLOC_FREE(d_fullname); -
branches/samba-3.3.x/source/smbd/notify_inotify.c
r206 r342 233 233 struct inotify_event *e0, *e; 234 234 uint32_t prev_cookie=0; 235 NTSTATUS status; 235 236 236 237 /* … … 248 249 if (e == NULL) return; 249 250 250 if (sys_read(in->fd, e0, bufsize) != bufsize) { 251 DEBUG(0,("Failed to read all inotify data\n")); 251 status = read_data(in->fd, (char *)e0, bufsize); 252 if (!NT_STATUS_IS_OK(status)) { 253 DEBUG(0,("Failed to read all inotify data - %s\n", 254 nt_errstr(status))); 252 255 talloc_free(e0); 256 /* the inotify fd will now be out of sync, 257 * can't keep reading data off it */ 258 TALLOC_FREE(fde); 253 259 return; 254 260 } -
branches/samba-3.3.x/source/smbd/posix_acls.c
r285 r342 3179 3179 SMB_ACL_T def_acl = NULL; 3180 3180 struct pai_val *pal; 3181 int ret; 3181 3182 3182 3183 *ppdesc = NULL; … … 3185 3186 3186 3187 /* Get the stat struct for the owner info. */ 3187 if(SMB_VFS_STAT(conn, name, &sbuf) != 0) { 3188 if (lp_posix_pathnames()) { 3189 ret = SMB_VFS_LSTAT(conn, name, &sbuf); 3190 } else { 3191 ret = SMB_VFS_STAT(conn, name, &sbuf); 3192 } 3193 if(ret != 0) { 3188 3194 return map_nt_error_from_unix(errno); 3189 3195 } … … 3219 3225 files_struct *fsp; 3220 3226 SMB_STRUCT_STAT st; 3227 bool posix_paths = lp_posix_pathnames(); 3221 3228 3222 3229 if(!CAN_WRITE(conn)) { … … 3226 3233 /* Case (1). */ 3227 3234 /* try the direct way first */ 3228 ret = SMB_VFS_CHOWN(conn, fname, uid, gid); 3235 if (posix_paths) { 3236 ret = SMB_VFS_LCHOWN(conn, fname, uid, gid); 3237 } else { 3238 ret = SMB_VFS_CHOWN(conn, fname, uid, gid); 3239 } 3229 3240 if (ret == 0) 3230 3241 return 0; … … 3266 3277 } 3267 3278 3268 if (SMB_VFS_STAT(conn,fname,&st)) { 3279 if (posix_paths) { 3280 ret = SMB_VFS_LSTAT(conn,fname,&st); 3281 } else { 3282 ret = SMB_VFS_STAT(conn,fname,&st); 3283 } 3284 if (ret != 0) { 3269 3285 return -1; 3270 3286 } … … 3498 3514 bool acl_set_support = false; 3499 3515 bool ret = false; 3516 bool posix_paths = lp_posix_pathnames(); 3517 int sret; 3500 3518 3501 3519 DEBUG(10,("set_nt_acl: called for file %s\n", fsp->fsp_name )); … … 3511 3529 3512 3530 if(fsp->is_directory || fsp->fh->fd == -1) { 3513 if(SMB_VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf) != 0) 3531 if (posix_paths) { 3532 sret = SMB_VFS_LSTAT(fsp->conn,fsp->fsp_name, &sbuf); 3533 } else { 3534 sret = SMB_VFS_STAT(fsp->conn,fsp->fsp_name, &sbuf); 3535 } 3536 if (sret != 0) { 3514 3537 return map_nt_error_from_unix(errno); 3538 } 3515 3539 } else { 3516 3540 if(SMB_VFS_FSTAT(fsp, &sbuf) != 0) … … 3556 3580 3557 3581 if(fsp->is_directory) { 3558 if(SMB_VFS_STAT(fsp->conn, fsp->fsp_name, &sbuf) != 0) { 3582 if (posix_paths) { 3583 sret = SMB_VFS_LSTAT(fsp->conn, fsp->fsp_name, &sbuf); 3584 } else { 3585 sret = SMB_VFS_STAT(fsp->conn, fsp->fsp_name, &sbuf); 3586 } 3587 if (sret != 0) { 3559 3588 return map_nt_error_from_unix(errno); 3560 3589 } 3561 3590 } else { 3562 3563 int sret; 3564 3565 if(fsp->fh->fd == -1) 3566 sret = SMB_VFS_STAT(fsp->conn, fsp->fsp_name, &sbuf); 3567 else 3591 if(fsp->fh->fd == -1) { 3592 if (posix_paths) { 3593 sret = SMB_VFS_LSTAT(fsp->conn, fsp->fsp_name, &sbuf); 3594 } else { 3595 sret = SMB_VFS_STAT(fsp->conn, fsp->fsp_name, &sbuf); 3596 } 3597 } else { 3568 3598 sret = SMB_VFS_FSTAT(fsp, &sbuf); 3599 } 3569 3600 3570 3601 if(sret != 0) … … 3645 3676 } 3646 3677 } else { 3647 int sret = -1;3648 3649 3678 /* 3650 3679 * No default ACL - delete one if it exists. … … 3706 3735 3707 3736 if (orig_mode != posix_perms) { 3708 int sret = -1;3709 3710 3737 DEBUG(3,("set_nt_acl: chmod %s. perms = 0%o.\n", 3711 3738 fsp->fsp_name, (unsigned int)posix_perms )); -
branches/samba-3.3.x/source/smbd/reply.c
r242 r342 958 958 } 959 959 960 if (!VALID_STAT(sbuf) && (SMB_VFS_STAT(conn,name,&sbuf) != 0)) { 961 DEBUG(3,("reply_checkpath: stat of %s failed (%s)\n",name,strerror(errno))); 962 status = map_nt_error_from_unix(errno); 963 goto path_err; 960 if (!VALID_STAT(sbuf)) { 961 int ret; 962 963 if (lp_posix_pathnames()) { 964 ret = SMB_VFS_LSTAT(conn,name,&sbuf); 965 } else { 966 ret = SMB_VFS_STAT(conn,name,&sbuf); 967 } 968 if (ret != 0) { 969 DEBUG(3,("reply_checkpath: stat of %s failed (%s)\n",name,strerror(errno))); 970 status = map_nt_error_from_unix(errno); 971 goto path_err; 972 } 964 973 } 965 974 … … 1068 1077 return; 1069 1078 } 1070 if (!VALID_STAT(sbuf) && (SMB_VFS_STAT(conn,fname,&sbuf) != 0)) { 1071 DEBUG(3,("reply_getatr: stat of %s failed (%s)\n",fname,strerror(errno))); 1072 reply_unixerror(req, ERRDOS,ERRbadfile); 1073 END_PROFILE(SMBgetatr); 1074 return; 1079 if (!VALID_STAT(sbuf)) { 1080 int ret; 1081 1082 if (lp_posix_pathnames()) { 1083 ret = SMB_VFS_LSTAT(conn,fname,&sbuf); 1084 } else { 1085 ret = SMB_VFS_STAT(conn,fname,&sbuf); 1086 } 1087 if (ret != 0) { 1088 DEBUG(3,("reply_getatr: stat of %s failed (%s)\n",fname,strerror(errno))); 1089 reply_unixerror(req, ERRDOS,ERRbadfile); 1090 END_PROFILE(SMBgetatr); 1091 return; 1092 } 1075 1093 } 1076 1094 … … 2302 2320 files_struct *fsp; 2303 2321 uint32 dirtype_orig = dirtype; 2322 bool posix_paths = lp_posix_pathnames(); 2323 int ret; 2304 2324 NTSTATUS status; 2305 2325 … … 2310 2330 } 2311 2331 2312 if (SMB_VFS_LSTAT(conn,fname,&sbuf) != 0) { 2332 if (posix_paths) { 2333 ret = SMB_VFS_LSTAT(conn,fname,&sbuf); 2334 } else { 2335 ret = SMB_VFS_STAT(conn,fname,&sbuf); 2336 } 2337 if (ret != 0) { 2313 2338 return map_nt_error_from_unix(errno); 2314 2339 } … … 2396 2421 FILE_OPEN, /* create_disposition*/ 2397 2422 FILE_NON_DIRECTORY_FILE, /* create_options */ 2398 FILE_ATTRIBUTE_NORMAL, /* file_attributes */ 2423 /* file_attributes */ 2424 posix_paths ? FILE_FLAG_POSIX_SEMANTICS|0777 : 2425 FILE_ATTRIBUTE_NORMAL, 2399 2426 0, /* oplock_request */ 2400 2427 0, /* allocation_size */
Note:
See TracChangeset
for help on using the changeset viewer.