Unix-side login script under Samba???

Richard Sharpe sharpe at ns.aus.com
Wed Dec 6 02:17:57 GMT 2000


At 12:04 PM 12/6/00 +0100, Simo Sorce wrote:
>On Wed, 6 Dec 2000, Richard Sharpe wrote:
>
>> At 10:25 AM 12/6/00 +0100, Johan Östensson wrote:
>> >Wouldn't a 'real' unix-side loginscript function be a cool thing for
future
>> >Samba versions? (I would do a patch myself if I could :/).
>>
>> Ummm, why? You can already do it with a 'root preexec' for the netlogon
>> share, and since all you are doing is generating a netlogin.bat.
>
>I think Johan want to execute something on the server (not simply generate
>a batch) and it need it execute only at user logon (eg. for reporting
>purposes) not at every access to a share!

Well, there is already the utmp patch for reporting.

>>
>> Also, it does not matter that netlogon is accessed twice (mapped twice) as
>> the function performed by a 'root exec' should be pretty much idempotent.
>>
>> Just what do you think the 'unix-side login script function' would do?
>
>I may think for example to enable a service only if a particular user is
>logged on and disable it when he logs of!

But that is idempotent, so doing it out of a 'root exec' would work, but
also, you could do:

   include = /etc/smb.conf.%U

And as long as the file /etc/smb.conf.fred exists, it will be included.

Thus, you can enable any services you want for any users.

>> >BTW this is not a 'request' in any way, just an idea. Samba is very nice
>> >without this too :)
>> >
>> >/johan
>> >
>> >> -----Ursprungligt meddelande-----
>> >> Från: Richard Sharpe [mailto:sharpe at ns.aus.com]
>> >> Skickat: den 5 december 2000 23:01
>> >> Till: johan.ostensson at orebro.lantmen.se; High Mobley; Gerald Carter;
>> >> samba-ntdom at samba.org
>> >> Ämne: Re: Unix-side login script under Samba???
>> >>
>> >>
>> >> At 05:29 PM 12/5/00 +0000, High Mobley wrote:
>> >> >Gerald Carter wrote:
>> >> >>
>> >> >> Sergei Makarov wrote:
>> >> >> >
>> >> >> > Try something like this:
>> >> >> >
>> >> >> >  [netlogon]
>> >> >> >    comment = Network Logon Service
>> >> >> >    path = /path/to/share/netlogon
>> >> >> >    root preexec = unix-side-script-when-user-logs-on %U %m %a %I
>> >> >>
>> >> >> [netlogon] actually gets connected to twice IIRC.  Check smbd logs
>> >> >> to verify this.
>> >> >>
>> >> >> CHeers, jerry
>> >> >
>> >> >You're correct about this. I've been watching the script
>> >> output, which
>> >> >specifies the share that the client is connecting to.
>> >> Netlogon came up
>> >> >twice per login by WinNT clients machines logging into the
>> >> Samba domain.
>> >>
>> >> Netlogon is accessed once to get the login script, and once
>> >> to check for
>> >> policies.
>> >>
>> >> I think if you switch off policies, it does not do the second access.
>> >>
>> >> >-High Mobley
>> >>
>> >>
>> >> Regards
>> >> -------
>> >> Richard Sharpe, sharpe at ns.aus.com
>> >> Samba (Team member, www.samba.org), Ethereal (Team member,
>> >www.zing.org)
>> >Contributing author, SAMS Teach Yourself Samba in 24 Hours
>> >Author, Special Edition, Using Samba
>> >
>> >
>> >
>> >
>>
>> Regards
>> -------
>> Richard Sharpe, sharpe at ns.aus.com
>> Samba (Team member, www.samba.org), Ethereal (Team member, www.zing.org)
>> Contributing author, SAMS Teach Yourself Samba in 24 Hours
>> Author, Special Edition, Using Samba
>>
>>
>>
>>
>
>-- 
>Simo Sorce - Integrazione Sistemi Unix/Windows - Politecnico di Milano
>E-mail: simo.sorce at polimi.it
>Tel.int: 02 2399 2425 - Fax.int. 02 2399 2451
>-----------------------------------------------------------------
>Be happy, use Linux!
>
>

Regards
-------
Richard Sharpe, sharpe at ns.aus.com
Samba (Team member, www.samba.org), Ethereal (Team member, www.zing.org)
Contributing author, SAMS Teach Yourself Samba in 24 Hours
Author, Special Edition, Using Samba






More information about the samba-ntdom mailing list