Changeset 746 for vendor/current/source3/smbd/notify.c
- Timestamp:
- Nov 27, 2012, 4:56:06 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/smbd/notify.c
r740 r746 346 346 } 347 347 348 static 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); 379 chdir_done: 380 vfs_ChDir(conn, oldwd); 381 done: 382 TALLOC_FREE(parent); 383 } 384 348 385 void notify_fname(connection_struct *conn, uint32 action, uint32 filter, 349 386 const char *path) 350 387 { 351 388 char *fullpath; 352 char *parent;353 const char *name;354 389 355 390 if (path[0] == '.' && path[1] == '/') { 356 391 path += 2; 357 392 } 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); 370 394 371 395 fullpath = talloc_asprintf(talloc_tos(), "%s/%s", conn->connectpath,
Note:
See TracChangeset
for help on using the changeset viewer.