2.1alpha feature in smbclient - rpcclient also
Dave.Stevenson at durham.ac.uk
Dave.Stevenson at durham.ac.uk
Sat Oct 2 13:10:47 GMT 1999
I see a similar problem in rpcclient re Environment variable handling
the USER getenv splits up user%password OK but then the line
password[0]=0;
blitzes it! Minor fiddling to make it work as I expected .
diffs follow
FOR SMBCLIENT .... NB Sept 10 CVS Code
*** client.c.orig Sat Oct 2 12:20:14 1999
--- client.c Sat Oct 2 12:21:54 1999
***************
*** 2147,2152 ****
--- 2147,2154 ----
if (getenv("USER")) {
pstrcpy(username,getenv("USER"));
+ /* DLS hack */
+ explicit_user=True;
/* modification to support userid%passwd syntax in the USER var
25.Aug.97, jdblair at uab.edu */
***************
*** 2174,2179 ****
--- 2176,2184 ----
if (*username == 0 && getenv("LOGNAME")) {
pstrcpy(username,getenv("LOGNAME"));
+ /* DLS hack */
+ explicit_user=True;
+
strupper(username);
}
----------------------------------- snip ---------------------------------
FOR RPCCLIENT
*** rpcclient.c.orig Sat Oct 2 13:49:02 1999
--- rpcclient.c Sat Oct 2 13:56:01 1999
***************
*** 628,640 ****
strupper(smb_cli->user_name);
}
! password[0] = 0;
/* modification to support PASSWD environmental var
25.Aug.97, jdblair at uab.edu */
if (getenv("PASSWD"))
{
pstrcpy(password,getenv("PASSWD"));
}
if (*smb_cli->user_name == 0 && getenv("LOGNAME"))
--- 628,646 ----
strupper(smb_cli->user_name);
}
! /* DLS hack - removed line
! password[0] = 0; */
/* modification to support PASSWD environmental var
25.Aug.97, jdblair at uab.edu */
if (getenv("PASSWD"))
{
+ /* DLS hack null password just in case cos I dont know what pstrcpy does */
+ password[0]=0;
pstrcpy(password,getenv("PASSWD"));
+ /* DLS hack */
+ got_pass = True;
+
}
if (*smb_cli->user_name == 0 && getenv("LOGNAME"))
More information about the samba-ntdom
mailing list