diff options
author | Günther Deschner <gd@samba.org> | 2005-12-02 10:26:29 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:05:41 -0500 |
commit | 1136862e6d6058df4ed027b75dbae40374712bac (patch) | |
tree | e8a5a1ceaa8e75c6f72a7f112473fbfe9abf0227 /source/client | |
parent | 270fef5175559ba6345bb2c3e264c527a6a084c5 (diff) | |
download | samba-1136862e6d6058df4ed027b75dbae40374712bac.tar.gz samba-1136862e6d6058df4ed027b75dbae40374712bac.tar.xz samba-1136862e6d6058df4ed027b75dbae40374712bac.zip |
r12015: When smbspool tries to connect to a printer shared on a standalone
Windows XP box, smbspool has to mimic smbclient behaviour and also send
a password-less NTLMSSP session setup.
Guenther
Diffstat (limited to 'source/client')
-rw-r--r-- | source/client/smbspool.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/client/smbspool.c b/source/client/smbspool.c index aff241adeed..7fe918413d5 100644 --- a/source/client/smbspool.c +++ b/source/client/smbspool.c @@ -461,6 +461,7 @@ smb_connect(const char *workgroup, /* I - Workgroup */ { struct cli_state *cli; /* New connection */ pstring myname; /* Client name */ + struct passwd *pwd; /* * Get the names and addresses of the client and server... @@ -488,12 +489,24 @@ smb_connect(const char *workgroup, /* I - Workgroup */ if (cli ) { return cli; } + /* give a chance for a passwordless NTLMSSP session setup */ + + pwd = getpwuid(geteuid()); + if (pwd == NULL) { + return NULL; + } + + cli = smb_complete_connection(myname, server, port, pwd->pw_name, "", + workgroup, share, 0); + + if (cli) { return cli; } + /* * last try. Use anonymous authentication */ + cli = smb_complete_connection(myname, server, port, "", "", workgroup, share, 0); - /* * Return the new connection... */ |