Bug 181780

Summary: Yast sometimes writes extraneous characters to printers.conf for smb printers
Product: [openSUSE] SUSE Linux 10.1 Reporter: Jonathon Robison <jrobiso2>
Component: YaST2Assignee: Michal Zugec <mzugec>
Status: RESOLVED FIXED QA Contact: Stanislav Visnovsky <visnov>
Severity: Major    
Priority: P5 - None CC: jsmeix, suse-beta
Version: Final   
Target Milestone: ---   
Hardware: i586   
OS: SuSE Linux 10.1   
Whiteboard:
Found By: Beta-Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: y2log (modified to remove passwords)

Description Jonathon Robison 2006-06-05 17:49:54 UTC
The following is an excerpt from my /var/log/cups/error_log when changing some settings for an smb attached printer:

I [05/Jun/2006:13:43:18 -0400] Saving printers.conf...
I [05/Jun/2006:13:43:35 -0400] Setting PR32579 device-uri to "smb://fordna1/jrobiso2%3aMYPASSWORD%40sic00002/PR32579" (was "smb://fordna1/jrobiso2:MYPASSWORD@sic00002/PR32579".)

Note the fact that yast used %3a instead of :, and %40 instead of @.

SMB printers generally don't work with that in printers.conf. Manually fixing the printers.conf file is my only fix currently.

This kind of error can be extremely frustrating and hard to track down if your eyes aren't sharp enough to see the change in the logs.
Comment 1 Michal Zugec 2006-06-06 11:07:35 UTC
This you can see only in error_log or also in printers.conf?
If second, attach yast logs please.
Changing serverity to Major
( Critical - Crash, loss of data, corruption of data, severe memory leak,
Major - Major loss of function )
Comment 2 Jonathon Robison 2006-06-06 14:22:59 UTC
here is some more of error log:

I [05/Jun/2006:13:17:50 -0400] Setting y2test device-uri to "smb://fordna1/jrobiso2%3aCallan04%40sic000
02.fsic.ford.com/PR32579" (was "file:/dev/null".)
I [05/Jun/2006:13:17:50 -0400] Setting y2test printer-is-accepting-jobs to 1 (was 0.)
I [05/Jun/2006:13:17:50 -0400] Setting y2test printer-state to 3 (was 5.)
I [05/Jun/2006:13:17:50 -0400] Saving printers.conf...
I [05/Jun/2006:13:17:50 -0400] New printer 'y2test' added by 'root'.
I [05/Jun/2006:13:17:50 -0400] Adding start banner page "none" to job 1.
I [05/Jun/2006:13:17:50 -0400] Adding end banner page "none" to job 1.
I [05/Jun/2006:13:17:50 -0400] Job 1 queued on 'y2test' by 'root'.
I [05/Jun/2006:13:17:50 -0400] Started filter /usr/lib/cups/filter/pstops (PID 24202) for job 1.
I [05/Jun/2006:13:17:50 -0400] Started backend /usr/lib/cups/backend/smb (PID 24203) for job 1.
E [05/Jun/2006:13:17:53 -0400] [Job 1] Unable to connect to CIFS host, will retry in 60 seconds...
E [05/Jun/2006:13:18:55 -0400] [Job 1] Unable to connect to CIFS host, will retry in 60 seconds...
E [05/Jun/2006:13:19:59 -0400] [Job 1] Unable to connect to CIFS host, will retry in 60 seconds...

Which makes sense since the url it's trying to reach now has crap in it.
I will attach my y2log. It's long . . . jump to the bottom and work backwords to find printer stuff.
Comment 3 Jonathon Robison 2006-06-06 14:24:51 UTC
Created attachment 87414 [details]
y2log (modified to remove passwords)
Comment 4 Jonathon Robison 2006-06-06 14:33:22 UTC
Regarding severity - Loss of printing ability does not constitute major loss of functionality?

I'm not trying to be snotty - just explaining my reasoning for putting it as critical.
Comment 5 Johannes Meixner 2006-06-08 14:16:09 UTC
On the first glance it looks like an encoding (locale) problem
(e.g. UTF-8 stuff instead of plain ASCII), but '3a' is the
hex code for the ':' character and '40' is the hex code for
the '@' character which are both plain ASCII.

I have no idea what (in YaST or in CUPS or elsewhere) replaces
plain ASCII characters with their hex codes.

Jonathon,
does your "MYPASSWORD" contain non-ASCII characters
(i.e. language specific characters like umlauts ...)?

I tried to reproduce it:

I enter in YaST (via [Add] -> "Network printer" -> "Print via SMB
Network Server") the following values for SMB share access:
Workgroup: SmbWorkgroup
Hostname: SmbHost
Queuename: SmbShare
User: SmbUser
Password: SmbPassword

This results in /etc/cups/printers.conf
DeviceURI smb://SmbWorkgroup/SmbUser:SmbPassword@SmbHost/SmbShare
which looks o.k. for me.

When I change this (e.g. leave Workgroup empty) I get
DeviceURI smb://SmbUser:SmbPassword@SmbHost/SmbShare
which looks also o.k. for me.

In /var/log/cups/error_log there is
---------------------------------------------------------------------
Setting smbtest device-uri to
 "smb://SmbWorkgroup/SmbUser:SmbPassword@SmbHost/SmbShare"
 (was "file:/dev/null".)
...
Setting smbtest device-uri to "smb://SmbHost/SmbShare"
 (was "smb://SmbWorkgroup/SmbUser:SmbPassword@SmbHost/SmbShare".)
---------------------------------------------------------------------
Note that I don't have such a SMB share and it is actually
not needed - one can simply enter arbitrary values for a test.

This works for me using Suse Linux 10.1 in x86_64 when I run YaST
as root with "en_GB.iso885915" locale and even when I use
the "de_DE.utf8" locale for root.

Summary:
I cannot reproduce it.
Comment 6 Jonathon Robison 2006-06-08 14:52:23 UTC
I only get this error after multiple alterations to the Connection part of the printer setup. Make a change, test it, make a change, test it, etc.  I got to wondering why it would fail on connections which I knew were perfect, until I checked into the conf it was making and the error logs. Suddenly I could see why.

My password does not contain anything wierd. Capital letters, small letters, and numbers. That's it. 8 Characters.

Comment 7 Michal Zugec 2006-06-08 14:55:37 UTC
What is your locale settings?
Comment 8 Michal Zugec 2006-06-08 15:21:23 UTC
Now I think it's not locale problem.
So if you can write how exactly I can reproduce it, it helps a lot.
It's hard to reproduce like: Make a change, test it, make a change, test it, etc.
And also check your /etc/cups/printers.conf to be sure this string is already corrupted there, please.
Comment 9 Jonathon Robison 2006-06-08 15:31:07 UTC
I just kept changing the user and password in the smb printer setup, then clicking "Test" from the printer overview screen. I have 6 users on the Windows box, so I was testing all six (all have "normal" passwords and usernames). After making one or two changes, it would insert those hex strings instead of the correct : and @.

If you are unable to reproduce this then we'll have to drop it. I don't want you wasting too much effort if I am the only one experiencing this.

From /etc/sysconfig/language: RC_LANG="en_US.UTF-8"

"env | grep locale" gets nothing for root, and as a user I get:
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-15,CP1252

Comment 10 Michal Zugec 2006-06-08 15:39:03 UTC
>If you are unable to reproduce this then we'll have to drop it. I don't want
you wasting too much effort if I am the only one experiencing this.

This is bug, so we need to fix it. I have idea what is wrong and I reproduced it already:

Add new network printer via samba using user/pass auth. Finish yast module. Now 
/etc/cups/printers.conf is valid. Open module again (now string is internaly replaced to URL). Finish again - now /etc/cups/printers.conf is corrupted.
Comment 11 Jonathon Robison 2006-06-08 15:42:54 UTC
Excellent! Knowing what the problem is is 90% of solving it!
Comment 12 Michal Zugec 2006-06-09 09:27:16 UTC
fixed, please check next build (it helps me if you check all about smb - create, edit and printing)
Comment 13 Jonathon Robison 2006-06-09 14:51:07 UTC
I presume this build will be part of the regular 10.1 updates? If so, then I will fully retest doing everything again.

Many thanks Michal.
Comment 17 Andreas Jaeger 2006-07-07 08:39:38 UTC
Michal, please release for 10.1: MaintenanceTracker-5069
Comment 18 Michal Zugec 2006-07-17 11:30:28 UTC
submited
Comment 19 Jonathon Robison 2006-08-05 00:49:09 UTC
Gents, this still is not fixed. It happened to me again today, and all I did was change "default" printer, etc.

I'm fully up to date on all rpm's as of today.
Comment 20 Michal Zugec 2006-08-07 07:01:47 UTC
Which version of yast2-printer.rpm?
Comment 21 Jonathon Robison 2006-08-07 14:32:52 UTC
yast2-printer-2.13.13-6

By the way, I also find it wierd that KDE's printer config prints a great test print, but yast's seems to think the page is longer than it is. But that's another problem, for a later bug ;-)
Comment 22 Michal Zugec 2006-08-07 14:51:37 UTC
Ugh,
the patch was created, but isn't available yet.
I'am sorry, but you must be patient and check it via online update.
But it is definitely fixed, so I'm closing this bug.

About test page - go ahead! Reporting a bug is first step to fix it ;-)
Comment 23 Jonathon Robison 2008-05-30 14:05:44 UTC
Michal,

Just to catch up regarding the KDE test print better than yast - I never followed up because I use a non-supported driver.  I have a Lexmark P3150 and I had to find and download a driver from the net and manually add it.  Given that its a crappy Lexmark, unsupported, using a 6 year old abandoned driver, I figured nobody should waste time on a bug report for it.