From 4f470e9b5fad36febea1b8dc91dfab8d3adf5bd1 Mon Sep 17 00:00:00 2001 From: LIU Li Date: Wed, 18 Mar 2026 08:55:12 +0800 Subject: [PATCH 1/2] feat: add patches from master Change-Id: Ifaf2df33b5ede2cc7a75ae3e7adabea2737c701e --- ...efactor-part-of-server-settings-code.patch | 411 ++++++++++++++++++ ...0005-feat-enable-lpd-to-encode-title.patch | 272 ++++++++++++ .../0007-Feat-add-audit-log-to-CUPS.patch | 209 +++++++++ ...ith-printer-driver-which-runs-on-V20.patch | 92 ++++ debian/patches/series | 4 + 5 files changed, 988 insertions(+) create mode 100644 debian/patches/0001-fix-Refactor-part-of-server-settings-code.patch create mode 100644 debian/patches/0005-feat-enable-lpd-to-encode-title.patch create mode 100644 debian/patches/0007-Feat-add-audit-log-to-CUPS.patch create mode 100644 debian/patches/0017-Compatible-with-printer-driver-which-runs-on-V20.patch diff --git a/debian/patches/0001-fix-Refactor-part-of-server-settings-code.patch b/debian/patches/0001-fix-Refactor-part-of-server-settings-code.patch new file mode 100644 index 0000000..4497853 --- /dev/null +++ b/debian/patches/0001-fix-Refactor-part-of-server-settings-code.patch @@ -0,0 +1,411 @@ +From 7bc5b4d7a17b2033a3d9d918059046d1585f5a52 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E5=88=98=E8=8E=89?= +Date: Mon, 20 Jun 2022 16:39:30 +0800 +Subject: [PATCH 1/2] fix: Refactor part of server settings code + +We guarantee that the following conditions are met: + +share_printers remote_any remote_admin Listen Browsering Location-/ Location-/admin + off off off localhost:631 off deny deny + off off on 631 off Allow @Local Allow @Local + off on off 631 off Allow all deny + off on on 631 off Allow all Allow all + on off off 631 on Allow @Local deny + on off on 631 on Allow @Local Allow @Local + on on off 631 on Allow all deny + on on on 631 on Allow all Allow all + +Change-Id: Id3347d31c1885397b5908a79c1a18e02300784a4 +--- + cups/adminutil.c | 189 ++++++++++++++--------------------------------- + 1 file changed, 55 insertions(+), 134 deletions(-) + +diff --git a/cups/adminutil.c b/cups/adminutil.c +index e3f1dee..0d69693 100644 +--- a/cups/adminutil.c ++++ b/cups/adminutil.c +@@ -550,100 +550,50 @@ cupsAdminSetServerSettings( + * Get basic settings... + */ + ++ debug_logging = old_debug_logging; + if ((val = cupsGetOption(CUPS_SERVER_DEBUG_LOGGING, num_settings, + settings)) != NULL) + { + debug_logging = atoi(val); +- +- if (debug_logging == old_debug_logging) +- { +- /* +- * No change to this setting... +- */ +- +- debug_logging = -1; +- } + } +- else +- debug_logging = -1; + + DEBUG_printf(("1cupsAdminSetServerSettings: debug_logging=%d", + debug_logging)); + ++ remote_any = old_remote_any; + if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ANY, num_settings, settings)) != NULL) + { + remote_any = atoi(val); +- +- if (remote_any == old_remote_any) +- { +- /* +- * No change to this setting... +- */ +- +- remote_any = -1; +- } + } +- else +- remote_any = -1; + + DEBUG_printf(("1cupsAdminSetServerSettings: remote_any=%d", remote_any)); + ++ remote_admin = old_remote_admin; + if ((val = cupsGetOption(CUPS_SERVER_REMOTE_ADMIN, num_settings, + settings)) != NULL) + { + remote_admin = atoi(val); +- +- if (remote_admin == old_remote_admin) +- { +- /* +- * No change to this setting... +- */ +- +- remote_admin = -1; +- } + } +- else +- remote_admin = -1; + + DEBUG_printf(("1cupsAdminSetServerSettings: remote_admin=%d", + remote_admin)); + ++ share_printers = old_share_printers; + if ((val = cupsGetOption(CUPS_SERVER_SHARE_PRINTERS, num_settings, + settings)) != NULL) + { + share_printers = atoi(val); +- +- if (share_printers == old_share_printers) +- { +- /* +- * No change to this setting... +- */ +- +- share_printers = -1; +- } + } +- else +- share_printers = -1; + + DEBUG_printf(("1cupsAdminSetServerSettings: share_printers=%d", + share_printers)); + ++ user_cancel_any = old_user_cancel_any; + if ((val = cupsGetOption(CUPS_SERVER_USER_CANCEL_ANY, num_settings, + settings)) != NULL) + { + user_cancel_any = atoi(val); +- +- if (user_cancel_any == old_user_cancel_any) +- { +- /* +- * No change to this setting... +- */ +- +- user_cancel_any = -1; +- } + } +- else +- user_cancel_any = -1; + + DEBUG_printf(("1cupsAdminSetServerSettings: user_cancel_any=%d", + user_cancel_any)); +@@ -701,7 +651,8 @@ cupsAdminSetServerSettings( + while (cupsFileGetConf(cupsd, line, sizeof(line), &value, &linenum)) + { + if ((!_cups_strcasecmp(line, "Port") || !_cups_strcasecmp(line, "Listen")) && +- (remote_admin >= 0 || remote_any >= 0 || share_printers >= 0)) ++ ((remote_admin != old_remote_admin) || (remote_any != old_remote_any) || ++ (share_printers != old_share_printers))) + { + if (!wrote_port_listen) + { +@@ -734,7 +685,7 @@ cupsAdminSetServerSettings( + } + else if ((!_cups_strcasecmp(line, "Browsing") || + !_cups_strcasecmp(line, "BrowseLocalProtocols")) && +- share_printers >= 0) ++ (share_printers != old_share_printers)) + { + if (!wrote_browsing) + { +@@ -768,7 +719,8 @@ cupsAdminSetServerSettings( + } + } + } +- else if (!_cups_strcasecmp(line, "LogLevel") && debug_logging >= 0) ++ else if (!_cups_strcasecmp(line, "LogLevel") && ++ (debug_logging != old_debug_logging)) + { + wrote_loglevel = 1; + +@@ -833,7 +785,8 @@ cupsAdminSetServerSettings( + { + in_location = 0; + indent -= 2; +- if (in_admin_location && remote_admin >= 0) ++ if (in_admin_location && ++ ((remote_admin != old_remote_admin) || (remote_any != old_remote_any))) + { + wrote_admin_location = 1; + +@@ -846,13 +799,11 @@ cupsAdminSetServerSettings( + + if (remote_admin) + { +- if (remote_any >= 0) +- cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL"); +- else +- cupsFilePrintf(temp, " Allow %s\n", old_remote_any > 0 ? "all" : "@LOCAL"); ++ cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL"); + } + } +- else if (in_conf_location && remote_admin >= 0) ++ else if (in_conf_location && ++ ((remote_admin != old_remote_admin) || (remote_any != old_remote_any))) + { + wrote_conf_location = 1; + +@@ -867,13 +818,11 @@ cupsAdminSetServerSettings( + + if (remote_admin) + { +- if (remote_any >= 0) +- cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL"); +- else +- cupsFilePrintf(temp, " Allow %s\n", old_remote_any > 0 ? "all" : "@LOCAL"); ++ cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL"); + } + } +- else if (in_log_location && remote_admin >= 0) ++ else if (in_log_location && ++ ((remote_admin != old_remote_admin) || (remote_any != old_remote_any))) + { + wrote_log_location = 1; + +@@ -888,14 +837,12 @@ cupsAdminSetServerSettings( + + if (remote_admin) + { +- if (remote_any >= 0) +- cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL"); +- else +- cupsFilePrintf(temp, " Allow %s\n", old_remote_any > 0 ? "all" : "@LOCAL"); ++ cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL"); + } + } + else if (in_root_location && +- (remote_admin >= 0 || remote_any >= 0 || share_printers >= 0)) ++ ((remote_admin != old_remote_admin) || (remote_any != old_remote_any) || ++ (share_printers != old_share_printers))) + { + wrote_root_location = 1; + +@@ -915,10 +862,7 @@ cupsAdminSetServerSettings( + + if (remote_admin > 0 || remote_any > 0 || share_printers > 0) + { +- if (remote_any >= 0) +- cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL"); +- else +- cupsFilePrintf(temp, " Allow %s\n", old_remote_any > 0 ? "all" : "@LOCAL"); ++ cupsFilePrintf(temp, " Allow %s\n", remote_any > 0 ? "all" : "@LOCAL"); + } + } + +@@ -940,7 +884,8 @@ cupsAdminSetServerSettings( + char *valptr; /* Pointer into value */ + + +- if (!_cups_strcasecmp(value, "cancel-job") && user_cancel_any >= 0) ++ if (!_cups_strcasecmp(value, "cancel-job") && ++ user_cancel_any != old_user_cancel_any) + { + /* + * Don't write anything for this limit section... +@@ -959,7 +904,8 @@ cupsAdminSetServerSettings( + if (*valptr) + *valptr++ = '\0'; + +- if (!_cups_strcasecmp(value, "cancel-job") && user_cancel_any >= 0) ++ if (!_cups_strcasecmp(value, "cancel-job") && ++ user_cancel_any != old_user_cancel_any) + { + /* + * Write everything except for this definition... +@@ -1002,8 +948,8 @@ cupsAdminSetServerSettings( + in_cancel_job = 0; + } + else if ((((in_admin_location || in_conf_location || in_root_location || in_log_location) && +- (remote_admin >= 0 || remote_any >= 0)) || +- (in_root_location && share_printers >= 0)) && ++ ((remote_admin != old_remote_admin) || (remote_any != old_remote_any))) || ++ (in_root_location && (share_printers != old_share_printers))) && + (!_cups_strcasecmp(line, "Allow") || !_cups_strcasecmp(line, "Deny") || + !_cups_strcasecmp(line, "Order"))) + continue; +@@ -1065,7 +1011,7 @@ cupsAdminSetServerSettings( + * Write any missing info... + */ + +- if (!wrote_browsing && share_printers >= 0) ++ if (!wrote_browsing && (share_printers != old_share_printers)) + { + if (share_printers > 0) + { +@@ -1079,7 +1025,7 @@ cupsAdminSetServerSettings( + } + } + +- if (!wrote_loglevel && debug_logging >= 0) ++ if (!wrote_loglevel && (debug_logging != old_debug_logging)) + { + if (debug_logging) + { +@@ -1094,7 +1040,8 @@ cupsAdminSetServerSettings( + } + + if (!wrote_port_listen && +- (remote_admin >= 0 || remote_any >= 0 || share_printers >= 0)) ++ ((remote_admin != old_remote_admin) || (remote_any != old_remote_any) || ++ (share_printers != old_share_printers))) + { + if (remote_admin > 0 || remote_any > 0 || share_printers > 0) + { +@@ -1115,7 +1062,8 @@ cupsAdminSetServerSettings( + } + + if (!wrote_root_location && +- (remote_admin >= 0 || remote_any >= 0 || share_printers >= 0)) ++ ((remote_admin != old_remote_admin) || (remote_any != old_remote_any) || ++ (share_printers != old_share_printers))) + { + if (remote_admin > 0 && share_printers > 0) + cupsFilePuts(temp, +@@ -1138,7 +1086,8 @@ cupsAdminSetServerSettings( + cupsFilePuts(temp, "\n"); + } + +- if (!wrote_admin_location && remote_admin >= 0) ++ if (!wrote_admin_location && ++ ((remote_admin != old_remote_admin) || (remote_any != old_remote_any))) + { + if (remote_admin) + cupsFilePuts(temp, "# Allow remote administration...\n"); +@@ -1154,7 +1103,8 @@ cupsAdminSetServerSettings( + cupsFilePuts(temp, "\n"); + } + +- if (!wrote_conf_location && remote_admin >= 0) ++ if (!wrote_conf_location && ++ ((remote_admin != old_remote_admin) || (remote_any != old_remote_any))) + { + if (remote_admin) + cupsFilePuts(temp, +@@ -1173,7 +1123,8 @@ cupsAdminSetServerSettings( + cupsFilePuts(temp, "\n"); + } + +- if (!wrote_log_location && remote_admin >= 0) ++ if (!wrote_log_location && ++ ((remote_admin != old_remote_admin) || (remote_any != old_remote_any))) + { + if (remote_admin) + cupsFilePuts(temp, +@@ -1192,7 +1143,7 @@ cupsAdminSetServerSettings( + cupsFilePuts(temp, "\n"); + } + +- if (!wrote_policy && user_cancel_any >= 0) ++ if (!wrote_policy && (user_cancel_any != old_user_cancel_any)) + { + cupsFilePuts(temp, "\n" + " # Job-related operations must be done by the owner " +@@ -1274,50 +1225,20 @@ cupsAdminSetServerSettings( + * Updated OK, add the basic settings... + */ + +- if (debug_logging >= 0) +- cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING, +- debug_logging ? "1" : "0", +- cupsd_num_settings, &cupsd_settings); +- else +- cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING, +- old_debug_logging ? "1" : "0", +- cupsd_num_settings, &cupsd_settings); +- +- if (remote_admin >= 0) +- cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN, +- remote_admin ? "1" : "0", +- cupsd_num_settings, &cupsd_settings); +- else +- cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN, +- old_remote_admin ? "1" : "0", +- cupsd_num_settings, &cupsd_settings); +- +- if (remote_any >= 0) +- cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY, +- remote_any ? "1" : "0", +- cupsd_num_settings, &cupsd_settings); +- else +- cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY, +- old_remote_any ? "1" : "0", +- cupsd_num_settings, &cupsd_settings); +- +- if (share_printers >= 0) +- cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS, +- share_printers ? "1" : "0", +- cupsd_num_settings, &cupsd_settings); +- else +- cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS, +- old_share_printers ? "1" : "0", +- cupsd_num_settings, &cupsd_settings); +- +- if (user_cancel_any >= 0) +- cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY, +- user_cancel_any ? "1" : "0", +- cupsd_num_settings, &cupsd_settings); +- else +- cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY, +- old_user_cancel_any ? "1" : "0", +- cupsd_num_settings, &cupsd_settings); ++ cupsd_num_settings = cupsAddOption(CUPS_SERVER_DEBUG_LOGGING, ++ debug_logging ? "1" : "0", cupsd_num_settings, &cupsd_settings); ++ ++ cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ADMIN, ++ remote_admin ? "1" : "0", cupsd_num_settings, &cupsd_settings); ++ ++ cupsd_num_settings = cupsAddOption(CUPS_SERVER_REMOTE_ANY, ++ remote_any ? "1" : "0", cupsd_num_settings, &cupsd_settings); ++ ++ cupsd_num_settings = cupsAddOption(CUPS_SERVER_SHARE_PRINTERS, ++ share_printers ? "1" : "0", cupsd_num_settings, &cupsd_settings); ++ ++ cupsd_num_settings = cupsAddOption(CUPS_SERVER_USER_CANCEL_ANY, ++ user_cancel_any ? "1" : "0", cupsd_num_settings, &cupsd_settings); + + /* + * Save the new values... +-- +2.50.1 + diff --git a/debian/patches/0005-feat-enable-lpd-to-encode-title.patch b/debian/patches/0005-feat-enable-lpd-to-encode-title.patch new file mode 100644 index 0000000..7444fcb --- /dev/null +++ b/debian/patches/0005-feat-enable-lpd-to-encode-title.patch @@ -0,0 +1,272 @@ +From 53a4130fe7c6e17334d88cfe00aff25577c35e78 Mon Sep 17 00:00:00 2001 +From: LIU Li +Date: Thu, 6 Jun 2024 10:40:03 +0800 +Subject: [PATCH] feat: enable lpd to encode title + +Signed-off-by: LIU Li +Change-Id: I93edcea9103926db3cc8ea1e865bd5ee514f6d78 +--- + backend/lpd.c | 202 +++++++++++++++++++++++++++++++++++++++++++++++++- + 1 file changed, 200 insertions(+), 2 deletions(-) + +diff --git a/backend/lpd.c b/backend/lpd.c +index 989986b..9f883f0 100644 +--- a/backend/lpd.c ++++ b/backend/lpd.c +@@ -33,6 +33,7 @@ + # include + #endif /* __APPLE__ */ + ++#include + + /* + * Globals... +@@ -40,6 +41,7 @@ + + static char tmpfilename[1024] = ""; /* Temporary spool file name */ + static int abort_job = 0; /* Non-zero if we get SIGTERM */ ++static char* encode; + + + /* +@@ -77,6 +79,12 @@ static int lpd_command(int lpd_fd, char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))) + # endif /* __GNUC__ */ + ; ++static int /* O - Status of command */ ++lpd_get_encode(const char *hostname, /* I - Host to connect to */ ++ http_addrlist_t *addrlist, /* I - Socket connection to LPD host */ ++ char **serverencode, /* I - printf()-style format string */ ++ const char * printer, ++ int reserve); + static int lpd_queue(const char *hostname, http_addrlist_t *addrlist, const char *printer, int print_fd, int snmp_fd, int mode, const char *user, const char *title, int copies, int banner, int format, int order, int reserve, int manual_copies, int timeout, int contimeout, const char *orighost) _CUPS_NONNULL((1,2,3,7,8,17)); + static ssize_t lpd_write(int lpd_fd, char *buffer, size_t length); + static void sigterm_handler(int sig); +@@ -103,7 +111,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ + *name, /* Name of option */ + *value, /* Value of option */ + sep, /* Separator character */ +- title[256]; /* Title string */ ++ title[256] = {0}; /* Title string */ + int port; /* Port number */ + http_addrlist_t *addrlist; /* List of addresses for printer */ + int snmp_enabled = 1; /* Is SNMP enabled? */ +@@ -473,10 +481,29 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ + } + } + ++ encode = cupsGetOption("lpd-server-encode", num_jobopts, ++ jobopts); ++ fprintf(stderr, "got encode from options: %s\n", encode); ++ ++ if(!encode) ++ status = lpd_get_encode(hostname, addrlist, &encode, resource + 1, reserve); ++ + /* + * Sanitize the document title... + */ +- ++ if(encode) { ++ char *encFrom = "UTF-8"; ++ size_t nbufin = strlen(argv[3]), nbufout= 99; ++ iconv_t cd = iconv_open(encode, encFrom); ++ char *outbuf = title; ++ if(cd != (iconv_t)-1) { ++ size_t ret = iconv(cd, &argv[3], &nbufin, &outbuf, &nbufout); ++ if(ret == -1) fprintf(stderr, "DEBUG: iconv ERROR\n"); ++ iconv_close(cd); ++ } else{ ++ fprintf(stderr, "DEBUG: iconv_open FAILED! errorno=%d\n", errno); ++ } ++ } else { + strlcpy(title, argv[3], sizeof(title)); + + if (sanitize_title) +@@ -492,6 +519,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ + if (!isalnum(*ptr & 255) && !isspace(*ptr & 255)) + *ptr = '_'; + } ++ } + + /* + * Queue the job... +@@ -625,6 +653,176 @@ cups_rresvport(int *port, /* IO - Port number to bind to */ + return (-1); + } + ++static int /* O - Status of command */ ++lpd_get_encode(const char *hostname, /* I - Host to connect to */ ++ http_addrlist_t *addrlist, /* I - Socket connection to LPD host */ ++ char **serverencode, /* I - printf()-style format string */ ++ const char * printer, ++ int reserve) /* I - Additional args as necessary */ ++{ ++ char buf[1024] = {0}; /* Output buffer */ ++ char buf2[1024] = {0}; /* Output buffer */ ++ ssize_t bytes; /* Number of bytes to output */ ++ int status = 0; /* Status from command */ ++ ++ int fd; ++ http_addrlist_t *addr; /* Socket address */ ++ int lport, delay; ++ ++ ++ /* ++ * Don't try to send commands if the job has been canceled... ++ */ ++ ++ if (abort_job) ++ return (-1); ++ ++ fprintf(stderr, "DEBUG: Connecting to %s:%d for printer %s\n", hostname, ++ httpAddrPort(&(addrlist->addr)), printer); ++ ++ for (lport = reserve == RESERVE_RFC1179 ? 732 : 1024, addr = addrlist, ++ delay = 5;; ++ addr = addr->next) ++ { ++ /* ++ * Stop if this job has been canceled... ++ */ ++ ++ if (abort_job) ++ return (CUPS_BACKEND_FAILED); ++ ++ /* ++ * Choose the next priviledged port... ++ */ ++ ++ if (!addr) ++ addr = addrlist; ++ ++ lport --; ++ ++ if (lport < 721 && reserve == RESERVE_RFC1179) ++ lport = 731; ++ else if (lport < 1) ++ lport = 1023; ++ ++#ifdef HAVE_GETEUID ++ if (geteuid() || !reserve) ++#else ++ if (getuid() || !reserve) ++#endif /* HAVE_GETEUID */ ++ { ++ /* ++ * Just create a regular socket... ++ */ ++ ++ if ((fd = socket(addr->addr.addr.sa_family, SOCK_STREAM, 0)) < 0) ++ { ++ perror("DEBUG: Unable to create socket"); ++ sleep(1); ++ ++ continue; ++ } ++ ++ lport = 0; ++ } ++ else ++ { ++ /* ++ * We're running as root and want to comply with RFC 1179. Reserve a ++ * priviledged lport between 721 and 731... ++ */ ++ ++ if ((fd = cups_rresvport(&lport, reserve == RESERVE_RFC1179 ? 721 : 512, addr->addr.addr.sa_family)) < 0) ++ { ++ perror("DEBUG: Unable to reserve port"); ++ sleep(1); ++ ++ continue; ++ } ++ } ++ ++ /* ++ * Connect to the printer or server... ++ */ ++ ++ if (abort_job) ++ { ++ close(fd); ++ ++ return (CUPS_BACKEND_FAILED); ++ } ++ ++ if (!connect(fd, &(addr->addr.addr), (socklen_t)httpAddrLength(&(addr->addr)))) ++ break; ++ else { ++ close(fd); ++ return (CUPS_BACKEND_FAILED); ++ } ++ } ++ ++ /* ++ * Format the string... ++ */ ++ *serverencode = NULL; ++ ++ // bytes = vsnprintf(buf, sizeof(buf), format, ap); ++ bytes = snprintf(buf, sizeof(buf), "\004%s\n", printer); ++ ++ fprintf(stderr, "DEBUG: lpd_command %2.2x %s", buf[0], buf + 1); ++ ++ /* ++ * Send the command... ++ */ ++ ++ if (lpd_write(fd, buf, (size_t)bytes) < bytes) ++ { ++ perror("DEBUG: Unable to send LPD command"); ++ return (-1); ++ } ++ ++ /* ++ * Read back the status from the command and return it... ++ */ ++ bytes = recv(fd, buf, 1000, 0); ++ if (bytes < 1) ++ { ++ _cupsLangPrintFilter(stderr, "WARNING", _("The printer did not respond.")); ++ status = (char)errno; ++ } ++ ++ close(fd); ++ ++ // fprintf(stderr, "DEBUG: lpd_command reply %d bytes: %s\n", bytes, buf); ++ char *inbuf = strstr(buf, "Windows LPD"); ++ if (inbuf) { ++ //test server encode gb2312? ++ char *encFrom = "GB2312"; ++ char *encTo = "UTF-8"; ++ size_t nbufin = strstr(inbuf, "\r")-inbuf, nbufout= 1000; ++ iconv_t cd = iconv_open(encTo, encFrom); ++ // char *inbuf = strstr(buf, "Windows LPD"); ++ char *outbuf = buf2; ++ if(cd != (iconv_t)-1) { ++ // fprintf(stderr, "DEBUG: iconv_open OK nbufin=%d\n", nbufin); ++ size_t ret = iconv(cd, &inbuf, &nbufin, &outbuf, &nbufout); ++ // fprintf(stderr, "DEBUG: iconv ret=%d\n", ret); ++ iconv_close(cd); ++ if(ret == -1) { ++ fprintf(stderr, "DEBUG: iconv ERROR\n"); ++ // break; ++ }else{ ++ const char lpdServer[] = "Windows LPD 服务器"; ++ if(strstr(buf2, lpdServer)) ++ *serverencode = strdup(encFrom); ++ // break; ++ } ++ } ++ } ++ fprintf(stderr, "lpd_command got encode = %s\n", *serverencode); ++ ++ return status; ++} ++ + + /* + * 'lpd_command()' - Send an LPR command sequence and wait for a reply. +-- +2.50.1 + diff --git a/debian/patches/0007-Feat-add-audit-log-to-CUPS.patch b/debian/patches/0007-Feat-add-audit-log-to-CUPS.patch new file mode 100644 index 0000000..acb2c79 --- /dev/null +++ b/debian/patches/0007-Feat-add-audit-log-to-CUPS.patch @@ -0,0 +1,209 @@ +From c224a7dff8fb6d03d34fb1bf8085dd6fffaf293a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=E5=88=98=E8=8E=89?= +Date: Tue, 12 Jul 2022 15:14:53 +0800 +Subject: [PATCH] Feat: add audit log to CUPS +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +log to /var/log/cups/os_audit.log + +Signed-off-by: 刘莉 +Change-Id: I9e3ee7176b158a381db9274f11aeb34ab5bc62b9 +--- + scheduler/subscriptions.c | 160 +++++++++++++++++++++++++++++++++++++- + 1 file changed, 156 insertions(+), 4 deletions(-) + +diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c +index 2dbb28f85..0bcdfe457 100644 +--- a/scheduler/subscriptions.c ++++ b/scheduler/subscriptions.c +@@ -39,8 +39,157 @@ static void cupsd_send_notification(cupsd_subscription_t *sub, + cupsd_event_t *event); + static void cupsd_start_notifier(cupsd_subscription_t *sub); + static void cupsd_update_notifier(void); ++static int last_log_jobid = 0; + + ++ ++static void addJobAuditLog(cupsd_eventmask_t event, /* I - Event */ ++ cupsd_printer_t *dest, /* I - Printer associated with event */ ++ cupsd_job_t *job, ++ const char *text) ++{ ++ if ((CUPSD_EVENT_JOB_STATE_CHANGED & event) == 0 || !job || !strncmp(text, "Job purged by", strlen("Job purged by"))) { ++ return; ++ } ++ ++ char jobResult[8] = {0}; ++ ++ if (job->state_value == IPP_JOB_COMPLETED) ++ strcpy(jobResult, "成功"); ++ if (job->state_value == IPP_JOB_CANCELED) ++ strcpy(jobResult, "取消"); ++ if (job->state_value == IPP_JOB_ABORTED || job->state_value == IPP_JOB_STOPPED) ++ strcpy(jobResult, "失败"); ++ ++ if (strlen(jobResult) == 0) ++ return; ++ ++ int copies = 0, ++ impressions = 0; ++ ++ ipp_attribute_t * attr; ++ ++ if ((attr = ippFindAttribute(job->attrs, "copies", IPP_TAG_INTEGER)) != NULL) { ++ copies = attr->values[0].integer; ++ } else { ++ copies = 1; ++ } ++ ++ char *jobName = NULL; ++ if ((attr = ippFindAttribute(job->attrs, "job-name", IPP_TAG_NAME)) != NULL) { ++ jobName = attr->values[0].string.text; ++ } ++ ++ impressions = job->sheets ? job->sheets->values[0].integer : 0; ++ ++ char *printerUri = NULL; ++ ++ char printerType[64] = {0}; ++ cupsd_printer_t *printer = cupsdFindPrinter(job->dest); ++ if (printer) { ++ printerUri = strdup(printer->device_uri); ++ char *ptr = strchr(printerUri,':'); ++ if (ptr) ++ *ptr = '\0'; ++ ++ if (strcmp(printerUri, "ipp") == 0 || strcmp(printerUri, "ipps") == 0 || strcmp(printerUri, "http") == 0 || strcmp(printerUri, "https") == 0 || ++ strcmp(printerUri, "smb") == 0 || strcmp(printerUri, "lpd") == 0 || strcmp(printerUri, "socket") == 0 || strcmp(printerUri, "dnssd") == 0) { ++ strcpy(printerType, "网络打印机"); ++ } else { ++ strcpy(printerType, "本地打印机"); ++ } ++ ++ if (printerUri) ++ free(printerUri); ++ } else { ++ strcpy(printerType, "未知"); ++ } ++ ++ struct timeval curtime; ++ gettimeofday(&curtime, NULL); ++ struct tm date; ++ localtime_r(&(curtime.tv_sec), &date); ++ char fomatTime[1024] = {0}; ++ snprintf(fomatTime, sizeof(fomatTime), "%04d-%02d-%02d %02d:%02d:%02d", ++ 1900 + date.tm_year, date.tm_mon + 1, date.tm_mday, ++ date.tm_hour, date.tm_min, date.tm_sec); ++ ++ char fileSize[64] = {0}; ++ fileSize[0] = '-'; ++ char *absPath = NULL; ++ absPath = realpath(jobName, NULL); ++ if ( absPath && strcmp(absPath, jobName) == 0){ ++ struct stat buf; ++ if (stat(absPath, &buf) == 0) { ++ snprintf(fileSize, sizeof(fileSize), "%ldbyte(s)", buf.st_size); ++ }else{ ++ cupsdLogMessage(CUPSD_LOG_ERROR, ++ "addJobAuditLog get file %s size failed, errno = 0x%x", absPath, errno); ++ } ++ free(absPath); ++ absPath = NULL; ++ } ++ ++ cups_file_t *logFd = cupsFileOpen("/var/log/cups/os_audit.log", "a"); ++ if (logFd == NULL) { ++ cupsdLogMessage(CUPSD_LOG_DEBUG, ++ "addJobAuditLog(ID=%ld time=%s pirnter-name=%s printer-type=%s 用户=%s job-ID=%d title=%s filesize=%s copies=%d impressions=%d result=%s)", ++ time(NULL), fomatTime, job->dest, printerType, job->username, ++ job->id, jobName, fileSize, copies, impressions, jobResult); ++ ++ return ; ++ } ++ ++ cupsFilePrintf(logFd, "ID=%ld 时间=%s 打印机名称=%s 打印机类型=%s 打印机地址=%s 用户=%s 打印机队列ID=%d 文件名称=%s 文件大小=%s 份数=%d 页数=%d 结果=%s\n", ++ time(NULL), fomatTime, job->dest, printerType, printer->device_uri, job->username, ++ job->id, jobName, fileSize, copies, impressions, jobResult); ++ cupsFileFlush(logFd); ++ cupsFileClose(logFd); ++ int rotatePid; ++ struct stat logSize; ++ // log size >= 10M or get log size failed ++ if((stat("/var/log/cups/os_audit.log", &logSize) == 0 && logSize.st_size>=10*1024*1024)) ++ { ++ cupsdLogMessage(CUPSD_LOG_DEBUG, "addJobAuditLog logrotate!"); ++ if((rotatePid = fork()) == 0) ++ execlp("logrotate", "logrotate", "/etc/logrotate.d/cups-daemon", NULL); ++ } ++ return; ++} ++ ++#define AUDIT_PRINT_FILE "/var/lib/deepin/permission-manager/print_audit" ++#define CHECK_AUDIT_FILE "/sys/fs/selinux/checkaudit" ++#define CHECK_AUDIT_FILE_1070 "/sys/fs/selinux2/checkaudit" ++#define CHECK_AUDIT_FILE_v25 "/sys/fs/usec/checkaudit" ++ ++// 0 表示审计开启 ++// -1 表示审计关闭 ++static int get_file_audit_status(const char *file_path) ++{ ++ int fd, len, file_path_len; ++ int ret = -1; ++ ++ file_path_len = strlen(file_path); ++ if (file_path_len == 0) ++ return -1; ++ ++ fd = open(CHECK_AUDIT_FILE, O_RDWR | O_CLOEXEC); ++ if ( fd <= 0 ){ ++ fd = open(CHECK_AUDIT_FILE_v25, O_RDWR | O_CLOEXEC); ++ } ++ if ( fd <= 0 ){ ++ fd = open(CHECK_AUDIT_FILE_1070, O_RDWR | O_CLOEXEC); ++ if ( fd <= 0 ) return -1; ++ } ++ len = write(fd, file_path, file_path_len); ++ if ( len == file_path_len){ ++ ret = 0; ++ } ++ close(fd); ++ ++ return ret; ++} ++ + /* + * 'cupsdAddEvent()' - Add an event to the global event cache. + */ +@@ -60,10 +209,15 @@ cupsdAddEvent( + cupsd_subscription_t *sub; /* Current subscription */ + + ++ va_start(ap, text); ++ vsnprintf(ftext, sizeof(ftext), text, ap); ++ va_end(ap); ++ if (job && get_file_audit_status(AUDIT_PRINT_FILE) == 0) ++ addJobAuditLog(event, dest, job, ftext); + cupsdLogMessage(CUPSD_LOG_DEBUG2, + "cupsdAddEvent(event=%s, dest=%p(%s), job=%p(%d), text=\"%s\", ...)", + cupsdEventName(event), dest, dest ? dest->name : "", +- job, job ? job->id : 0, text); ++ job, job ? job->id : 0, ftext); + + /* + * Keep track of events with any OS-supplied notification mechanisms... +@@ -151,9 +305,7 @@ cupsdAddEvent( + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER, + "printer-up-time", time(NULL)); + +- va_start(ap, text); +- vsnprintf(ftext, sizeof(ftext), text, ap); +- va_end(ap); ++ + + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_TEXT, + "notify-text", NULL, ftext); +-- +2.20.1 + diff --git a/debian/patches/0017-Compatible-with-printer-driver-which-runs-on-V20.patch b/debian/patches/0017-Compatible-with-printer-driver-which-runs-on-V20.patch new file mode 100644 index 0000000..3c620c3 --- /dev/null +++ b/debian/patches/0017-Compatible-with-printer-driver-which-runs-on-V20.patch @@ -0,0 +1,92 @@ +From 6fb8a6f40e09b068780ac7ecdf0b68886015096e Mon Sep 17 00:00:00 2001 +From: reddevillg +Date: Wed, 4 Dec 2024 15:28:30 +0800 +Subject: [PATCH] Compatible with printer driver which runs on V20 + +If deepin-compatible-ctl exist, use it to run external process. + +Change-Id: Ifa668bb6dae6f6ff311dd2ec43a68737b8885516 +--- + scheduler/process.c | 47 ++++++++++++++++++++++++++++++++------------- + 1 file changed, 34 insertions(+), 13 deletions(-) + +diff --git a/scheduler/process.c b/scheduler/process.c +index 1492e767d..b2158d4e4 100644 +--- a/scheduler/process.c ++++ b/scheduler/process.c +@@ -478,7 +478,10 @@ cupsdStartProcess( + cups_exec[1024], /* Path to "cups-exec" program */ + user_str[16], /* User string */ + group_str[16], /* Group string */ +- nice_str[16]; /* FilterNice string */ ++ nice_str[16], /* FilterNice string */ ++ filter_path[1024] = {0}, ++ backend_path[1024] = {0}; ++ + uid_t user; /* Command UID */ + cupsd_proc_t *proc; /* New process record */ + #if USE_POSIX_SPAWN +@@ -555,30 +558,48 @@ cupsdStartProcess( + if (profile) + #endif /* !USE_POSIX_SPAWN */ + { ++ struct stat fileinfo; ++ int idx = 0; ++ + snprintf(cups_exec, sizeof(cups_exec), "%s/daemon/cups-exec", ServerBin); + snprintf(user_str, sizeof(user_str), "%d", user); + snprintf(group_str, sizeof(group_str), "%d", Group); + snprintf(nice_str, sizeof(nice_str), "%d", FilterNice); ++ snprintf(filter_path, sizeof(filter_path), "%s/filter/", ServerBin); ++ snprintf(backend_path, sizeof(backend_path), "%s/backend/", ServerBin); ++ ++ if (!stat("/usr/bin/deepin-compatible-ctl", &fileinfo) && ++ (strncmp(command, filter_path, strlen(filter_path)) == 0 || strncmp(command, backend_path, strlen(backend_path)) == 0)) ++ { ++ real_argv[0] = (char *)"deepin-compatible-ctl"; ++ real_argv[1] = (char *)"app"; ++ real_argv[2] = (char *)"--ldrd"; ++ real_argv[3] = (char *)"run"; ++ real_argv[4] = (char *)"--"; ++ idx = 5; ++ exec_path = "/usr/bin/deepin-compatible-ctl"; ++ } else { ++ exec_path = cups_exec; ++ } + +- real_argv[0] = cups_exec; +- real_argv[1] = (char *)"-g"; +- real_argv[2] = group_str; +- real_argv[3] = (char *)"-n"; +- real_argv[4] = nice_str; +- real_argv[5] = (char *)"-u"; +- real_argv[6] = user_str; +- real_argv[7] = profile ? profile : "none"; +- real_argv[8] = (char *)command; ++ real_argv[idx + 0] = cups_exec; ++ real_argv[idx + 1] = (char *)"-g"; ++ real_argv[idx + 2] = group_str; ++ real_argv[idx + 3] = (char *)"-n"; ++ real_argv[idx + 4] = nice_str; ++ real_argv[idx + 5] = (char *)"-u"; ++ real_argv[idx + 6] = user_str; ++ real_argv[idx + 7] = profile ? profile : "none"; ++ real_argv[idx + 8] = (char *)command; + + for (i = 0; + i < (int)(sizeof(real_argv) / sizeof(real_argv[0]) - 10) && argv[i]; + i ++) +- real_argv[i + 9] = argv[i]; ++ real_argv[idx + i + 9] = argv[i]; + +- real_argv[i + 9] = NULL; ++ real_argv[idx + i + 9] = NULL; + + argv = real_argv; +- exec_path = cups_exec; + } + + if (LogLevel == CUPSD_LOG_DEBUG2) +-- +2.20.1 + diff --git a/debian/patches/series b/debian/patches/series index 1e7b54a..5c3e039 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -11,3 +11,7 @@ 0016-Debian-po4a-infrastructure-and-translations-for-manp.patch 0012-add-pt.patch 0013-let-WARNING-test-always-pass.patch +0001-fix-Refactor-part-of-server-settings-code.patch +0005-feat-enable-lpd-to-encode-title.patch +0007-Feat-add-audit-log-to-CUPS.patch +0017-Compatible-with-printer-driver-which-runs-on-V20.patch From 46b01ebc5a3eaee8171e7803f510073fab93c917 Mon Sep 17 00:00:00 2001 From: Liu Date: Wed, 28 Jan 2026 17:30:16 +0800 Subject: [PATCH 2/2] fix: remove t64 Change-Id: I7904eff3795b747a83889a91ecc778bdc37b778d --- debian/control | 30 +++++++++---------- ...4.README.Debian => libcups2.README.Debian} | 0 ...libcups2t64.examples => libcups2.examples} | 0 .../{libcups2t64.install => libcups2.install} | 0 debian/libcups2.lintian-overrides | 1 + .../{libcups2t64.symbols => libcups2.symbols} | 4 +-- debian/libcups2t64.lintian-overrides | 1 - debian/libcupsimage2-dev.substvars | 1 + ...mage2t64.install => libcupsimage2.install} | 0 debian/libcupsimage2.lintian-overrides | 1 + ...mage2t64.symbols => libcupsimage2.symbols} | 4 +-- debian/libcupsimage2t64.lintian-overrides | 1 - debian/rules | 4 +-- 13 files changed, 23 insertions(+), 24 deletions(-) rename debian/{libcups2t64.README.Debian => libcups2.README.Debian} (100%) rename debian/{libcups2t64.examples => libcups2.examples} (100%) rename debian/{libcups2t64.install => libcups2.install} (100%) create mode 100644 debian/libcups2.lintian-overrides rename debian/{libcups2t64.symbols => libcups2.symbols} (99%) delete mode 100644 debian/libcups2t64.lintian-overrides create mode 100644 debian/libcupsimage2-dev.substvars rename debian/{libcupsimage2t64.install => libcupsimage2.install} (100%) create mode 100644 debian/libcupsimage2.lintian-overrides rename debian/{libcupsimage2t64.symbols => libcupsimage2.symbols} (82%) delete mode 100644 debian/libcupsimage2t64.lintian-overrides diff --git a/debian/control b/debian/control index 1c295cb..5231bc5 100644 --- a/debian/control +++ b/debian/control @@ -37,10 +37,9 @@ Vcs-Git: https://salsa.debian.org/printing-team/cups.git Homepage: https://github.com/OpenPrinting/cups/ Rules-Requires-Root: no -Package: libcups2t64 -Provides: ${t64:Provides} -Replaces: libcups2 -Breaks: libcups2 (<< ${source:Version}) +Package: libcups2 +Provides: libcups2t64 +Replaces: libcups2t64 Architecture: any Multi-Arch: same Section: libs @@ -72,7 +71,7 @@ Depends: cups-server-common (>= ${source:Version}), debconf | debconf-2.0, ghostscript, - libcups2t64 (= ${binary:Version}), + libcups2 (= ${binary:Version}), poppler-utils, procps, ${misc:Depends}, @@ -135,7 +134,7 @@ Multi-Arch: foreign Depends: adduser, cups-common (>= ${source:Version}), - libcups2t64 (= ${binary:Version}), + libcups2 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}, Suggests: @@ -172,7 +171,7 @@ Multi-Arch: foreign Depends: cups-daemon (>= ${binary:Version}), cups-filters-core-drivers, - libcups2t64 (= ${binary:Version}), + libcups2 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}, Recommends: @@ -200,7 +199,7 @@ Pre-Depends: Depends: adduser, bc, - libcups2t64 (= ${binary:Version}), + libcups2 (= ${binary:Version}), lsb-base, procps, ssl-cert, @@ -242,7 +241,7 @@ Package: cups-ipp-utils Architecture: any Multi-Arch: foreign Depends: - libcups2t64 (= ${binary:Version}), + libcups2 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}, Recommends: @@ -295,7 +294,7 @@ Multi-Arch: same Section: libdevel Depends: dpkg-dev, - libcups2t64 (= ${binary:Version}), + libcups2 (= ${binary:Version}), libcupsimage2-dev (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}, @@ -310,15 +309,14 @@ Description: Common UNIX Printing System(tm) - Development files CUPS library with cups from different programming languages (Perl, Java, and PHP). -Package: libcupsimage2t64 -Provides: ${t64:Provides} -Replaces: libcupsimage2 -Breaks: libcupsimage2 (<< ${source:Version}) +Package: libcupsimage2 +Provides: libcupsimage2t64 +Replaces: libcupsimage2t64 Architecture: any Multi-Arch: same Section: libs Depends: - libcups2t64 (= ${binary:Version}), + libcups2 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}, Recommends: @@ -340,7 +338,7 @@ Multi-Arch: same Section: libdevel Depends: libcups2-dev (= ${binary:Version}), - libcupsimage2t64 (= ${binary:Version}), + libcupsimage2 (= ${binary:Version}), libjpeg-dev, libpng-dev, libtiff-dev, diff --git a/debian/libcups2t64.README.Debian b/debian/libcups2.README.Debian similarity index 100% rename from debian/libcups2t64.README.Debian rename to debian/libcups2.README.Debian diff --git a/debian/libcups2t64.examples b/debian/libcups2.examples similarity index 100% rename from debian/libcups2t64.examples rename to debian/libcups2.examples diff --git a/debian/libcups2t64.install b/debian/libcups2.install similarity index 100% rename from debian/libcups2t64.install rename to debian/libcups2.install diff --git a/debian/libcups2.lintian-overrides b/debian/libcups2.lintian-overrides new file mode 100644 index 0000000..b522151 --- /dev/null +++ b/debian/libcups2.lintian-overrides @@ -0,0 +1 @@ +libcups2: package-name-doesnt-match-sonames libcups2 diff --git a/debian/libcups2t64.symbols b/debian/libcups2.symbols similarity index 99% rename from debian/libcups2t64.symbols rename to debian/libcups2.symbols index fd047e0..7d067bd 100644 --- a/debian/libcups2t64.symbols +++ b/debian/libcups2.symbols @@ -1,5 +1,5 @@ -libcups.so.2 libcups2t64 #MINVER# -* Build-Depends-Package: libcups2t64-dev +libcups.so.2 libcups2 #MINVER# +* Build-Depends-Package: libcups2-dev # Keep these at the latest upstream release (optional|regex)"^_pwg.*@Base$" 2.3~b6 (optional|regex)"^_cups.*@Base$" 2.3~b6 diff --git a/debian/libcups2t64.lintian-overrides b/debian/libcups2t64.lintian-overrides deleted file mode 100644 index 0d731fa..0000000 --- a/debian/libcups2t64.lintian-overrides +++ /dev/null @@ -1 +0,0 @@ -libcups2t64: package-name-doesnt-match-sonames libcups2 diff --git a/debian/libcupsimage2-dev.substvars b/debian/libcupsimage2-dev.substvars new file mode 100644 index 0000000..483fe24 --- /dev/null +++ b/debian/libcupsimage2-dev.substvars @@ -0,0 +1 @@ +misc:Depends=libcupsimage2 (= ${binary:Version}) diff --git a/debian/libcupsimage2t64.install b/debian/libcupsimage2.install similarity index 100% rename from debian/libcupsimage2t64.install rename to debian/libcupsimage2.install diff --git a/debian/libcupsimage2.lintian-overrides b/debian/libcupsimage2.lintian-overrides new file mode 100644 index 0000000..464149c --- /dev/null +++ b/debian/libcupsimage2.lintian-overrides @@ -0,0 +1 @@ +libcupsimage2: package-name-doesnt-match-sonames libcupsimage2 diff --git a/debian/libcupsimage2t64.symbols b/debian/libcupsimage2.symbols similarity index 82% rename from debian/libcupsimage2t64.symbols rename to debian/libcupsimage2.symbols index 0026dc6..130b603 100644 --- a/debian/libcupsimage2t64.symbols +++ b/debian/libcupsimage2.symbols @@ -1,5 +1,5 @@ -libcupsimage.so.2 libcupsimage2t64 #MINVER# -* Build-Depends-Package: libcupsimage2t64-dev +libcupsimage.so.2 libcupsimage2 #MINVER# +* Build-Depends-Package: libcupsimage2-dev # Keep this one at the latest upstream release (optional|regex)|^_cups.*@Base$" 1.6.2 cupsRasterClose@Base 1.4.0 diff --git a/debian/libcupsimage2t64.lintian-overrides b/debian/libcupsimage2t64.lintian-overrides deleted file mode 100644 index 428742e..0000000 --- a/debian/libcupsimage2t64.lintian-overrides +++ /dev/null @@ -1 +0,0 @@ -libcupsimage2t64: package-name-doesnt-match-sonames libcupsimage2 diff --git a/debian/rules b/debian/rules index f751073..1eea226 100755 --- a/debian/rules +++ b/debian/rules @@ -276,8 +276,8 @@ override_dh_auto_clean: [ ! -f Makedefs ] || make distclean override_dh_installdocs: - dh_installdocs -plibcupsimage2-dev --link-doc=libcupsimage2t64 - dh_installdocs -pcups-bsd --link-doc=libcups2t64 + dh_installdocs -plibcupsimage2-dev --link-doc=libcupsimage2 + dh_installdocs -pcups-bsd --link-doc=libcups2 dh_installdocs --remaining-packages rm -f debian/libcups2-dev/usr/share/doc/libcups2-dev/examples/scripting/php/*.o