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

Update 3.3 to 3.3.9

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  
    408408                                        fsp->fsp_name);
    409409
    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] == '/')) {
    411416                        TALLOC_FREE(d_fullname);
    412417                        TALLOC_FREE(d1_fullname);
     
    414419                }
    415420                TALLOC_FREE(d1_fullname);
    416         } 
     421        }
    417422
    418423        TALLOC_FREE(d_fullname);
  • branches/samba-3.3.x/source/smbd/notify_inotify.c

    r206 r342  
    233233        struct inotify_event *e0, *e;
    234234        uint32_t prev_cookie=0;
     235        NTSTATUS status;
    235236
    236237        /*
     
    248249        if (e == NULL) return;
    249250
    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)));
    252255                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);
    253259                return;
    254260        }
  • 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 ));
  • branches/samba-3.3.x/source/smbd/reply.c

    r242 r342  
    958958        }
    959959
    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                }
    964973        }
    965974
     
    10681077                        return;
    10691078                }
    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                        }
    10751093                }
    10761094
     
    23022320        files_struct *fsp;
    23032321        uint32 dirtype_orig = dirtype;
     2322        bool posix_paths = lp_posix_pathnames();
     2323        int ret;
    23042324        NTSTATUS status;
    23052325
     
    23102330        }
    23112331
    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) {
    23132338                return map_nt_error_from_unix(errno);
    23142339        }
     
    23962421                 FILE_OPEN,             /* create_disposition*/
    23972422                 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,
    23992426                 0,                     /* oplock_request */
    24002427                 0,                     /* allocation_size */
Note: See TracChangeset for help on using the changeset viewer.