Bug 3158 - Strange bug occuring due to usage of a username map and long printer names:
Strange bug occuring due to usage of a username map and long printer names:
Status: RESOLVED DUPLICATE of bug 3156
Product: Samba 3.0
Classification: Unclassified
Component: Printing
3.0.14a
All Windows XP
: P3 major
: none
Assigned To: Gerald (Jerry) Carter
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-11 07:41 UTC by Christoph Klein
Modified: 2005-10-12 06:35 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Klein 2005-10-11 07:41:29 UTC
Starting from possibly 3.0.7 Samba no longer resolves printer names successfully. 


Here's is the username map:

!smbop = christophk
zbenutzer = *

The smb.conf entry:

[hp43dpc]
        path = /tmp
        printable = Yes
        printer name = FWI-HP4300D
        cups options = "raw"

and the rpcclient output

rpcclient $> getprinter hp43dpc 2
        servername:[\\127.0.0.1]
        printername:[\\127.0.0.1\CIP-Service D]
        sharename:[hp43dpc]
        portname:[FWI-HP4300D]
        drivername:[HP LaserJet 4300 PCL 6]
        comment:[0,05 Euro pro Seite]
        location:[Servicebüro]
        sepfile:[]
        printprocessor:[winprint]
        datatype:[RAW]
        parameters:[]
        attributes:[0x3048]
        priority:[0x1]
        defaultpriority:[0x1]
        starttime:[0x0]
        untiltime:[0x0]
        status:[0x0]
        cjobs:[0x0]
        averageppm:[0x0]

and the log:

[2005/10/11 11:03:37, 3]
rpc_server/srv_spoolss_nt.c:set_printer_hnd_printertype(471)
  Setting printer type=\\fwi-fortuna\CIP-Service A Farbe
  Printer is a printer
[2005/10/11 11:03:37, 4] rpc_server/srv_spoolss_nt.c:set_printer_hnd_name(507)
  Setting printer name=\\fwi-fortuna\CIP-Service A Farbe (len=33)
  searching for [CIP-Service A Farbe]
[2005/10/11 11:03:37, 5] lib/username.c:Get_Pwnam_alloc(313)
  Finding user CIP-Service A Farbe
[2005/10/11 11:03:37, 5] lib/username.c:Get_Pwnam_internals(262)
  Trying _Get_Pwnam(), username as lowercase is cip-service a farbe
[2005/10/11 11:03:37, 5] lib/username.c:Get_Pwnam_internals(269)
  Trying _Get_Pwnam(), username as given is CIP-Service A Farbe
[2005/10/11 11:03:37, 5] lib/username.c:Get_Pwnam_internals(278)
  Trying _Get_Pwnam(), username as uppercase is CIP-SERVICE A FARBE
[2005/10/11 11:03:37, 5] lib/username.c:Get_Pwnam_internals(286)
  Checking combinations of 0 uppercase letters in cip-service a farbe
[2005/10/11 11:03:37, 5] lib/username.c:Get_Pwnam_internals(290)
  Get_Pwnam_internals didn't find user [CIP-Service A Farbe]!
[2005/10/11 11:03:37, 4] lib/username.c:map_username(171)
  Scanning username map /etc/samba/usermap
[2005/10/11 11:03:37, 5] lib/username.c:user_in_netgroup_list(369)
  Unable to get default yp domain
[2005/10/11 11:03:37, 3] lib/username.c:map_username(212)
  Mapped user CIP-Service A Farbe to zbenutzer
[2005/10/11 11:03:37, 5] lib/username.c:Get_Pwnam_alloc(313)
  Finding user zbenutzer
[2005/10/11 11:03:37, 5] lib/username.c:Get_Pwnam_internals(262)
  Trying _Get_Pwnam(), username as lowercase is zbenutzer
[2005/10/11 11:03:37, 5] lib/username.c:Get_Pwnam_internals(290)
  Get_Pwnam_internals did find user [zbenutzer]!
[2005/10/11 11:03:37, 3] smbd/service.c:find_service(151)
  checking for home directory zbenutzer gave
[2005/10/11 11:03:37, 3] smbd/service.c:find_service(161)
  checking whether zbenutzer is a valid printer name...
[2005/10/11 11:03:37, 3] smbd/service.c:find_service(171)
  zbenutzer is not a valid printer name
[2005/10/11 11:03:37, 3] smbd/service.c:find_service(208)
  find_service() failed to find service zbenutzer

... yes i know its for a different printer, but they are all configured the same
way and all dont work with >3.0.7


To me it seems that find_service called by set_printer_hnd_name doenst find a
share with the printername (due to the long printername) and then looks if the
servicename is a username and the share a homeshare. map_username called by
find_service changes the printername to a username, and then all subsequent
tries to map the long printer name to a share name in set_rpinter_hnd_name fail,
because the servicename was changed.
Comment 1 Gerald (Jerry) Carter 2005-10-12 06:35:32 UTC

*** This bug has been marked as a duplicate of 3156 ***