summarylogtreecommitdiffstats
path: root/pkging.patch
blob: faa1f9a9538f6b85c3c9d9ee6fba1a2e299c3383 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
diff --git a/Makefile.Linux b/Makefile.Linux
index 6ca5ec7..261b3c0 100644
--- a/Makefile.Linux
+++ b/Makefile.Linux
@@ -10,7 +10,7 @@
 BUILDDIR = ../bin/
 CC = gcc
 
-CFLAGS = -g -O2 -fno-strict-aliasing -c -pthread -DWITHSPLICE -D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER
+CFLAGS = -Werror-implicit-function-declaration  -g -O2 -fno-strict-aliasing -c -pthread -DWITHSPLICE -D_GNU_SOURCE -DGETHOSTBYNAME_R -D_THREAD_SAFE -D_REENTRANT -DNOODBC -DWITH_STD_MALLOC -DFD_SETSIZE=4096 -DWITH_POLL -DWITH_NETFILTER
 COUT = -o 
 LN = gcc
 DCFLAGS = -fpic
@@ -67,7 +67,7 @@ INSTALL_CFG_OBJS2 = counters bandlimiters
 
 INSTALL_INITD_SCRIPT = scripts/init.d/3proxy.sh
 
-CHROOTDIR	= $(DESTDIR)/usr/local/3proxy
+CHROOTDIR	= $(DESTDIR)/var/lib/3proxy
 MANDIR1		= $(DESTDIR)$(man_prefix)/man/man1
 MANDIR3		= $(DESTDIR)$(man_prefix)/man/man3
 MANDIR8		= $(DESTDIR)$(man_prefix)/man/man8
@@ -120,10 +120,6 @@ install-init:
 	if [ -d $(INITDIR) ]; then \
 	 $(INSTALL_BIN) $(INSTALL_INITD_SCRIPT) $(INITDDIR)/3proxy; \
 	fi
-	if [ -f /usr/sbin/update-rc.d ]; then \
-	 /usr/sbin/update-rc.d 3proxy defaults; \
-	 /usr/sbin/update-rc.d 3proxy enable; \
-	fi
 
 install-run:
 	$(INSTALL_BIN) -d $(RUNDIR)
@@ -134,14 +130,6 @@ install-log:
 	fi
 
 install: install-chroot-dir install-bin install-etc install-log install-man install-run install-init
-	@getent passwd proxy || useradd -UMr -s /bin/false -c 3proxy proxy
-	@if [ ! -f $(INSTALL_CFG_DEST)/passwd ]; then \
-	touch $(INSTALL_CFG_DEST)/passwd;\
-	fi
-	@chown -R proxy:proxy $(CHROOTDIR)
-	@chmod 550  $(CHROOTDIR)/
-	@chmod 550  $(CHROOTDIR)/conf/
-	@chmod 440  $(CHROOTDIR)/conf/*
 	@echo ""
 	@echo 3proxy installed.
 	@echo use
@@ -156,7 +144,3 @@ install: install-chroot-dir install-bin install-etc install-log install-man inst
 	@echo It\'s recommended to use provider supplied DNS or install local recursor, e.g. pdns-recursor.
 	@echo Configure preferred DNS in $(INSTALL_CFG_DEST)/3proxy.cfg.
 	@echo run \'$(INSTALL_CFG_DEST)/add3proxyuser.sh admin password\' to configure \'admin\' user
-	@if [ -f /usr/sbin/service ]; then \
-	 /usr/sbin/service 3proxy stop ;\
-	 /usr/sbin/service 3proxy start ;\
-	fi
diff --git a/cfg/3proxy.cfg.sample b/cfg/3proxy.cfg.sample
index f077a0b..d674d28 100644
--- a/cfg/3proxy.cfg.sample
+++ b/cfg/3proxy.cfg.sample
@@ -1,7 +1,7 @@
-#!/usr/local/bin/3proxy
+#!/bin/3proxy
 # Yes, 3proxy.cfg can be executable, in this case you should place
 # something like
-#config /usr/local/3proxy/3proxy.cfg
+#config /3proxy/3proxy.cfg
 # to show which configuration 3proxy should re-read on realod.
 
 #system "echo Hello world!"
@@ -26,7 +26,7 @@ timeouts 1 5 30 60 180 1800 15 60
 users 3APA3A:CL:3apa3a "test:CR:$1$qwer$CHFTUFGqkjue9HyhcMHEe1"
 # note that "" required, overvise $... is treated as include file name.
 # $1$qwer$CHFTUFGqkjue9HyhcMHEe1 is 'test' in MD5 crypt format.
-#users $/usr/local/etc/3proxy/passwd
+#users $/etc/3proxy/passwd
 # this example shows you how to include passwd file. For included files
 # <CR> and <LF> are treated as field separators.
 
@@ -193,7 +193,7 @@ admin
 #tcppm 443 websrv 443
 
 
-#chroot /usr/local/jail
+#chroot /jail
 #setgid 65535
 #setuid 65535
 # now we needn't any root rights. We can chroot and setgid/setuid.
diff --git a/man/3proxy.8 b/man/3proxy.8
index 0a26479..ce8da39 100644
--- a/man/3proxy.8
+++ b/man/3proxy.8
@@ -84,7 +84,7 @@ directory). Under Unix, if no config file is specified, 3proxy reads
 configuration from stdin. It makes it possible to use 3proxy.cfg file as
 executable script just by setting +x mode and adding
 .br
-#!/usr/local/3proxy/3proxy
+#!/3proxy/3proxy
 .br
 as a first line in 3proxy.cfg
 .TP
@@ -133,7 +133,7 @@ Web admin service can also be used to reload configuration. Use
 wget to automate this task.
 .SH FILES
 .TP
-.I "/usr/local/3proxy/3proxy.cfg (3proxy.cfg)"
+.I "/3proxy/3proxy.cfg (3proxy.cfg)"
 .BR 3proxy
 configuration file
 .SH BUGS
diff --git a/man/3proxy.cfg.3 b/man/3proxy.cfg.3
index 661d330..45a313f 100644
--- a/man/3proxy.cfg.3
+++ b/man/3proxy.cfg.3
@@ -32,7 +32,7 @@ Good practice is to quote any argument you use.
  File inclusion:
 .br
  You can include file by using $FILENAME macro (replace FILENAME with a path
-to file, for example $/usr/local/etc/3proxy/conf.incl or 
+to file, for example $/etc/3proxy/conf.incl or 
  $"c:\\\\Program Files\\3proxy\\include.cfg" Quotation is
 required in last example because path contains space character. 
 For included file <CR> (end of line characters) is treated as space character
diff --git a/scripts/3proxy.cfg.chroot b/scripts/3proxy.cfg.chroot
index 6083671..1313b7a 100644
--- a/scripts/3proxy.cfg.chroot
+++ b/scripts/3proxy.cfg.chroot
@@ -1,5 +1,5 @@
 #!/bin/3proxy
 daemon
 pidfile /var/run/3proxy/3proxy.pid
-chroot /usr/local/3proxy proxy proxy
+chroot /var/lib/3proxy proxy proxy
 include /conf/3proxy.cfg
diff --git a/scripts/install-unix.sh b/scripts/install-unix.sh
index a54c91e..0c5f82a 100644
--- a/scripts/install-unix.sh
+++ b/scripts/install-unix.sh
@@ -2,21 +2,21 @@
 cd ..
 cp Makefile.unix Makefile
 make
-if [ ! -d /usr/local/etc/3proxy/bin ]; then mkdir -p /usr/local/etc/3proxy/bin/; fi
-install bin/3proxy /usr/local/bin/3proxy
-install bin/mycrypt /usr/local/bin/mycrypt
-install scripts/rc.d/proxy.sh /usr/local/etc/rc.d/proxy.sh
-install scripts/add3proxyuser.sh /usr/local/etc/3proxy/bin/
-if [ -s /usr/local/etc/3proxy/3proxy.cfg ]; then
- echo /usr/local/etc/3proxy/3proxy.cfg already exists
+if [ ! -d /etc/3proxy/bin ]; then mkdir -p /etc/3proxy/bin/; fi
+install bin/3proxy /bin/3proxy
+install bin/mycrypt /bin/mycrypt
+install scripts/rc.d/proxy.sh /etc/rc.d/proxy.sh
+install scripts/add3proxyuser.sh /etc/3proxy/bin/
+if [ -s /etc/3proxy/3proxy.cfg ]; then
+ echo /etc/3proxy/3proxy.cfg already exists
 else
- install scripts/3proxy.cfg /usr/local/etc/3proxy/
+ install scripts/3proxy.cfg /etc/3proxy/
  if [ ! -d /var/log/3proxy/ ]; then
   mkdir /var/log/3proxy/
  fi
- touch /usr/local/etc/3proxy/passwd
- touch /usr/local/etc/3proxy/counters
- touch /usr/local/etc/3proxy/bandlimiters
- echo Run /usr/local/etc/3proxy/bin/add3proxyuser.sh to add \'admin\' user
+ touch /etc/3proxy/passwd
+ touch /etc/3proxy/counters
+ touch /etc/3proxy/bandlimiters
+ echo Run /etc/3proxy/bin/add3proxyuser.sh to add \'admin\' user
 fi
 
diff --git a/src/stringtable.c b/src/stringtable.c
index 4bfc7c2..95c9618 100644
--- a/src/stringtable.c
+++ b/src/stringtable.c
@@ -37,7 +37,7 @@ unsigned char * strings[] = {
 /* 24 */	NULL,
 #ifndef TPROXY_CONF
 #ifndef _WIN32
-/* 25 */	(unsigned char *)"/usr/local/etc/3proxy/3proxy.cfg",
+/* 25 */	(unsigned char *)"/etc/3proxy/3proxy.cfg",
 #else
 /* 25 */	(unsigned char *)"3proxy.cfg",
 #endif