[Samba] What will happen if I disable reverse check for \\server\printer on samba?

2013-02-20 Thread Alex Korobkin
Hi team,

In Samba 3.6, rpc_server/spoolss/srv_spoolss_nt.c file has this stance at
line 1740:

/* some sanity check because you can open a printer or a print
server */
 /* aka: \\server\printer or \\server */

DEBUGADD(3,("checking name: %s\n", r->in.printername));

result = open_printer_hnd(p, r->out.handle, r->in.printername, 0);
 if (!W_ERROR_IS_OK(result)) {
DEBUG(0,("_spoolss_OpenPrinterEx: Cannot open a printer handle "
 "for printer %s\n", r->in.printername));
ZERO_STRUCTP(r->out.handle);
 return result;
}


In my specific environment it causes a problem, because when client calls
the cluster under its public name, Samba performs this reverse check from
inside the cluster and connects to a different cluster instance, causing
printer installation to fail. I know, it shouldn't be configured like that,
but that won't be fixed soon.

Could anything bad happen if I remove this check manually?

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


[Samba] werr_access_denied when running setdriver for a printer

2013-01-11 Thread Alex Korobkin
Hi all,

I'm getting WERR_ACCESS_DENIED error for some of the printers when running
setdriver printer_name printer_driver as part of the cupsaddsmb step.
Weirdly, it works for some printers, and never works for others, while all
the printers have the same settings. Samba 3.5.20 with CUPS 1.5.4.

Does this part of log give any clue of why could this happen?

function print_access_check() -- where does it take its data to check for
printer access?


[2013/01/11 15:57:10.794623, 10] smbd/share_access.c:238(user_ok_token)
  user_ok_token: share myprinter1 is ok for unix user korobkin
[2013/01/11 15:57:10.794666, 10] lib/util_seaccess.c:58(se_map_generic)
  se_map_generic(): mapped mask 0x20020008 to 0x00020008
[2013/01/11 15:57:10.794701, 10] lib/util_seaccess.c:58(se_map_generic)
  se_map_generic(): mapped mask 0x100f000c to 0x000f000c
[2013/01/11 15:57:10.794722, 10] lib/util_seaccess.c:58(se_map_generic)
  se_map_generic(): mapped mask 0x100f000c to 0x000f000c
[2013/01/11 15:57:10.794743, 10] lib/util_seaccess.c:58(se_map_generic)
  se_map_generic(): mapped mask 0x100f000c to 0x000f000c
[2013/01/11 15:57:10.794763, 10] lib/util_seaccess.c:58(se_map_generic)
  se_map_generic(): mapped mask 0x100f000c to 0x000f000c
[2013/01/11 15:57:10.794785,  4]
printing/nt_printing.c:5722(print_access_check)
  access check was FAILURE
[2013/01/11 15:57:10.794937,  3]
rpc_server/srv_spoolss_nt.c:1772(_spoolss_OpenPrinterEx)
  access DENIED for printer open
[2013/01/11 15:57:10.794965,  4]
rpc_server/srv_lsa_hnd.c:219(find_policy_by_hnd_internal)
  Found policy hnd[0] [] 00 00 00 00 02 00 00 00   00 00 00 00 F0 50 56
36    .PV6
  [0010] 55 7F 00 00   U...
[2013/01/11 15:57:10.795008,  4]
rpc_server/srv_lsa_hnd.c:219(find_policy_by_hnd_internal)
  Found policy hnd[0] [] 00 00 00 00 02 00 00 00   00 00 00 00 F0 50 56
36    .PV6
  [0010] 55 7F 00 00   U...
[2013/01/11 15:57:10.795049,  3]
rpc_server/srv_lsa_hnd.c:258(close_policy_hnd)
  Closed policy
[2013/01/11 15:57:10.795070,  1]
../librpc/ndr/ndr.c:251(ndr_print_function_debug)
   spoolss_OpenPrinterEx: struct spoolss_OpenPrinterEx
  out: struct spoolss_OpenPrinterEx
  handle   : *
  handle: struct policy_handle
  handle_type  : 0x (0)
  uuid :
----
  result   : WERR_ACCESS_DENIED


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


[Samba] del_driver_init deletes what?

2013-01-10 Thread Alex Korobkin
Hi team,

I'm trying to debug cupsaddsmb with 3.5.20, which sometimes throws "Unable
to install Windows 2000 printer driver files" error for me.

I traced it all down to  _spoolss_AddPrinterDriver(), which calls
del_driver_init function from printing/nt_printing.c file.
It seems that del_driver_init() is called to delete some key from
ntdrivers.tdb, and the key in question seems to be
"DRIVER_INIT/my_printer_name".

These lines made me think this is what it does:
===
if (asprintf(&key, "%s%s", DRIVER_INIT_PREFIX, drivername) < 0) {
return false;
}


ret = (tdb_delete_bystring(tdb_drivers, key) == 0);

return ret;
===

However, I dumped all the keys of ntdrivers.tdb and there is no single key
with a name like DRIVER_INIT/.

Am I incorrect about this function internals?
What does del_driver_init trying to delete and why would it fail?

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


[Samba] Windows 8 printing to CUPS+Samba - will CreatePrinterIC RPC call stub be implemented?

2012-12-20 Thread Alex Korobkin
Hi All,

I'm trying to make Windows 8 clients print to Samba 3.5 and CUPS
1.5.4. Thanks to the patch from Frank Lascheit
(https://lists.samba.org/archive/samba/2012-December/170322.html) it
seems to work, except for one thing.

By default, Windows 8 client emits CreatePrinterIC request, to which
Samba replies with "Not Implemented" answer. Instead of ignoring it,
Win8 client fails with 0x06d1 error. As it is mentioned in the bug
https://bugzilla.samba.org/show_bug.cgi?id=6559 , disabling "Computer
Configuration/Policies/Administrative Templates/Printers/Always render
print jobs on the server" helps to workaround it, but one doesn't
always have control over clients' computers.

I know, it seems to be a bug on MS side, but is there a plan to
implement some stub for CreatePrinterIC call, so that Win8 (and
probably win2k8r2) clients could receive a harmless answer and proceed
with printer connection?

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


[Samba] Windows 8 printing to CUPS+Samba - will CreatePrinterIC RPC call stub be implemented?

2012-12-19 Thread Alex Korobkin
Hi All,

I'm trying to make Windows 8 clients print to Samba 3.5 and CUPS 1.5.4.
Thanks to the patch from Frank Lascheit (
https://lists.samba.org/archive/samba/2012-December/170322.html) it seems
to work, except for one thing.

By default, Windows 8 client emits CreatePrinterIC request, to which Samba
replies with "Not Implemented" answer. Instead of ignoring it, Win8 client
fails with 0x06d1 error. As it is mentioned in the bug
https://bugzilla.samba.org/show_bug.cgi?id=6559 , disabling "Computer
Configuration/Policies/Administrative Templates/Printers/Always render
print jobs on the server" helps to workaround it, but one doesn't always
have control over clients' computers.

I know, it seems to be a bug on MS side, but is there a plan to implement
some stub for CreatePrinterIC call, so that Win8 (and probably win2k8r2)
clients could receive a harmless answer and proceed with printer
connection?

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