Bug 8882 - Broken processing of %U with vfs_full_audit when force user is set
Broken processing of %U with vfs_full_audit when force user is set
Status: RESOLVED FIXED
Product: Samba 3.5
Classification: Unclassified
Component: VFS Modules
unspecified
All All
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on:
Blocks: 8595
  Show dependency treegraph
 
Reported: 2012-04-19 09:38 UTC by Chetan Chauhan
Modified: 2012-06-05 18:57 UTC (History)
1 user (show)

See Also:


Attachments
Patch for 3.5.x. (704 bytes, patch)
2012-04-21 00:28 UTC, Jeremy Allison
no flags Details
git-am fix for 3.5.x. (1.14 KB, patch)
2012-04-23 23:21 UTC, Jeremy Allison
metze: review+
Details
git-am fix for 3.6.x. (1.14 KB, patch)
2012-04-24 00:50 UTC, Jeremy Allison
metze: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chetan Chauhan 2012-04-19 09:38:29 UTC
I'm using full_audit with the below conf -

full_audit:prefix = %U|%M|%m|%S

With the above conf , %U is supposed to show the "initial user" at time of connection to the share. However in shares where i have set
force user = bit

full_audit logs %U as bit , for example -
Apr 19 13:33:21 backend smbd[24603]: bit|192.168.1.14|turn|cache|open|ok|r|drivers/wlan/Realtek RTL8191SE sp47860.exe

No matter what user connects to the share , %U always expands to the force user setting. In vfs_full_audit.c , audit_prefix calls -> talloc_sub_advanced which seems to return the wrong value for %U . I have checked in non-talloc versions of samba going back to 3.0.2x and there i couldn't find this bug. In these old versions , %U expands correctly to the connecting user.
Comment 1 Jeremy Allison 2012-04-21 00:27:13 UTC
The problem occurs in the newer make_serverinfo_from_username() function - this uses the new unix username for both the SMB users as for the unix user. I have a fix for this.

Jeremy.
Comment 2 Jeremy Allison 2012-04-21 00:28:46 UTC
Created attachment 7471 [details]
Patch for 3.5.x.

Can you try this patch to see if it fixes your issue in 3.5.x ? If so I'll upload git-am fixes for 3.5.x and 3.6.x and get them reviewed for the next releases.

Jeremy.
Comment 3 Jeremy Allison 2012-04-23 23:21:58 UTC
Created attachment 7476 [details]
git-am fix for 3.5.x.

Based on what went into master.
Comment 4 Jeremy Allison 2012-04-24 00:50:39 UTC
Created attachment 7477 [details]
git-am fix for 3.6.x.
Comment 5 Chetan Chauhan 2012-05-10 08:59:09 UTC
Sorry for the delay in a reply , been away on business quite a bit since i posted this bug. I will test this patch against samba 3.5.4 on a maverick server which has the bug.

Also, most of my primary servers are on lucid 10.04 which has samba 3.4.7 , can you make a patch for 3.4.7 which i can test too ? Cause even 3.4.7 has the same bug , but 3.4.3 on an older server seems to work fine.
Comment 6 Stefan Metzmacher 2012-05-24 06:52:32 UTC
Comment on attachment 7477 [details]
git-am fix for 3.6.x.

Looks ok
Comment 7 Stefan Metzmacher 2012-05-24 06:52:56 UTC
Comment on attachment 7476 [details]
git-am fix for 3.5.x.

Looks ok
Comment 8 Stefan Metzmacher 2012-05-24 06:53:26 UTC
Karolin, please pick for the releases
Comment 9 Karolin Seeger 2012-05-28 19:36:49 UTC
Pushed to v3-5-test and v3-6-test.
Closing out bug report.

Thanks!
Comment 10 Michael Adam 2012-05-31 21:29:28 UTC
(In reply to comment #7)
> Comment on attachment 7476 [details]
> git-am fix for 3.5.x.
> 
> Looks ok

Writing "Looks OK" seems to have taken precedence over giving review flag "-" ... ;-)
Comment 11 Stefan Metzmacher 2012-05-31 22:09:16 UTC
Comment on attachment 7476 [details]
git-am fix for 3.5.x.

Fix review flag
Comment 12 Karolin Seeger 2012-06-05 18:57:36 UTC
(In reply to comment #10)
> (In reply to comment #7)
> > Comment on attachment 7476 [details] [details]
> > git-am fix for 3.5.x.
> > 
> > Looks ok
> 
> Writing "Looks OK" seems to have taken precedence over giving review flag "-"
> ... ;-)

plus Metze's "Karolin, please pick for the releases" it's pretty clear that the "-" was an accident.