(wtmp) Suggestion to samba

Joao Carlos Mendes Luis jonny at jonny.eng.br
Wed May 27 10:48:18 GMT 1998


#define quoting(Edan Idzerda)
// Ok, so "postponing" email is evil.
// 
// On Wed, 13 May 1998, Joao Carlos Mendes Luis wrote:
// 
// > #define quoting(Edan Idzerda)
// > // "root preexec/postexec" hooks to use any program you like to 
// > // keep track of logins and logouts.
// > 
// > I have seen that, but it's not yet practical.  First, it does
// > not log sessions, but mappings.  If a user delete that mapping,
// > it will be registered as logged out.  If it maps that resource
// 
// Oh ho hoh... How does Samba define a session otherwise?  What other
// notion does smbd have of a session?  While I've only *collected*
// a bunch of vague documentation on SMB/CIFS, I don't believe that
// Samba has any connection with a client once they have disconnected
// from a share.

I would define a session by an instance of the smbd process.  AFAIK,
each user logged creates a single instance of that process, and one
process is enough to serve all mappings.

// Perhaps there is still a SessionID hanging around, but then the
// only way to register a "logout" is by detecting a login by a
// different user from the same host.  Kludgy, like you say.

Or by detecting the connection close from the process associated.

// > Anyway, it's just a suggestion.  It could be implemented by some good
// > sould with more knowledge on samba sources.  Or not...
// 
// I thought about it at one point, but how else could it be handled
// by smbd?  Around here, it's useful enough to measure the time between
// the mapping and unmapping of a 'home directory' share as login/logout.

Between fork() and exit(), maybe ?

What still makes me uneasy about sessreg is that it does not log
into utmp in BSD systems.  Probably easy to work around, though,
but surely easier with access to the shared memory region of smbd,
in order to get the "session index" instead of the pid and translate
it into a pseudo terminal.

					Jonny

--
Joao Carlos Mendes Luis            M.Sc. Student
jonny at jonny.eng.br                 Universidade Federal do Rio de Janeiro


More information about the samba mailing list