Samba 2.0.7 : utmp patch

Giulio Orsero giulioo at pobox.com
Tue May 2 10:34:25 GMT 2000


David Lee wrote:

>I have developed a patch for 2.0.7 which should address most of the known
>issues.  In particular:

I tested the above patch on linux rh61/2.2.14/glibc2.1.2.

The patch solves 2 problems:
1) wtmp logging works automatically. With plain 2.0.7 you needed "wtmp
dir = /var/log" in smb.conf.
2) "utmp consolidate" now works. With plain 2.0.7 it had an inconsistent
behavior.

There is a behavior I'm not able to reproduce, it happened to me just
once:
$ w|grep pc79
user1       smb/1    pc79              5:19pm  0.00s 37.37s   ?     -
user1       ttyp4    pc79             11:24am  0.00s  0.32s  0.02s  w
$ who -l|grep pc79
user1       smb/1    May  1 17:19 (pc79)
user1       smb/3    May  1 17:14 (pc79)
user2      smb/2    May  1 16:56 (pc79)
user1       ttyp4    May  1 11:24 (pc79)

Basically "w" is correct, "who" (and "last") shows connections that are
already closed (I turned samba off and on, and they are of before
turning samba off).
I think I'll have to truncate utmp to blank those entries.

A note on utmp consolidate:
If I understand it well, it's supposed to consolidate smb entries in
utmp/wtmp "by machine", and this is what it does.
I'm wondering if it would be more correct to consolidate "by machine"
and "by user_id". What do you think? 

This is without consolidate
user2      smb/1    pc79              6:56am  0.00s  4.84s   ?     -
user1       smb/2    pc79              6:56am  0.00s  4.84s   ?     -
user2      smb/3    pc79              6:56am  0.00s  4.84s   ?     -
This is the same situation with consolidate
user2      smb/1    pc79              6:54am  0.00s  4.80s   ?     -
Wouldn't it be better as
user2      smb/1    pc79              6:56am  0.00s  4.84s   ?     -
user1      smb/2    pc79              6:56am  0.00s  4.84s   ?     -

The user "user1" is because of user-level auth; the user "user2" is
user1 that appears as user2 because the use of "force user = user2" on a
share.

Thanks.

-- 
giulioo at pobox.com


More information about the samba-technical mailing list