Somebody help me to find where is source code(file) to capture following information in samba4

Andrew Bartlett abartlet at samba.org
Mon Aug 6 06:21:46 GMT 2007


On Sat, 2007-08-04 at 13:25 +0800, KS Tan wrote:
> Hi all,
> 
> Due to I don't have much knowledge in samba source code and I don't want
> to mess up the development. So I want to do my own testing inside the
> samba 4 source code. So, anybody can tell me which file I should edit to
> achive following task:-
> 
> 1. After user logon, I want to know who is the user and I want to
> perform some action inside the source code.

What type of logon are you looking for?  

 - CIFS connections (such as mounting a drive)?
 - KDC ticket issue?
 - NT4-style SamLogon over NETLOGON?

> 2. After user logout, I want to know who is the user  and I want to
> perform some action inside the source code.

We can only detect logout for CIFS connections, when the user
disconnects. 

> 3. After user logon, I want to choose a script and ask the user to run
> the script.

Just set the scriptPath attribute on the user. 

> I don't mind to open up 10-20 pages of source code to achieve my goal,
> but the problem is I totally don't know where to start.

All logins (and ticket issue) will at some point go via
authsam_account_ok() in auth/sam.c, to check that the user is
authorized.  

New CIFS sessions will be recorded in smbsrv_session_new() in
smb_server/session.c

As I mention above, logoffs are tricky, but see
smbsrv_session_destructor() in smb_server/session.c for CIFS sessions.  

I hope this helps.  I could add some hooks (particularly for scripts) to
these events, to help admins instrument this code, if it would be
useful.

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Red Hat Inc.                  http://redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20070806/981f5f39/attachment.bin


More information about the samba-technical mailing list