From df76c461bbe020dade1881bcdaa3732182303092 Mon Sep 17 00:00:00 2001 From: Didier Raboud Date: Tue, 9 Aug 2016 18:11:24 +0200 Subject: Move cupsd.conf.default from SERVERROOT to DATADIR Origin: vendor Bug: https://cups.org/str.php?L4342 Bug-Debian: http://bugs.debian.org/640124 Last-Update: 2015-02-10 Patch-Name: move-cupsd-conf-default-to-share.patch --- cgi-bin/admin.c | 6 +++++- conf/Makefile | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c index 43fad787e..f0d01598d 100644 --- a/cgi-bin/admin.c +++ b/cgi-bin/admin.c @@ -1922,6 +1922,7 @@ do_config_server(http_t *http) /* I - HTTP connection */ int ch; /* Character from file */ char filename[1024]; /* Filename */ const char *server_root; /* Location of config files */ + const char *data_dir; /* Location of data files */ /* @@ -2005,7 +2006,10 @@ do_config_server(http_t *http) /* I - HTTP connection */ * well... */ - strlcat(filename, ".default", sizeof(filename)); + if ((data_dir = getenv("CUPS_DATADIR")) == NULL) + data_dir = CUPS_DATADIR; + + snprintf(filename, sizeof(filename), "%s/cupsd.conf.default",data_dir); if (!stat(filename, &info) && info.st_size < (1024 * 1024) && (cupsd = cupsFileOpen(filename, "r")) != NULL) diff --git a/conf/Makefile b/conf/Makefile index e8f88ec88..4302ebac9 100644 --- a/conf/Makefile +++ b/conf/Makefile @@ -74,7 +74,7 @@ install-data: else \ $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \ fi ; \ - $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT)/$$file.default; \ + $(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(DATADIR)/$$file.default; \ done $(INSTALL_DIR) -m 755 $(DATADIR)/mime for file in $(REPLACE); do \ @@ -122,9 +122,10 @@ install-libs: # uninstall: - for file in $(KEEP) $(REPLACE) cupsd.conf.default; do \ + for file in $(KEEP) $(REPLACE); do \ $(RM) $(SERVERROOT)/$$file; \ done + $(RM) $(DATADIR)/cupsd.conf.default -$(RMDIR) $(SERVERROOT) for file in $(REPLACE); do \ $(RM) $(DATADIR)/mime/$$file; \