Changeset 342 for branches/samba-3.3.x/source/smbd/posix_acls.c
- Timestamp:
- Oct 30, 2009, 9:39:05 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 ));
Note:
See TracChangeset
for help on using the changeset viewer.