(wtmp) Suggestion to samba

Joao Carlos Mendes Luis jonny at jonny.eng.br
Wed May 13 21:27:45 GMT 1998


#define quoting(Edan Idzerda)
// Joao Carlos Mendes Luis <jonny at coe.ufrj.br> wrote:
// >   I think it would be useful if samba had a utmp log interface.
// > I know that it's possible to see who is logged with smbstatus, but
// > sometimes a simple who(1) or w(1) is more efficient and ubiquitous.
// 
// If you were to search for 'wtmp' in the 1997 archives 
// (via the Samba web pages), you would find one interesting posting:
// 
//     http://samba.anu.edu.au/samba/digest/1997/97oct/0175.html
// 
// This posting describes using "sessreg" to log to utmp/wtmp.
// sessreg is affiliated with xdm--it logs to utmp/wtmp as part
// for users logging in through it.  You can use the 
// "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
twice, would it be logged twice ?  Also, BSD utmp uses terminal
as an index to the utmp table, and terminals must be registered at
the /etc/ttys file.  Using samba "slots" instead of "pids" to
register these entries would enable utmp logging in BSD systems.
It would be probable more difficult to find which process is associated
with the user, but another change to samba could solve this: Like
sendmail, change the ps strings to something like:

 8574  ??  Ss     0:00.27 smbd smb01 jonny
 8575  ??  Ss     0:00.10 smbd smb02 user2

 In one glance you could see the slot and the user for that process
connection.  For operating systems that do not allow such operation,
the slot could simply be the pid (as these systens in general do
not have the slot problem in utmp).

// Note, though, sessreg doesn't modify utmpx/wtmpx, which is a bummer
// for OS's like Solaris 2.  rpc.rusersd and finger both look at utmpx,
// not utmp, like "w" does.  I haven't decided whether to hack up 
// sessreg or to use something else, but that's a different story.  :)

Yes, yes.  Also, one could think of a box without no X support, just
for file serving.  I really prefer something embedded than a kludge
with external programs.

Anyway, it's just a suggestion.  It could be implemented by some good
sould with more knowledge on samba sources.  Or not...

Thank for your attention,

					Jonny

--
Joao Carlos Mendes Luis			jonny at gta.ufrj.br
+55 21 290-4698 ( Job )			jonny at coppe.ufrj.br
M.Sc. Student				Electrical Engineering
Universidade Federal do Rio de Janeiro


More information about the samba mailing list