diff options
author | sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM> | 2008-11-30 23:22:13 -0800 |
---|---|---|
committer | sonam gupta - Sun Microsystems - Bangalore India <Sonam.Gupta@Sun.COM> | 2008-11-30 23:22:13 -0800 |
commit | f06271be56df67ca3faa4ca4bc51457dad15c3b5 (patch) | |
tree | 3ae3453b8f679d53c954d5c6b16607c6b5b097ef | |
parent | 94d05f6c7f329fdf908da99ab50b37d3d33f9fe5 (diff) | |
download | illumos-joyent-f06271be56df67ca3faa4ca4bc51457dad15c3b5.tar.gz |
6740759 S10u5: lpstat always reports "Forms allowed: (none)" after making form available to printer.
-rw-r--r-- | usr/src/cmd/lp/lib/papi/lpsched-printers.c | 18 | ||||
-rw-r--r-- | usr/src/cmd/print/bsd-sysv-commands/lpstat.c | 8 |
2 files changed, 22 insertions, 4 deletions
diff --git a/usr/src/cmd/lp/lib/papi/lpsched-printers.c b/usr/src/cmd/lp/lib/papi/lpsched-printers.c index 888eb7ea91..120fec5fec 100644 --- a/usr/src/cmd/lp/lib/papi/lpsched-printers.c +++ b/usr/src/cmd/lp/lib/papi/lpsched-printers.c @@ -121,6 +121,7 @@ lpsched_printer_configuration_to_attributes(service_t *svc, printer_t *p, char buf[BUFSIZ+1]; struct utsname sysname; char **allowed = NULL, **denied = NULL; + char **f_allowed = NULL, **f_denied = NULL; if ((svc == NULL) || (p == NULL) || (dest == NULL)) return (PAPI_BAD_ARGUMENT); @@ -234,6 +235,23 @@ lpsched_printer_configuration_to_attributes(service_t *svc, printer_t *p, freelist(allowed); freelist(denied); + /* forms allow/deny list */ + load_formprinter_access(dest, &f_allowed, &f_denied); + papiAttributeListAddLPStrings(&p->attributes, PAPI_ATTR_REPLACE, + "form-supported", f_allowed); + + /* + * All forms allowed case + * When all forms are allowed forms.allow does not get created but + * forms.deny file gets created with no entries + */ + if ((f_allowed == NULL) && (f_denied != NULL) && (f_denied[0] == NULL)) + papiAttributeListAddLPString(&p->attributes, PAPI_ATTR_REPLACE, + "form-supported", "all"); + + freelist(f_allowed); + freelist(f_denied); + #ifdef LP_USE_PAPI_ATTR if (tmp->ppd != NULL) { int fd; diff --git a/usr/src/cmd/print/bsd-sysv-commands/lpstat.c b/usr/src/cmd/print/bsd-sysv-commands/lpstat.c index ed7a0eede5..e32cddfd39 100644 --- a/usr/src/cmd/print/bsd-sysv-commands/lpstat.c +++ b/usr/src/cmd/print/bsd-sysv-commands/lpstat.c @@ -461,16 +461,16 @@ report_printer(papi_service_t svc, char *name, papi_printer_t printer, printf("\t\t%s\n", str); } - str = "(none)"; + str = "none"; iter = NULL; (void) papiAttributeListGetString(attrs, &iter, "form-supported", &str); - printf(gettext("\tForms allowed:\n\t\t%s\n"), - ((str[0] == '\0') ? gettext("(none)") : str)); + printf(gettext("\tForms allowed:\n\t\t(%s)\n"), + ((str[0] == '\0') ? gettext("none") : str)); if ((str != NULL) && (str[0] != '\0')) while (papiAttributeListGetString(attrs, &iter, NULL, &str) == PAPI_OK) - printf("\t\t%s\n", str); + printf("\t\t(%s)\n", str); str = ""; iter = NULL; |