TNG: making %U work again for logon path et. al.

Luke Kenneth Casson Leighton lkcl at samba.org
Tue Feb 22 03:22:15 GMT 2000


*giggle.  ok, i like it :)  actually, you should be putting the nt
user name in there.

> > i described this in great detail on samba tech, last month.  see
> > archives for details.
> 
> I'll see if I can find it.
> 
> Thanks!
> 
>  - Pat
> 
> diff -u -r1.5.2.6 sampass.c
> --- sampass.c	2000/02/21 20:26:14	1.5.2.6
> +++ sampass.c	2000/02/21 22:54:10
> @@ -79,6 +79,7 @@
>  static struct sam_passwd *getsamfile21pwent(void *vp)
>  {
>  	struct sam_passwd *user;
> +        user_struct bogus_user_struct;
>  
>  	static pstring full_name;
>  	static pstring home_dir;
> @@ -90,6 +91,8 @@
>  
>  	DEBUG(5,("getsamfile21pwent\n"));
>  
> +        ZERO_STRUCT(bogus_user_struct);
> +
>  	user = pwdb_smb_to_sam(getsmbfilepwent(vp));
>  	if (user == NULL)
>  	{
> @@ -101,11 +104,14 @@
>  	 * as putting the nt name in is a bit meaningless.
>  	 */
>  
> +        /* HACK to make %U work in substitutions below */
> +        fstrcpy (bogus_user_struct.requested_name, user->unix_name);
> +
>  	pstrcpy(full_name    , "");
> -	pstrcpy(logon_script , lp_logon_script       (NULL));
> -	pstrcpy(profile_path , lp_logon_path         (NULL));
> -	pstrcpy(home_drive   , lp_logon_drive        (NULL));
> -	pstrcpy(home_dir     , lp_logon_home         (NULL));
> +	pstrcpy(logon_script , lp_logon_script (&bogus_user_struct));
> +	pstrcpy(profile_path , lp_logon_path (&bogus_user_struct));
> +	pstrcpy(home_drive   , lp_logon_drive (&bogus_user_struct));
> +	pstrcpy(home_dir     , lp_logon_home (&bogus_user_struct));
>  	pstrcpy(acct_desc    , "");
>  	pstrcpy(workstations , "");
> 

<a href=" mailto:lkcl at samba.org" > Luke Kenneth Casson Leighton    </a>
<a href=" http://cb1.com/~lkcl"  > Samba and Network Development   </a>
<a href=" http://samba.org"      > Samba Web site                  </a>
<a href=" http://www.iss.net"    > Internet Security Systems, Inc. </a>
<a href=" http://mcp.com"        > Macmillan Technical Publishing  </a>
 
ISBN1578701503 DCE/RPC over SMB: Samba and Windows NT Domain Internals



More information about the samba-technical mailing list