Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
287a7ae649 | ||
![]() |
315e129f12 | ||
![]() |
7cb30dd9ee | ||
![]() |
9927d411bf | ||
![]() |
0f28221ec5 | ||
![]() |
57d90c8bf7 | ||
![]() |
8de8634b8b | ||
![]() |
ce149cc7a6 | ||
![]() |
410eaf107c | ||
![]() |
e6cbaf7b6e | ||
![]() |
2d0192b8a8 | ||
![]() |
643d52ac5a | ||
![]() |
b92792fd8d | ||
![]() |
965664798c | ||
![]() |
6d5709de38 | ||
![]() |
107f9117d0 | ||
![]() |
1b3dd058d1 | ||
![]() |
333d722d56 | ||
![]() |
6f0abb7339 | ||
![]() |
a19f758743 | ||
![]() |
f63730c77e | ||
![]() |
ed3ada7c26 | ||
![]() |
b9e6d9742d | ||
![]() |
fbc434e26d | ||
![]() |
cc74869e71 | ||
![]() |
577ac16cf1 | ||
![]() |
810b9ae49a |
@ -17,5 +17,11 @@ EXTRA_DIST = \
|
|||||||
test: all
|
test: all
|
||||||
./tests/scripts/run_tests.sh
|
./tests/scripts/run_tests.sh
|
||||||
|
|
||||||
|
test-wait:
|
||||||
|
TINYPROXY_TESTS_WAIT=yes $(MAKE) test
|
||||||
|
|
||||||
valgrind-test: all
|
valgrind-test: all
|
||||||
./tests/scripts/run_tests_valgrind.sh
|
./tests/scripts/run_tests_valgrind.sh
|
||||||
|
|
||||||
|
valgrind-test-wait:
|
||||||
|
TINYPROXY_TESTS_WAIT=yes $(MAKE) valgrind-test
|
||||||
|
27
NEWS
27
NEWS
@ -1,6 +1,31 @@
|
|||||||
Tinyproxy NEWS
|
Tinyproxy NEWS
|
||||||
==============
|
==============
|
||||||
|
|
||||||
|
Version 1.8.1
|
||||||
|
-------------
|
||||||
|
|
||||||
|
* Tinyproxy now drops `root` user privileges more quickly.
|
||||||
|
* The log and pid files are now stored in a sub-directory in `/var/`.
|
||||||
|
* A format string vulnerability was fixed.
|
||||||
|
* Minor formatting changes and typo fixes were made.
|
||||||
|
|
||||||
|
Bugs fixed since version 1.8.0
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* BB#74: tinyproxy unable to reopen log files after receiving HUP
|
||||||
|
* BB#79: Make the testsuite uninteractive
|
||||||
|
* BB#80: Handle errors in testsuite
|
||||||
|
* BB#81: Listen directive doesn't work as expected
|
||||||
|
* BB#72: upstream support is not reported with tinyproxy -h
|
||||||
|
* BB#73: generated tinyproxy.conf has the wrong location for the html
|
||||||
|
file installation
|
||||||
|
|
||||||
|
Contributors
|
||||||
|
~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Michael Adam, Mukund Sivaraman.
|
||||||
|
|
||||||
|
|
||||||
Version 1.8.0
|
Version 1.8.0
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
@ -39,6 +64,7 @@ Contributors
|
|||||||
|
|
||||||
David Shanks, Mathew Mrosko, Michael Adam, Mukund Sivaraman.
|
David Shanks, Mathew Mrosko, Michael Adam, Mukund Sivaraman.
|
||||||
|
|
||||||
|
|
||||||
Version 1.7.1
|
Version 1.7.1
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
@ -64,6 +90,7 @@ Contributors
|
|||||||
Andrew Stribblehill, Jeremy Hinegardner, Matthew Dempsky, Michael Adam,
|
Andrew Stribblehill, Jeremy Hinegardner, Matthew Dempsky, Michael Adam,
|
||||||
Mukund Sivaraman, Robert James Kaes.
|
Mukund Sivaraman, Robert James Kaes.
|
||||||
|
|
||||||
|
|
||||||
Version 1.7.0
|
Version 1.7.0
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
6
TODO
6
TODO
@ -42,12 +42,6 @@ against the current tree and I'll integrate it if possible.
|
|||||||
|
|
||||||
==> https://www.banu.com/bugzilla/show_bug.cgi?id=13
|
==> https://www.banu.com/bugzilla/show_bug.cgi?id=13
|
||||||
|
|
||||||
* Fix paths inside etc/tinyproxy.conf
|
|
||||||
|
|
||||||
* Finish manpages
|
|
||||||
|
|
||||||
* Move defaults handling to conf.c
|
|
||||||
|
|
||||||
* Remove common.h and fix order of headers
|
* Remove common.h and fix order of headers
|
||||||
|
|
||||||
* Remove memory debugging functions (Valgrind is good enough)
|
* Remove memory debugging functions (Valgrind is good enough)
|
||||||
|
@ -5,7 +5,7 @@ AC_PREREQ(2.54)
|
|||||||
|
|
||||||
m4_define([tinyproxy_major_version], [1])
|
m4_define([tinyproxy_major_version], [1])
|
||||||
m4_define([tinyproxy_minor_version], [8])
|
m4_define([tinyproxy_minor_version], [8])
|
||||||
m4_define([tinyproxy_micro_version], [0])
|
m4_define([tinyproxy_micro_version], [1])
|
||||||
m4_define([tinyproxy_real_version],
|
m4_define([tinyproxy_real_version],
|
||||||
[tinyproxy_major_version.tinyproxy_minor_version.tinyproxy_micro_version])
|
[tinyproxy_major_version.tinyproxy_minor_version.tinyproxy_micro_version])
|
||||||
m4_define([tinyproxy_version], [tinyproxy_real_version])
|
m4_define([tinyproxy_version], [tinyproxy_real_version])
|
||||||
|
@ -210,9 +210,9 @@ The possible keywords and their descriptions are as follows:
|
|||||||
which clients are allowed to access Tinyproxy. `Allow` and `Deny`
|
which clients are allowed to access Tinyproxy. `Allow` and `Deny`
|
||||||
lines can be specified multiple times to build the access control
|
lines can be specified multiple times to build the access control
|
||||||
list for Tinyproxy. The order in the config file is important.
|
list for Tinyproxy. The order in the config file is important.
|
||||||
If there are no `Access` or `Deny` lines, then all clients are
|
If there are no `Allow` or `Deny` lines, then all clients are
|
||||||
allowed. Otherwise, the default action is to deny access.
|
allowed. Otherwise, the default action is to deny access.
|
||||||
The argument to `Access` or `Deny` can be a single IP address
|
The argument to `Allow` or `Deny` can be a single IP address
|
||||||
of a client host, like `127.0.0.1`, an IP address range, like
|
of a client host, like `127.0.0.1`, an IP address range, like
|
||||||
`192.168.0.1/24` or a string that will be matched against the
|
`192.168.0.1/24` or a string that will be matched against the
|
||||||
end of the client host name, i.e, this can be a full host name
|
end of the client host name, i.e, this can be a full host name
|
||||||
|
@ -130,7 +130,7 @@ configuration variable `StatFile`.
|
|||||||
FILES
|
FILES
|
||||||
-----
|
-----
|
||||||
|
|
||||||
`/etc/tinyproxy/tinyproxy.conf`, `/var/run/tinyproxy.pid`, `/var/log/tinyproxy.log`
|
`/etc/tinyproxy/tinyproxy.conf`, `/var/run/tinyproxy/tinyproxy.pid`, `/var/log/tinyproxy/tinyproxy.log`
|
||||||
|
|
||||||
BUGS
|
BUGS
|
||||||
----
|
----
|
||||||
|
@ -56,18 +56,18 @@ Timeout 600
|
|||||||
# /usr/share/tinyproxy
|
# /usr/share/tinyproxy
|
||||||
# /etc/tinyproxy
|
# /etc/tinyproxy
|
||||||
#
|
#
|
||||||
#ErrorFile 404 "@datadir@/404.html"
|
#ErrorFile 404 "@pkgdatadir@/404.html"
|
||||||
#ErrorFile 400 "@datadir@/400.html"
|
#ErrorFile 400 "@pkgdatadir@/400.html"
|
||||||
#ErrorFile 503 "@datadir@/503.html"
|
#ErrorFile 503 "@pkgdatadir@/503.html"
|
||||||
#ErrorFile 403 "@datadir@/403.html"
|
#ErrorFile 403 "@pkgdatadir@/403.html"
|
||||||
#ErrorFile 408 "@datadir@/408.html"
|
#ErrorFile 408 "@pkgdatadir@/408.html"
|
||||||
|
|
||||||
#
|
#
|
||||||
# DefaultErrorFile: The HTML file that gets sent if there is no
|
# DefaultErrorFile: The HTML file that gets sent if there is no
|
||||||
# HTML file defined with an ErrorFile keyword for the HTTP error
|
# HTML file defined with an ErrorFile keyword for the HTTP error
|
||||||
# that has occured.
|
# that has occured.
|
||||||
#
|
#
|
||||||
DefaultErrorFile "@datadir@/default.html"
|
DefaultErrorFile "@pkgdatadir@/default.html"
|
||||||
|
|
||||||
#
|
#
|
||||||
# StatHost: This configures the host name or IP address that is treated
|
# StatHost: This configures the host name or IP address that is treated
|
||||||
@ -84,15 +84,15 @@ DefaultErrorFile "@datadir@/default.html"
|
|||||||
# for the stathost. If this file doesn't exist a basic page is
|
# for the stathost. If this file doesn't exist a basic page is
|
||||||
# hardcoded in tinyproxy.
|
# hardcoded in tinyproxy.
|
||||||
#
|
#
|
||||||
StatFile "@datadir@/stats.html"
|
StatFile "@pkgdatadir@/stats.html"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Logfile: Allows you to specify the location where information should
|
# LogFile: Allows you to specify the location where information should
|
||||||
# be logged to. If you would prefer to log to syslog, then disable this
|
# be logged to. If you would prefer to log to syslog, then disable this
|
||||||
# and enable the Syslog directive. These directives are mutually
|
# and enable the Syslog directive. These directives are mutually
|
||||||
# exclusive.
|
# exclusive.
|
||||||
#
|
#
|
||||||
Logfile "@localstatedir@/log/tinyproxy.log"
|
#LogFile "@localstatedir@/log/tinyproxy/tinyproxy.log"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Syslog: Tell tinyproxy to use syslog instead of a logfile. This
|
# Syslog: Tell tinyproxy to use syslog instead of a logfile. This
|
||||||
@ -122,7 +122,7 @@ LogLevel Info
|
|||||||
# PidFile: Write the PID of the main tinyproxy thread to this file so it
|
# PidFile: Write the PID of the main tinyproxy thread to this file so it
|
||||||
# can be used for signalling purposes.
|
# can be used for signalling purposes.
|
||||||
#
|
#
|
||||||
PidFile "@localstatedir@/run/tinyproxy.pid"
|
#PidFile "@localstatedir@/run/tinyproxy/tinyproxy.pid"
|
||||||
|
|
||||||
#
|
#
|
||||||
# XTinyproxy: Tell Tinyproxy to include the X-Tinyproxy header, which
|
# XTinyproxy: Tell Tinyproxy to include the X-Tinyproxy header, which
|
||||||
|
@ -230,7 +230,7 @@ void send_stored_logs (void)
|
|||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
log_message (level, ptr);
|
log_message (level, "%s", ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
vector_delete (log_message_storage);
|
vector_delete (log_message_storage);
|
||||||
|
35
src/main.c
35
src/main.c
@ -162,6 +162,11 @@ display_usage (void)
|
|||||||
features++;
|
features++;
|
||||||
#endif /* REVERSE_SUPPORT */
|
#endif /* REVERSE_SUPPORT */
|
||||||
|
|
||||||
|
#ifdef UPSTREAM_SUPPORT
|
||||||
|
printf (" Upstream proxy support\n");
|
||||||
|
features++;
|
||||||
|
#endif /* UPSTREAM_SUPPORT */
|
||||||
|
|
||||||
if (0 == features)
|
if (0 == features)
|
||||||
printf (" None\n");
|
printf (" None\n");
|
||||||
|
|
||||||
@ -321,8 +326,8 @@ static void initialize_config_defaults (struct config_s *conf)
|
|||||||
conf->errorpages = NULL;
|
conf->errorpages = NULL;
|
||||||
conf->stathost = safestrdup (TINYPROXY_STATHOST);
|
conf->stathost = safestrdup (TINYPROXY_STATHOST);
|
||||||
conf->idletimeout = MAX_IDLE_TIME;
|
conf->idletimeout = MAX_IDLE_TIME;
|
||||||
conf->logf_name = safestrdup (LOCALSTATEDIR "/log/tinyproxy.log");
|
conf->logf_name = safestrdup (LOCALSTATEDIR "/log/tinyproxy/tinyproxy.log");
|
||||||
conf->pidpath = safestrdup (LOCALSTATEDIR "/run/tinyproxy.pid");
|
conf->pidpath = safestrdup (LOCALSTATEDIR "/run/tinyproxy/tinyproxy.pid");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -357,12 +362,27 @@ main (int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
umask (0177);
|
umask (0177);
|
||||||
|
|
||||||
|
log_message (LOG_INFO, "Initializing " PACKAGE " ...");
|
||||||
|
|
||||||
initialize_config_defaults (&config_defaults);
|
initialize_config_defaults (&config_defaults);
|
||||||
process_cmdline (argc, argv, &config_defaults);
|
process_cmdline (argc, argv, &config_defaults);
|
||||||
|
|
||||||
log_message (LOG_INFO, "Initializing " PACKAGE " ...");
|
ret = reload_config_file (config_defaults.config_file,
|
||||||
|
&config,
|
||||||
|
&config_defaults);
|
||||||
|
if (ret != 0) {
|
||||||
|
exit (EX_SOFTWARE);
|
||||||
|
}
|
||||||
|
|
||||||
ret = reload_config ();
|
/* Switch to a different user if we're running as root */
|
||||||
|
if (geteuid () == 0) {
|
||||||
|
change_user (argv[0]);
|
||||||
|
} else {
|
||||||
|
log_message (LOG_WARNING,
|
||||||
|
"Not running as root, so not changing UID/GID.");
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = setup_logging ();
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
exit (EX_SOFTWARE);
|
exit (EX_SOFTWARE);
|
||||||
}
|
}
|
||||||
@ -407,13 +427,6 @@ main (int argc, char **argv)
|
|||||||
exit (EX_OSERR);
|
exit (EX_OSERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Switch to a different user if we're running as root */
|
|
||||||
if (geteuid () == 0)
|
|
||||||
change_user (argv[0]);
|
|
||||||
else
|
|
||||||
log_message (LOG_WARNING,
|
|
||||||
"Not running as root, so not changing UID/GID.");
|
|
||||||
|
|
||||||
if (child_pool_create () < 0) {
|
if (child_pool_create () < 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
"%s: Could not create the pool of children.\n",
|
"%s: Could not create the pool of children.\n",
|
||||||
|
@ -181,6 +181,7 @@ int listen_sock (uint16_t port, socklen_t * addrlen)
|
|||||||
memset (&hints, 0, sizeof (struct addrinfo));
|
memset (&hints, 0, sizeof (struct addrinfo));
|
||||||
hints.ai_family = AF_UNSPEC;
|
hints.ai_family = AF_UNSPEC;
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
hints.ai_socktype = SOCK_STREAM;
|
||||||
|
hints.ai_flags = AI_PASSIVE;
|
||||||
|
|
||||||
snprintf (portstr, sizeof (portstr), "%d", port);
|
snprintf (portstr, sizeof (portstr), "%d", port);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ TINYPROXY_PORT=12321
|
|||||||
TINYPROXY_USER=$USER
|
TINYPROXY_USER=$USER
|
||||||
TINYPROXY_PID_DIR=$TESTENV_DIR/var/run/tinyproxy
|
TINYPROXY_PID_DIR=$TESTENV_DIR/var/run/tinyproxy
|
||||||
TINYPROXY_PID_FILE=$TINYPROXY_PID_DIR/tinyproxy.pid
|
TINYPROXY_PID_FILE=$TINYPROXY_PID_DIR/tinyproxy.pid
|
||||||
TINYPROXY_LOG_DIR=$LOG_DIR
|
TINYPROXY_LOG_DIR=$LOG_DIR/tinyproxy
|
||||||
TINYPROXY_DATA_DIR=$TESTENV_DIR/usr/share/tinyproxy
|
TINYPROXY_DATA_DIR=$TESTENV_DIR/usr/share/tinyproxy
|
||||||
TINYPROXY_CONF_DIR=$TESTENV_DIR/etc/tinyproxy
|
TINYPROXY_CONF_DIR=$TESTENV_DIR/etc/tinyproxy
|
||||||
TINYPROXY_CONF_FILE=$TINYPROXY_CONF_DIR/tinyproxy.conf
|
TINYPROXY_CONF_FILE=$TINYPROXY_CONF_DIR/tinyproxy.conf
|
||||||
@ -159,12 +159,13 @@ run_basic_webclient_request() {
|
|||||||
if test "x$WEBCLIENT_EXIT_CODE" = "x0" ; then
|
if test "x$WEBCLIENT_EXIT_CODE" = "x0" ; then
|
||||||
echo " ok"
|
echo " ok"
|
||||||
else
|
else
|
||||||
echo "ERROR ($EBCLIENT_EXIT_CODE)"
|
echo "ERROR ($WEBCLIENT_EXIT_CODE)"
|
||||||
echo "webclient output:"
|
echo "webclient output:"
|
||||||
cat $WEBCLIENT_LOG
|
cat $WEBCLIENT_LOG
|
||||||
fi
|
fi
|
||||||
}
|
|
||||||
|
|
||||||
|
return $WEBCLIENT_EXIT_CODE
|
||||||
|
}
|
||||||
|
|
||||||
# "main"
|
# "main"
|
||||||
|
|
||||||
@ -177,22 +178,31 @@ start_tinyproxy
|
|||||||
|
|
||||||
wait_for_some_seconds 3
|
wait_for_some_seconds 3
|
||||||
|
|
||||||
|
FAILED=0
|
||||||
|
|
||||||
echo -n "checking direct connection to web server..."
|
echo -n "checking direct connection to web server..."
|
||||||
run_basic_webclient_request "$WEBSERVER_IP:$WEBSERVER_PORT" /
|
run_basic_webclient_request "$WEBSERVER_IP:$WEBSERVER_PORT" /
|
||||||
|
test "x$?" = "x0" || FAILED=$((FAILED + 1))
|
||||||
|
|
||||||
echo -n "testing connection through tinyproxy..."
|
echo -n "testing connection through tinyproxy..."
|
||||||
run_basic_webclient_request "$TINYPROXY_IP:$TINYPROXY_PORT" "http://$WEBSERVER_IP:$WEBSERVER_PORT/"
|
run_basic_webclient_request "$TINYPROXY_IP:$TINYPROXY_PORT" "http://$WEBSERVER_IP:$WEBSERVER_PORT/"
|
||||||
|
test "x$?" = "x0" || FAILED=$((FAILED + 1))
|
||||||
|
|
||||||
echo -n "requesting statspage via stathost url..."
|
echo -n "requesting statspage via stathost url..."
|
||||||
run_basic_webclient_request "$TINYPROXY_IP:$TINYPROXY_PORT" "http://$TINYPROXY_STATHOST_IP"
|
run_basic_webclient_request "$TINYPROXY_IP:$TINYPROXY_PORT" "http://$TINYPROXY_STATHOST_IP"
|
||||||
|
test "x$?" = "x0" || FAILED=$((FAILED + 1))
|
||||||
|
|
||||||
echo "You can continue using the webserver and tinyproxy."
|
echo "$FAILED errors"
|
||||||
echo -n "hit <enter> to stop the servers and exit: "
|
|
||||||
read READ
|
if test "x$TINYPROXY_TESTS_WAIT" = "xyes"; then
|
||||||
|
echo "You can continue using the webserver and tinyproxy."
|
||||||
|
echo -n "hit <enter> to stop the servers and exit: "
|
||||||
|
read READ
|
||||||
|
fi
|
||||||
|
|
||||||
stop_tinyproxy
|
stop_tinyproxy
|
||||||
stop_webserver
|
stop_webserver
|
||||||
|
|
||||||
echo "done"
|
echo "done"
|
||||||
|
|
||||||
exit 0
|
exit $FAILED
|
||||||
|
Loading…
Reference in New Issue
Block a user