From eecab5c66096cc42323aaa4a796bf4a17e491a00 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 22 Jun 2000 23:59:22 +0000 Subject: Changed enumports to show printernames as ports. In line with 'the grand plan' :-) Gerald & I discussed with HP. More changes to follow. Jeremy. (This used to be commit 193a248beda99103c73a0b0ea5e2fbcbb516ce8e) --- source3/param/loadparm.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'source3/param') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0bcb63984b..57db8f0e87 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1476,7 +1476,7 @@ FN_LOCAL_STRING(lp_lppausecommand, szLppausecommand) FN_LOCAL_STRING(lp_lpresumecommand, szLpresumecommand) FN_LOCAL_STRING(lp_queuepausecommand, szQueuepausecommand) FN_LOCAL_STRING(lp_queueresumecommand, szQueueresumecommand) -FN_LOCAL_STRING(lp_printername, szPrintername) +static FN_LOCAL_STRING(_lp_printername, szPrintername) FN_LOCAL_STRING(lp_driverfile, szDriverFile) FN_LOCAL_STRING(lp_printerdriver, szPrinterDriver) FN_LOCAL_STRING(lp_hostsallow, szHostsallow) @@ -1958,14 +1958,17 @@ static BOOL service_ok(int iService) /* The [printers] entry MUST be printable. I'm all for flexibility, but */ /* I can't see why you'd want a non-printable printer service... */ - if (strwicmp(iSERVICE(iService).szService, PRINTERS_NAME) == 0) - if (!iSERVICE(iService).bPrint_ok) - { + if (strwicmp(iSERVICE(iService).szService, PRINTERS_NAME) == 0) { + if (!iSERVICE(iService).bPrint_ok) { DEBUG(0, ("WARNING: [%s] service MUST be printable!\n", iSERVICE(iService).szService)); iSERVICE(iService).bPrint_ok = True; } + /* [printers] service must also be non-browsable. */ + if (iSERVICE(iService).bBrowseable) + iSERVICE(iService).bBrowseable = False; + } if (iSERVICE(iService).szPath[0] == '\0' && strwicmp(iSERVICE(iService).szService, HOMES_NAME) != 0) @@ -3472,3 +3475,11 @@ int lp_force_dir_security_mode(int snum) return val; } +char *lp_printername(int snum) +{ + char *ret = _lp_printername(snum); + if (ret == NULL || (ret != NULL && *ret == '\0')) + ret = lp_servicename(snum); + + return ret; +} -- cgit