Ignore:
Timestamp:
Nov 12, 2012, 5:38:52 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: update branche to 3.5.16

Location:
branches/samba-3.5.x/source3/smbd
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.5.x/source3/smbd/notify.c

    r590 r736  
    367367}
    368368
     369static void notify_parent_dir(connection_struct *conn,
     370                                uint32 action, uint32 filter,
     371                                const char *path)
     372{
     373        struct smb_filename smb_fname_parent;
     374        char *parent;
     375        const char *name;
     376        char *oldwd;
     377
     378        if (!parent_dirname(talloc_tos(), path, &parent, &name)) {
     379                DEBUG(1, ("Can't get parent dirname, giving up\n"));
     380                return;
     381        }
     382
     383        ZERO_STRUCT(smb_fname_parent);
     384        smb_fname_parent.base_name = parent;
     385
     386        oldwd = vfs_GetWd(parent, conn);
     387        if (oldwd == NULL) {
     388                DEBUG(1, ("vfs_GetWd failed!\n"));
     389                goto done;
     390        }
     391        if (vfs_ChDir(conn, conn->connectpath) == -1) {
     392                DEBUG(1, ("Could not chdir to connect path!\n"));
     393                goto done;
     394        }
     395
     396        if (SMB_VFS_STAT(conn, &smb_fname_parent) == -1) {
     397                goto chdir_done;
     398        }
     399
     400        notify_onelevel(conn->notify_ctx, action, filter,
     401                        SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent.st),
     402                        name);
     403chdir_done:
     404        vfs_ChDir(conn, oldwd);
     405done:
     406        TALLOC_FREE(parent);
     407}
     408
    369409void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
    370410                  const char *path)
    371411{
    372         char *fullpath;
    373         char *parent;
    374         const char *name;
     412        char *fullpath = NULL;
    375413
    376414        if (path[0] == '.' && path[1] == '/') {
    377415                path += 2;
    378416        }
    379         if (parent_dirname(talloc_tos(), path, &parent, &name)) {
    380                 struct smb_filename smb_fname_parent;
    381 
    382                 ZERO_STRUCT(smb_fname_parent);
    383                 smb_fname_parent.base_name = parent;
    384 
    385                 if (SMB_VFS_STAT(conn, &smb_fname_parent) != -1) {
    386                         notify_onelevel(conn->notify_ctx, action, filter,
    387                             SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent.st),
    388                             name);
    389                 }
    390         }
     417        notify_parent_dir(conn, action, filter, path);
    391418
    392419        fullpath = talloc_asprintf(talloc_tos(), "%s/%s", conn->connectpath,
  • branches/samba-3.5.x/source3/smbd/nttrans.c

    r733 r736  
    133133                             total_sent_thistime + alignment_offset
    134134                             + data_alignment_offset);
    135 
    136                 /*
    137                  * We might have had SMBnttranss in req->inbuf, fix that.
    138                  */
    139                 SCVAL(req->outbuf, smb_com, SMBnttrans);
    140135
    141136                /*
     
    30693064        show_msg((char *)req->inbuf);
    30703065
     3066        /* Windows clients expect all replies to
     3067           an NT transact secondary (SMBnttranss 0xA1)
     3068           to have a command code of NT transact
     3069           (SMBnttrans 0xA0). See bug #8989 for details. */
     3070        req->cmd = SMBnttrans;
     3071
    30713072        if (req->wct < 18) {
    30723073                reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
  • branches/samba-3.5.x/source3/smbd/open.c

    r733 r736  
    22972297        SMB_ASSERT(!is_ntfs_stream_smb_fname(smb_dname));
    22982298
    2299         /* Ensure we have a directory attribute. */
    2300         file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
     2299        if (!(file_attributes & FILE_FLAG_POSIX_SEMANTICS)) {
     2300                /* Ensure we have a directory attribute. */
     2301                file_attributes |= FILE_ATTRIBUTE_DIRECTORY;
     2302        }
    23012303
    23022304        DEBUG(5,("open_directory: opening directory %s, access_mask = 0x%x, "
  • branches/samba-3.5.x/source3/smbd/oplock_linux.c

    r414 r736  
    7575        int ret;
    7676
     77        /* First set the signal handler. */
     78        if (linux_set_lease_sighandler(fd) == -1) {
     79                return -1;
     80        }
    7781        ret = fcntl(fd, F_SETLEASE, leasetype);
    7882        if (ret == -1 && errno == EACCES) {
    7983                set_effective_capability(LEASE_CAPABILITY);
     84                /*
     85                 * Bug 8974 - work around Linux kernel bug
     86                 * https://bugzilla.kernel.org/show_bug.cgi?id=43336.
     87                 * "fcntl(F_SETLEASE) resets signal number when
     88                 *  called multiple times"
     89                 */
     90                if (linux_set_lease_sighandler(fd) == -1) {
     91                        return -1;
     92                }
    8093                ret = fcntl(fd, F_SETLEASE, leasetype);
    8194        }
  • branches/samba-3.5.x/source3/smbd/server.c

    r668 r736  
    804804                        test = False;
    805805                }
     806                TALLOC_FREE(fname);
    806807        }
    807808
  • branches/samba-3.5.x/source3/smbd/service.c

    r480 r736  
    751751                        return NULL;
    752752                }
     753
     754                /* We don't want to replace the original sanitized_username
     755                   as it is the original user given in the connect attempt.
     756                   This is used in '%U' substitutions. */
     757                TALLOC_FREE(forced_serverinfo->sanitized_username);
     758                forced_serverinfo->sanitized_username =
     759                        talloc_move(forced_serverinfo,
     760                                        &conn->server_info->sanitized_username);
    753761
    754762                TALLOC_FREE(conn->server_info);
  • branches/samba-3.5.x/source3/smbd/trans2.c

    r733 r736  
    862862                reply_outbuf(req, 10, total_sent_thistime + alignment_offset
    863863                             + data_alignment_offset);
    864 
    865                 /*
    866                  * We might have SMBtrans2s in req which was transferred to
    867                  * the outbuf, fix that.
    868                  */
    869                 SCVAL(req->outbuf, smb_com, SMBtrans2);
    870864
    871865                /* Set total params and data to be sent */
     
    85858579        show_msg((char *)req->inbuf);
    85868580
     8581        /* Windows clients expect all replies to
     8582           a transact secondary (SMBtranss2 0x33)
     8583           to have a command code of transact
     8584           (SMBtrans2 0x32). See bug #8989
     8585           and also [MS-CIFS] section 2.2.4.47.2
     8586           for details.
     8587        */
     8588        req->cmd = SMBtrans2;
     8589
    85878590        if (req->wct < 8) {
    85888591                reply_nterror(req, NT_STATUS_INVALID_PARAMETER);
Note: See TracChangeset for help on using the changeset viewer.