Skip to content

Commit c87e900

Browse files
committed
Merge pull request #58 from vapier/master
add configure flags for setting droppriv user/group
2 parents 6acb9fc + e6edd1f commit c87e900

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

configure.ac

+20
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,26 @@ AC_CHECK_HEADERS([unistd.h], ,[AC_MSG_ERROR([Required headers missing; compilati
5757
AC_CHECK_FUNCS([setresuid])
5858
AC_CHECK_FUNCS([gettimeofday])
5959

60+
AC_MSG_CHECKING([user/group to drop privs to])
61+
62+
AC_ARG_WITH([unpriv-user],
63+
[AS_HELP_STRING([--with-unpriv-user=<user>],
64+
[User to drop privs to @<:@default: nobody@:>@])])
65+
AS_CASE([$with_unpriv_user],
66+
[""|yes|no], [UNPRIV_USER="nobody"],
67+
[*], [UNPRIV_USER=$with_unpriv_user])
68+
AC_DEFINE_UNQUOTED([UNPRIV_USER], ["${UNPRIV_USER}"], [Unprivileged user])
69+
70+
AC_ARG_WITH([unpriv-group],
71+
[AS_HELP_STRING([--with-unpriv-group=<group>],
72+
[Group to drop privs to @<:@default: nogroup@:>@])])
73+
AS_CASE([$with_unpriv_group],
74+
[""|yes|no], [UNPRIV_GROUP="nogroup"],
75+
[*], [UNPRIV_GROUP=$with_unpriv_group])
76+
AC_DEFINE_UNQUOTED([UNPRIV_GROUP], ["${UNPRIV_GROUP}"], [Unprivileged group])
77+
78+
AC_MSG_RESULT(${UNPRIV_USER}:${UNPRIV_GROUP})
79+
6080
dnl Check for clock_gettime. Some systems put it into -lc, while
6181
dnl others use -lrt. Try the first and fallback to the latter.
6282
RT_LIB=

src/tlsdate.h

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#include <time.h>
1919
#include <unistd.h>
2020

21-
#define UNPRIV_USER "nobody"
2221
#define DEFAULT_HOST "www.ptb.de"
2322
#define DEFAULT_PORT "443"
2423
#define DEFAULT_PROTOCOL "tlsv1"

0 commit comments

Comments
 (0)