Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Samba] Access denied when associating a driver with a printer

751 views
Skip to first unread message

James Cort

unread,
Nov 4, 2013, 7:40:02 AM11/4/13
to
Hi,

I'm trying to get point & print working against a 4.0.10 Samba server (using the sernet packages if that's relevant).

I have the printer itself setup and I've uploaded the driver, but associating the uploaded driver with the printer causes Windows to give an error: "Printer settings could not be saved. Access is denied".

I'm seeing the same symptoms on XP and 7, and if I use rpcclient from the command line I get WERR_ACCESS_DENIED.

I'm doing this as a user with domain admin rights and I've specifically ensured I've granted this user SePrintOperatorPrivilege.

My config file is at:

http://pastebin.com/raZYpC3c

Results of using rpcclient to associate the driver from the command line at log level 10:

http://pastebin.com/4p9859tP


I've got full root access to everything - this is a lab environment so I can do pretty much what I like to get this working.

--
Eckland-Cort Ltd T/A Bediwin Information Services
Registered in England and Wales, no. 02598654
Registered office: 3 Southleigh Road, Taunton, Somerset TA1 2XZ

--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

Marc Muehlfeld

unread,
Nov 4, 2013, 1:10:05 PM11/4/13
to
Hello James,

Am 04.11.2013 13:32, schrieb James Cort:
> I'm trying to get point & print working against a 4.0.10 Samba server (using the sernet packages if that's relevant).
>
> I have the printer itself setup and I've uploaded the driver, but associating the uploaded driver with the printer causes Windows to give an error: "Printer settings could not be saved. Access is denied".
>
> I'm seeing the same symptoms on XP and 7, and if I use rpcclient from the command line I get WERR_ACCESS_DENIED.
>
> I'm doing this as a user with domain admin rights and I've specifically ensured I've granted this user SePrintOperatorPrivilege.
>
> My config file is at:
>
> http://pastebin.com/raZYpC3c
>
> Results of using rpcclient to associate the driver from the command line at log level 10:
>
> http://pastebin.com/4p9859tP
>
>
> I've got full root access to everything - this is a lab environment so I can do pretty much what I like to get this working.



Have you checked
http://wiki.samba.org/index.php/Samba_as_a_print_server

Maybe you missed anything?


Regards,
Marc

James Cort

unread,
Nov 5, 2013, 9:30:01 AM11/5/13
to

On 4 Nov 2013, at 18:04, Marc Muehlfeld <sa...@marc-muehlfeld.de> wrote:

> Hello James,
>
> Am 04.11.2013 13:32, schrieb James Cort:
>> I'm trying to get point & print working against a 4.0.10 Samba server (using the sernet packages if that's relevant).
>>
>> I have the printer itself setup and I've uploaded the driver, but associating the uploaded driver with the printer causes Windows to give an error: "Printer settings could not be saved. Access is denied".
>>
>> I'm seeing the same symptoms on XP and 7, and if I use rpcclient from the command line I get WERR_ACCESS_DENIED.
>
> Have you checked
> http://wiki.samba.org/index.php/Samba_as_a_print_server
>
> Maybe you missed anything?

That would be the most obvious explanation - but I don't believe I have.

I present my own checks here - partly to confirm with the list that I haven't left anything out, partly because if there's a bug somewhere in either documentation or Samba, with any luck this will shake it out.


Going over the given instructions, I need:

- To have a printer set up in cups, with a raw backend.

TEST: lpstat -p

RESULT: printer Kyocera is idle. enabled since Mon 04 Nov 2013 11:17:59 AM GMT

- To have a spool directory, permissions 1777

TEST: ls -ld /var/spool/samba
RESULT: drwxrwxrwt 2 root root 4096 Nov 3 20:01 /var/spool/samba/

- To have a printer driver directory, permissions 755.

TEST: ls -ld /var/lib/samba/printers
RESULT: drwxr-xr-x 3 root root 4096 Nov 3 15:28 /var/lib/samba/printers

- To have a [printers] section in my smb.conf that lists a path, the line "printable = yes" and "printing = CUPS".
- To have a [print$] section that lists a path and is writeable.

TEST: testparm

RESULT:
~~~~
[printers]
comment = All Printers
path = /var/spool/samba
printable = Yes
print ok = Yes
browseable = No
~~~~~

[print$]
path = /var/lib/samba/printers
read only = No

- To have load printers = yes in my smb.conf (It is there, but it doesn't appear when I run testparm. Is this relevant?)

TEST: grep "load printers" /etc/samba/smb.conf
RESULT: load printers = yes

- To grant myself SePrintOperatorPrivilege

TEST: net rpc rights list accounts -Uadministrator
RESULT:

~~~
BEDIWIN\Administrator
SePrintOperatorPrivilege
~~~~

(full results at http://pastebin.com/20dr3cWE)

- To ensure a driver has been uploaded.

TEST: rpcclient localhost -U administrator -c 'enumdrivers'
RESULT:
Enter administrator's password:

[Windows NT x86]
Printer Driver Info 1:
Driver Name: [Kyocera FS-C5250DN KX]

- To ensure the printer itself has been found and may be enumerated by Samba

TEST: rpcclient localhost -U administrator -c 'enumprinters'
RESULT:
Enter administrator's password:
flags:[0x800000]
name:[\\LOCALHOST\Kyocera]
description:[\\LOCALHOST\Kyocera,,Kyocera]
comment:[Kyocera]


My understanding was that all is present and correct, and yet the final part of the jigsaw - associate a printer with a driver - gives the result:

# rpcclient localhost -U"Administrator" -c 'setdriver "Kyocera" "Kyocera FS-C5250DN KX"'
Enter Administrator's password:
SetPrinter call failed!
result was WERR_ACCESS_DENIED


Is it worth looking at the underlying .tdb files to see if there's anything amiss there?


James.

James Cort

unread,
Nov 5, 2013, 10:40:02 AM11/5/13
to
On 5 Nov 2013, at 14:28, James Cort <james...@bediwin.co.uk> wrote:

>
> On 4 Nov 2013, at 18:04, Marc Muehlfeld <sa...@marc-muehlfeld.de> wrote:
>
>> Hello James,
>>
>> Am 04.11.2013 13:32, schrieb James Cort:
>>> I'm trying to get point & print working against a 4.0.10 Samba server (using the sernet packages if that's relevant).
>>>
>>> I have the printer itself setup and I've uploaded the driver, but associating the uploaded driver with the printer causes Windows to give an error: "Printer settings could not be saved. Access is denied".
>>>
>>> I'm seeing the same symptoms on XP and 7, and if I use rpcclient from the command line I get WERR_ACCESS_DENIED.
>>
>> Have you checked
>> http://wiki.samba.org/index.php/Samba_as_a_print_server
>>
>> Maybe you missed anything?
>
> That would be the most obvious explanation - but I don't believe I have.

Think I may have solved it.

Two issues here:

First is that "use client drivers" must be either set to "no" or not set at all. This isn't documented on the wiki page, though Google has found a few other instances of others making the same mistake.

Second is that smbcontrol all reload-config did NOT reload the configuration in its entirety. Restarting Samba, however, did.

I now have a driver associated. It's not printing anything, but I'm not sure if that's related!

Marc Muehlfeld

unread,
Nov 5, 2013, 1:40:01 PM11/5/13
to
Hello James,

Am 05.11.2013 16:30, schrieb James Cort:
> First is that "use client drivers" must be either set to "no"
> or not set at all. This isn't documented on the wiki page, though
> Google has found a few other instances of others making the
> same mistake.

When you exactly follow the HowTo, it works (I wrote the HowTo and have
validated it a few times in the past :-)).

In my production environment I have "use client driver = yes", and
upload and association of drivers work fine (LPRng backend, but this
should not matter for associating the driver). But my production
printserver is currently still on 3.6.19.



> Second is that smbcontrol all reload-config did NOT reload the
> configuration in its entirety. Restarting Samba, however, did.

Hm. That's interesting. Normally this should work. What config
parameters didn't work when you only reload?




> I now have a driver associated. It's not printing anything,
> but I'm not sure if that's related!

Just some thoughts:
- Do you receive the printjob in CUPS?
- Do you have a spool file for the job in the Samba/CUPS spool folder?
- CUPS is up and printing directly from the server works?
- Any restrictions prevent printing? (firewall, SELinux,...)?



Regards,
Marc

James Cort

unread,
Nov 5, 2013, 2:10:02 PM11/5/13
to
On 5 Nov 2013, at 18:34, Marc Muehlfeld <sa...@marc-muehlfeld.de> wrote:

> Hello James,
>
> Am 05.11.2013 16:30, schrieb James Cort:

>> Second is that smbcontrol all reload-config did NOT reload the
> > configuration in its entirety. Restarting Samba, however, did.
>
> Hm. That's interesting. Normally this should work. What config parameters didn't work when you only reload?

I changed a number of parameters, but the one I think made a difference was "use client driver".

That most certainly didn't seem to take unless I restarted Samba - restarted Samba and it worked immediately.


>> I now have a driver associated. It's not printing anything,
> > but I'm not sure if that's related!
> Just some thoughts:
> - Do you receive the printjob in CUPS?

Nope.

Strangely, after a few minutes it seemed to resolve itself. ISTR Active Directory on Windows can take a while to completely get itself together - is the same true of Samba 4.x?

I'd need to do a lot more testing to establish if this is a regular problem or simply a minor, impossible-to-replicate transient glitch. Fortunately, I plan on doing quite a bit of that over the coming months. So I daresay I'll find out eventually.


James.
0 new messages