diff options
author | Jeremy Allison <jra@samba.org> | 2000-10-10 19:09:48 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-10-10 19:09:48 +0000 |
commit | e8912baf025a1356aa8c02f971fbe3d67adc9b0a (patch) | |
tree | 79cfd9ba43deafdf544c191816820cb30d637d20 /source3/rpc_server | |
parent | 30dbac7e02002ee482629593c1515bd47b799fdd (diff) | |
download | samba-e8912baf025a1356aa8c02f971fbe3d67adc9b0a.tar.gz samba-e8912baf025a1356aa8c02f971fbe3d67adc9b0a.tar.bz2 samba-e8912baf025a1356aa8c02f971fbe3d67adc9b0a.zip |
Fix found by Andrew to stop local/remote printers being
confused. check_printer_ok was causing SETPRINTER calls to fail.
Jeremy.
(This used to be commit b41cc5fea7409d07529adad44f0cbba5c764591c)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 56de5375fb..72c87ae819 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -3406,8 +3406,9 @@ static BOOL check_printer_ok(NT_PRINTER_INFO_LEVEL_2 *info, int snum) * as this is what Samba insists upon. */ - if (!(info->attributes & PRINTER_ATTRIBUTE_SHARED)) { - DEBUG(10,("check_printer_ok: SHARED check failed (%x).\n", (unsigned int)info->attributes )); + if (!(info->attributes & (PRINTER_ATTRIBUTE_SHARED|PRINTER_ATTRIBUTE_NETWORK))) { + DEBUG(10,("check_printer_ok: SHARED/NETWORK check failed (%x).\n", + (unsigned int)info->attributes )); return False; } @@ -3421,8 +3422,22 @@ static BOOL check_printer_ok(NT_PRINTER_INFO_LEVEL_2 *info, int snum) } } + /* + * Sometimes the NT client doesn't set the sharename, but + * includes the sharename in the printername. This could + * cause SETPRINTER to fail which causes problems with the + * client getting confused between local/remote printers... + */ + + if (*info->sharename == '\0') { + char *p = strrchr(info->printername, '\\'); + if (p) + fstrcpy(info->sharename, p+1); + } + if (!strequal(info->sharename, lp_servicename(snum))) { - DEBUG(10,("check_printer_ok: NAME check failed (%s) (%s).\n", info->sharename, lp_servicename(snum))); + DEBUG(10,("check_printer_ok: NAME check failed (%s) (%s).\n", + info->sharename, lp_servicename(snum))); return False; } |