Ignore:
Timestamp:
Oct 30, 2009, 9:39:05 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.3 to 3.3.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/smbd/posix_acls.c

    r285 r342  
    31793179        SMB_ACL_T def_acl = NULL;
    31803180        struct pai_val *pal;
     3181        int ret;
    31813182
    31823183        *ppdesc = NULL;
     
    31853186
    31863187        /* 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) {
    31883194                return map_nt_error_from_unix(errno);
    31893195        }
     
    32193225        files_struct *fsp;
    32203226        SMB_STRUCT_STAT st;
     3227        bool posix_paths = lp_posix_pathnames();
    32213228
    32223229        if(!CAN_WRITE(conn)) {
     
    32263233        /* Case (1). */
    32273234        /* 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        }
    32293240        if (ret == 0)
    32303241                return 0;
     
    32663277        }
    32673278
    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) {
    32693285                return -1;
    32703286        }
     
    34983514        bool acl_set_support = false;
    34993515        bool ret = false;
     3516        bool posix_paths = lp_posix_pathnames();
     3517        int sret;
    35003518
    35013519        DEBUG(10,("set_nt_acl: called for file %s\n", fsp->fsp_name ));
     
    35113529
    35123530        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) {
    35143537                        return map_nt_error_from_unix(errno);
     3538                }
    35153539        } else {
    35163540                if(SMB_VFS_FSTAT(fsp, &sbuf) != 0)
     
    35563580
    35573581                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) {
    35593588                                return map_nt_error_from_unix(errno);
    35603589                        }
    35613590                } 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 {
    35683598                                sret = SMB_VFS_FSTAT(fsp, &sbuf);
     3599                        }
    35693600
    35703601                        if(sret != 0)
     
    36453676                        }
    36463677                } else {
    3647                         int sret = -1;
    3648 
    36493678                        /*
    36503679                         * No default ACL - delete one if it exists.
     
    37063735
    37073736                if (orig_mode != posix_perms) {
    3708                         int sret = -1;
    3709 
    37103737                        DEBUG(3,("set_nt_acl: chmod %s. perms = 0%o.\n",
    37113738                                fsp->fsp_name, (unsigned int)posix_perms ));
Note: See TracChangeset for help on using the changeset viewer.