How prevent many logins

Mike Gerdts gerdts at bellsouth.net
Fri Oct 4 18:48:00 GMT 2002


On Thu, 2002-10-03 at 08:15, Marcus Grando wrote:

> But I dont use pam.
> 
> Any other method?

It may be tough to do with PAM as well because each time the user
authenticates to a share the PAM module would increment the number of
connections.  How many connections should be allowed?  1 for IPC?  1 for
the home directory?  How about one for a printer?

You could probably use a VFS module instead.  You would need to write
it.  The way that I would do it is something along the lines of:

grab examples/VFS/skel.c

get rid of all the functions except skel_connect.  Be sure to update
vfs_init() and skel_ops appropriately.

Replace all occurrences of skel_ with oneclient_

In oneclient_connect() (the function that used to be skel_connect()) add
code that traverses the connections TDB looking for this user connected
from a different machine.  If the user is on from another machine,
verify that connection is still good (kill(pid,0)) should work).  If the
tdb entry for the user on another machine and that smbd is really still
alive, call default_vfs_ops.disconnect().

File a bug report on the problems that come up because you are calling
disconnect() from connect().  I don't know that this will cause problems
but I would expect that it could be asking for trouble.  Then again,
maybe that execution path has already been tested by something else.

Mike





More information about the samba-technical mailing list