Ignore:
Timestamp:
Nov 27, 2012, 4:56:06 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated vendor to 3.6.9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/smbd/notify.c

    r740 r746  
    346346}
    347347
     348static void notify_parent_dir(connection_struct *conn,
     349                              uint32 action, uint32 filter,
     350                              const char *path)
     351{
     352        struct smb_filename smb_fname_parent;
     353        char *parent;
     354        const char *name;
     355        char *oldwd;
     356
     357        if (!parent_dirname(talloc_tos(), path, &parent, &name)) {
     358                return;
     359        }
     360
     361        ZERO_STRUCT(smb_fname_parent);
     362        smb_fname_parent.base_name = parent;
     363
     364        oldwd = vfs_GetWd(parent, conn);
     365        if (oldwd == NULL) {
     366                goto done;
     367        }
     368        if (vfs_ChDir(conn, conn->connectpath) == -1) {
     369                goto done;
     370        }
     371
     372        if (SMB_VFS_STAT(conn, &smb_fname_parent) == -1) {
     373                goto chdir_done;
     374        }
     375
     376        notify_onelevel(conn->notify_ctx, action, filter,
     377                        SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent.st),
     378                        name);
     379chdir_done:
     380        vfs_ChDir(conn, oldwd);
     381done:
     382        TALLOC_FREE(parent);
     383}
     384
    348385void notify_fname(connection_struct *conn, uint32 action, uint32 filter,
    349386                  const char *path)
    350387{
    351388        char *fullpath;
    352         char *parent;
    353         const char *name;
    354389
    355390        if (path[0] == '.' && path[1] == '/') {
    356391                path += 2;
    357392        }
    358         if (parent_dirname(talloc_tos(), path, &parent, &name)) {
    359                 struct smb_filename smb_fname_parent;
    360 
    361                 ZERO_STRUCT(smb_fname_parent);
    362                 smb_fname_parent.base_name = parent;
    363 
    364                 if (SMB_VFS_STAT(conn, &smb_fname_parent) != -1) {
    365                         notify_onelevel(conn->notify_ctx, action, filter,
    366                             SMB_VFS_FILE_ID_CREATE(conn, &smb_fname_parent.st),
    367                             name);
    368                 }
    369         }
     393        notify_parent_dir(conn, action, filter, path);
    370394
    371395        fullpath = talloc_asprintf(talloc_tos(), "%s/%s", conn->connectpath,
Note: See TracChangeset for help on using the changeset viewer.