Bug 6557 - Do not work VFS full_audit
Summary: Do not work VFS full_audit
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: VFS (show other bugs)
Version: 3.0.23c
Hardware: x86 FreeBSD
: P3 normal
Target Milestone: none
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL: http://www.bgita.ru
Keywords:
: 6882 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-16 08:15 UTC by storoge
Modified: 2010-02-18 14:05 UTC (History)
3 users (show)

See Also:


Attachments
My smb conf used with the master branch (1015 bytes, patch)
2010-02-15 14:30 UTC, Holger Hetterich
no flags Details
git-am patch for 3.5.0rc3 (3.50 KB, patch)
2010-02-17 12:14 UTC, Jeremy Allison
vl: review+
Details
git-am patch for 3.4.6. (3.43 KB, patch)
2010-02-17 12:48 UTC, Jeremy Allison
vl: review+
Details
git-am fix for 3.3.11. (3.43 KB, patch)
2010-02-17 12:49 UTC, Jeremy Allison
vl: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description storoge 2009-07-16 08:15:41 UTC
Do not work VFS full_audit

Part of my smb.conf:

[exchanger]
        vfs object = full_audit
        full_audit:prefix = %u|%I
        full_audit:failure = none
        full_audit:success = all
        full_audit:facility = local5
        full_audit:priority = notice
        comment = Обменник
        path = /exchanger
        read only = No
        create mask = 0777
        force create mode = 0777
        directory mask = 0777
        veto files = /autorun.*/*sex*/

In log.smbd

[2009/07/16 17:12:29, 0] modules/vfs_full_audit.c:log_success(682)
  log_success() failed to get vfs_handle->data!
[2009/07/16 17:12:29, 0] modules/vfs_full_audit.c:log_success(682)
  log_success() failed to get vfs_handle->data!
[2009/07/16 17:12:29, 0] modules/vfs_full_audit.c:log_success(682)
  log_success() failed to get vfs_handle->data!
[2009/07/16 17:12:34, 0] modules/vfs_full_audit.c:log_success(682)
  log_success() failed to get vfs_handle->data!
[2009/07/16 17:12:34, 0] modules/vfs_full_audit.c:log_success(682)
  log_success() failed to get vfs_handle->data!
[2009/07/16 17:12:34, 0] modules/vfs_full_audit.c:log_success(682)
  log_success() failed to get vfs_handle->data!
[2009/07/16 17:12:34, 0] modules/vfs_full_audit.c:log_success(682)
  log_success() failed to get vfs_handle->data!

I try another versions of samba, do not work all the same
Comment 1 Jeremy Allison 2009-07-16 16:03:39 UTC
Can you try this with Samba 3.4.0 (the latest release) to see if you can reproduce please. 3.0.x is now out of maintenance.

Jeremy.
Comment 2 Holger Hetterich 2010-02-15 14:09:11 UTC
I run into this problem when trying to test my patch for Bug #4025, when running compiled from master.
Comment 3 Volker Lendecke 2010-02-15 14:14:38 UTC
If you can get me more info how to reproduce this, it would be great!

Volker
Comment 4 Holger Hetterich 2010-02-15 14:30:50 UTC
Created attachment 5354 [details]
My smb conf used with the master branch
Comment 5 Holger Hetterich 2010-02-15 14:34:19 UTC
reproduction: use the posted smb.conf, run smbclient, copy some file, and check the logs.

When it's running the SMB_VFS_HANDLE_GET_DATA macro, the handle is lost.
Comment 6 Volker Lendecke 2010-02-15 15:34:56 UTC
Okay, we're calling REALPATH before CONNECT....

Volker
Comment 7 Volker Lendecke 2010-02-15 15:39:15 UTC
Jeremy, the canonicalize_connect_path() calls in make_connection_snum() call the VFS REALPATH operation before the VFS_CONNECT operation. I don't know if that's intended, so far I thought the VFS calls CONNECT first.

Volker
Comment 8 Holger Hetterich 2010-02-15 16:04:43 UTC
*** Bug 6882 has been marked as a duplicate of this bug. ***
Comment 9 Jeremy Allison 2010-02-16 13:44:37 UTC
This is a horrible chicken and egg problem. We need to call VFS_REALPATH in order for the path in the conn struct to be correct for the VFS_CONNECT. If we call the VFS_CONNECT first, we cannot guarantee that the conn->connectpath is correct.

Inside connection_struct we have:

        char *dirpath; <--- used in old 8.3 directory traversals.
        char *connectpath; <--- the actual path used on the filesystem for
                                this share.
        char *origpath;  <--- what was used in path="" in smb.conf.

Ideas needed for the right way to fix this.

Jeremy.
Comment 10 Volker Lendecke 2010-02-16 14:45:01 UTC
A new VFS_INIT operation?

Volker
Comment 11 Jeremy Allison 2010-02-17 12:14:59 UTC
Created attachment 5369 [details]
git-am patch for 3.5.0rc3

    Fix bug #6557 - Do not work VFS full_audit
    
    Re-arrange the operations order so SMB_VFS_CONNECT is done
    first as root (to allow modules to correctly initialize themselves).
    
    Reviewed modules to check if they needed CONNECT invoked as
    a user (which we previously did) and it turns out any of them
    that cared needed root permissions anyway.
    
    Jeremy.
Comment 12 Jeremy Allison 2010-02-17 12:48:08 UTC
Created attachment 5370 [details]
git-am patch for 3.4.6.
Comment 13 Jeremy Allison 2010-02-17 12:49:12 UTC
Created attachment 5371 [details]
git-am fix for 3.3.11.

Volker, once you're reviewed please assign to Karolin for inclusion.

Thanks !

Jeremy.
Comment 14 Volker Lendecke 2010-02-18 01:09:51 UTC
Comment on attachment 5369 [details]
git-am patch for 3.5.0rc3

Trusting you that you checked the VFS modules... :-)
Comment 15 Volker Lendecke 2010-02-18 01:13:05 UTC
Karo, please pull into the branches. This is a required patch for the wide links issue.

Volker
Comment 16 Karolin Seeger 2010-02-18 03:25:42 UTC
Pushed to all branches.
Closing out bug report.

Thanks!
Comment 17 Jeremy Allison 2010-02-18 14:05:15 UTC
FYI Volker, I checked the full_audit module with this patch.
Jeremy.