%g in logon script (was Re: Samba 2.2.6.p1)

ian j hart ianjhart at ntlworld.com
Thu Aug 29 10:37:00 GMT 2002


"MCCALL,DON (HP-USA,ex1)" wrote:
> 
> Hi Ian,
> Problem is that "%g" macro cannot be expanded in smb.conf until AFTER a
> tconnX has
> happened - this means in effect that you can only use %g in share/service
> definitions.
> In the global section (where you would define your logon script, you would
> have to
> use %G (uppercase), which is available immediately after the sessionsetup&X.
> Hope this helps,
> Don

%G works, well caught.

Two things spring to mind.
1 This is a change in behavior from 2.2.5 so wouldn't a
note in WHATSNEW be appropriate.

2 testparm should catch this.

Hmm, three things spring to mind.
3  Top posting is evil :)

Cheers

> 
> -----Original Message-----
> From: ian j hart [mailto:ianjhart at ntlworld.com]
> Sent: Thursday, August 29, 2002 14:28
> To: David W. Chapman Jr.
> Cc: samba-technical at samba.org
> Subject: %g in logon script (was Re: Samba 2.2.6.p1)
> 
> "David W. Chapman Jr." wrote:
> >
> > This is probably something that the samba people need to see so it can be
> fixed if it hasn't already.
> >
> > > The first thing I tried failed.
> > >
> > > anaonymous listing
> > >
> > > alpha# smbclient -L //alpha
> > > added interface ip=192.168.0.2 bcast=192.168.255.255 nmask=255.255.0.0
> > > Password:
> > > session setup failed: SUCCESS - 0
> > >
> > > cf 2.2.5_3
> > >
> > > alpha# smbclient -L //alpha
> > > added interface ip=192.168.0.2 bcast=192.168.255.255 nmask=255.255.0.0
> > > Password:
> > > Anonymous login successful
> > > Domain=[CARDINALNEWMAN] OS=[Unix] Server=[Samba 2.2.5]
> > >
> > >         Sharename      Type      Comment
> > >         ---------      ----      -------
> > >         netlogon       Disk      Network Logon Service
> > >         cdrom          Disk
> > >         InterChk       Disk
> > >         cdshare        Disk
> > >         IPC$           IPC       IPC Service (Samba Server)
> > >         ADMIN$         Disk      IPC Service (Samba Server)
> > >         lp             Printer   local line printer
> > >
> > >         Server               Comment
> > >         ---------            -------
> > >         ALPHA                Samba Server
> > >         HOME                 Samba Server
> > >         SOPHOS               Samba Server
> > >         TIME                 Samba Server
> > >
> > >         Workgroup            Master
> > >         ---------            -------
> > >         CARDINALNEWMAN
> > >
> > > testparm checks out ok.
> > >
> > > build options utmp + quota
> > >
> > > Cheers
> > >
> > > --
> > > ian j hart
> > >
> 
> I've just tested with 2.2.6pre2. Same initial result. But...
> 
> First I noticed that adding "-U badusername" works!
> Then I spotted the log file filling up with
> 
> [2002/08/29 19:16:17, 0] lib/util_str.c:string_sub(1188)
>   ERROR: string overflow by 2 in string_sub(%g, 7)
> 
> Removing
> 
>        logon script = %g.bat
> 
> "fixes" the problem.
> 
> I'm using nis (not plus) if that matters.
> 
> --
> ian j hart

-- 
ian j hart



More information about the samba-technical mailing list