Re: How prevent many logins

2002-10-04 Thread Mike Gerdts

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





Re: How prevent many logins

2002-10-04 Thread Andrew Bartlett

Mike Gerdts wrote:
 
 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?

PAM is per-session, not per-tree.  That is why it is more suitable for
this task.

Users authenticate once to the server, then mount multiple shares on
that connection.

Andrew Bartlett

-- 
Andrew Bartlett [EMAIL PROTECTED]
Manager, Authentication Subsystems, Samba Team  [EMAIL PROTECTED]
Student Network Administrator, Hawker College   [EMAIL PROTECTED]
http://samba.org http://build.samba.org http://hawkerc.net



How prevent many logins

2002-10-03 Thread Marcus Grando


Hi list,

How prevent user log many times on different machines?

Samba log connections? how read this information on samba?

Regards

--
Marcus Grando
Tecnologia da Informação
marcus at big dot univali dot br
marcus at sbh dot eng dot br




Re: How prevent many logins

2002-10-03 Thread Marcus Grando


Hi,

On Thu, 3 Oct 2002, Andrew Bartlett wrote:

 Marcus Grando wrote:
 
  Hi list,
 
  How prevent user log many times on different machines?
 
  Samba log connections? how read this information on samba?

 There is currently no internal mechinism for dealing with this, but a
 PAM module might be able to construct a suitable solution.

 (Then setup samba --with-pam and 'obey pam restrictions' in smb.conf).

But I dont use pam.

Any other method?


 Andrew Bartlett

 --
 Andrew Bartlett [EMAIL PROTECTED]
 Manager, Authentication Subsystems, Samba Team  [EMAIL PROTECTED]
 Student Network Administrator, Hawker College   [EMAIL PROTECTED]
 http://samba.org http://build.samba.org http://hawkerc.net


--
Marcus Grando
Tecnologia da Informação
marcus at big dot univali dot br
marcus at sbh dot eng dot br