Hi, all:
Just come across a strange problem with the usage of "net rpc ...".
If a user's password has the dollar character, it will be discarded, thus
cause login failure. For example, if username is "abc" and password is
"$1111". I run the command:
======================================================net rpc -I 12.34.56.78 -U
abc%$1111 USER INFO abc
======================================================to determine the
user's group.
What I get is:
======================================================Could not connect to
server 12.34.56.78
The username or password was not correct.
Connection failed: NT_STATUS_LOGON_FAILURE
======================================================
I add some printf in net.c:
====================================================== int main(int argc, const
char **argv)
{
......
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
......
case 'U':
opt_user_specified = True;
d_fprintf(stderr, "%s(): opt_user_name is
%s\n", __FUNCTION__, opt_user_name); //xq
opt_user_name = SMB_STRDUP(opt_user_name);
p = strchr(opt_user_name,'%');
if (p) {
*p = 0;
opt_password = p+1;
d_fprintf(stderr, "%s(): opt_password is
%s\n", __FUNCTION__, opt_password); //xq
}
break;
......
}
}
......
}
======================================================
To my surprise, the output is:
======================================================main(): opt_user_name is
abc%111
main(): opt_password is 111
Could not connect to server 13.121.8.185
The username or password was not correct.
Connection failed: NT_STATUS_LOGON_FAILURE
======================================================This means the
"net" binary cannot correctly read in all characters in the password
field if there is a $ in it, right? Any fix to this problem? (I am using
samba-3.0.25a to compile the "net" binary)
TIA,
Xu Qiang
It seems that the "net" binary treat "$1" as something with special meaning, as in shell script. Thus, the password "$1111" -> "111". Another evidence is that when I change the password for user "abc" from "$1111" to "11$11", and run the command: ======================================================net rpc -I 12.34.56.78 -U abc%11$11 USER INFO abc ====================================================== The output is still: ======================================================main(): opt_user_name is abc%111 main(): opt_password is 111 Could not connect to server 12.34.56.78 The username or password was not correct. Connection failed: NT_STATUS_LOGON_FAILURE ======================================================Here, it is very clear that "$1" is eaten. Any suggestions?
Xu, Qiang (FXSGSC) wrote:> Hi, all: > > Just come across a strange problem with the usage of "net rpc ...". > > If a user's password has the dollar character, it will be discarded, thus cause login failure. For example, if username is "abc" and password is "$1111". I run the command: > <snip> > TIA, > Xu Qiang > >This isn't a samba issue, it's your shell. $ echo 111$111 11111 $ echo '111$111' 111$111 Enclose your password in single quotes. *Michael Heydon - IT Administrator * michaelh@jaswin.com.au <mailto:michaelh@jaswin.com.au>
Reasonably Related Threads
- transfer to Microsoft Distributed File Service
- Autogenerating of operatingSystem and operatingSystemVersion attributes in AD
- Bug in cac_Connect ?
- Can login with a bogus username which ends with a "/" or a "\"
- Failure to transfer files to Win2008 Server Clusters