Bugzilla – Attachment 55194 Details for
Bug 106335
cupsd cannot talk to smb printer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
re-enable anonymous session setup with a non-zero username
samba3-anon_smbspool.diff (text/plain), 3.17 KB, created by
Guenther Deschner
on 2005-10-24 12:30:45 UTC
(
hide
)
Description:
re-enable anonymous session setup with a non-zero username
Filename:
MIME Type:
Creator:
Guenther Deschner
Created:
2005-10-24 12:30:45 UTC
Size:
3.17 KB
patch
obsolete
>--- /home/gd/src/samba/SOURCES/samba/tags/release-3-0-20/source/client/smbspool.c 2005-08-22 14:27:16.000000000 +0200 >+++ client/smbspool.c 2005-09-30 20:50:16.000000000 +0200 >@@ -70,6 +70,9 @@ > FILE *fp; /* File to print */ > int status=0; /* Status of LPD job */ > struct cli_state *cli; /* SMB interface */ >+ char null_str[1]; >+ >+ null_str[0] = '\0'; > > /* we expect the URI in argv[0]. Detect the case where it is in argv[1] and cope */ > if (argc > 2 && strncmp(argv[0],"smb://", 6) && !strncmp(argv[1],"smb://", 6)) { >@@ -158,12 +161,12 @@ > if ((password = strchr_m(username, ':')) != NULL) > *password++ = '\0'; > else >- password = ""; >+ password = null_str; > } > else > { >- username = ""; >- password = ""; >+ username = null_str; >+ password = null_str; > server = uri + 6; > } > >@@ -226,12 +229,12 @@ > { > if (getenv("CLASS") == NULL) > { >- fprintf(stderr, "ERROR: Unable to connect to SAMBA host, will retry in 60 seconds..."); >- sleep (60); >+ fprintf(stderr, "ERROR: Unable to connect to CIFS host, will retry in 60 seconds..."); >+ sleep (60); /* should just waiting and retrying fix authentication ??? */ > } > else > { >- fprintf(stderr, "ERROR: Unable to connect to SAMBA host, trying next printer..."); >+ fprintf(stderr, "ERROR: Unable to connect to CIFS host, trying next printer..."); > return (1); > } > } >@@ -288,7 +291,7 @@ > static > char * get_ticket_cache( uid_t uid ) > { >- DIR *tcdir; /* directory where ticket caches are stored */ >+ SMB_STRUCT_DIR *tcdir; /* directory where ticket caches are stored */ > SMB_STRUCT_DIRENT *dirent; /* directory entry */ > char *filename = NULL; /* holds file names on the tmp directory */ > SMB_STRUCT_STAT buf; >@@ -298,7 +301,7 @@ > time_t t = 0; > > snprintf(user_cache_prefix, CC_MAX_FILE_LEN, "%s%d", CC_PREFIX, uid ); >- tcdir = opendir( TICKET_CC_DIR ); >+ tcdir = sys_opendir( TICKET_CC_DIR ); > if ( tcdir == NULL ) > return NULL; > >@@ -331,6 +334,8 @@ > } > } > >+ sys_closedir(tcdir); >+ > if ( ticket_file == NULL ) > { > /* no ticket cache found */ >@@ -423,10 +428,10 @@ > return NULL; > } > >- if (!cli_send_tconX(cli, share, "?????",password, strlen(password)+1)) >+ if (!cli_send_tconX(cli, share, "?????", password, strlen(password)+1)) > { >+ fprintf(stderr, "ERROR: Tree connect failed (%s)\n", cli_errstr(cli)); > cli_shutdown(cli); >- fprintf(stderr, "ERROR: Tree connect failed\n" ); > return NULL; > } > >@@ -455,15 +460,15 @@ > > get_myname(myname); > >- if ( (username) && ( *username ) && (password) && (*password) ) >+ /* See if we have a username first. This is for backwards compatible >+ behavior with 3.0.14a */ >+ >+ if ( username && *username ) > { >- /* >- * User/password specified in the DEVICE_URI, use those credentials >- * to connect to the server >- */ > cli = smb_complete_connection(myname, server, port, username, > password, workgroup, share, 0 ); >- if (cli ) { return cli; } >+ if (cli) >+ return cli; > } > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 106335
:
47292
|
47824
|
47825
|
55194
|
55202
|
57747