summaryrefslogtreecommitdiff
path: root/debian/patches/move-cupsd-conf-default-to-share.patch
blob: bf5467e2425af8ebef4ba5ebd46f4f8e0b19d3fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Description: Move cupsd.conf.default from SERVERROOT to DATADIR
Author: Didier Raboud <odyx@debian.org>
Origin: vendor
Bug: https://cups.org/str.php?L4342
Bug-Debian: http://bugs.debian.org/640124
Last-Update: 2014-01-16

--- a/cgi-bin/admin.c
+++ b/cgi-bin/admin.c
@@ -1937,6 +1937,7 @@
     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 */
 
 
    /*
@@ -2020,7 +2021,10 @@
     * 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)
--- a/conf/Makefile
+++ b/conf/Makefile
@@ -77,7 +77,7 @@
 			$(INSTALL_CONFIG) -g $(CUPS_GROUP) $$file $(SERVERROOT) ; \
 		fi ; \
 	done
-	$(INSTALL_CONFIG) -g $(CUPS_GROUP) cupsd.conf $(SERVERROOT)/cupsd.conf.default
+	$(INSTALL_CONFIG) -g $(CUPS_GROUP) cupsd.conf $(DATADIR)/cupsd.conf.default
 	$(INSTALL_DIR) -m 755 $(DATADIR)/mime
 	for file in $(REPLACE); do \
 		if test -r $(DATADIR)/mime/$$file ; then \
@@ -124,9 +124,10 @@
 #
 
 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; \