forked from pool/dictd
ce4f914a25
- Update to 1.13.0: - dictd: * add support for IPv6 (the default is IPv4) - Add global configuration option "address_family" and command line options --address-family - Options "listen_to" and --listen-to accepts host name in addition to IP address, "*" means "bind to all interfaces". - dict: * add support for IPv6. - New command line options -4 and -6. - dict + dict:// URL: add support for IPv6 address surrounded by [ and ] symbols - dictfmt: * fix overlap of source and destination buffers in memcpy(3). Use memmove(3) instead. This fixes failures on Linux/musl. * DICTFMT_SORT environment variable may be used for setting non-default sort(1) - Fix build on recent Solaris/IllumOS (missing -lnsl at link time) - Remove support for --use-dictorg and socks5. Clean-ups for build system. - Remove support for non-utf8 dictionaries. - tests: * new test for dictd as a daemon * always use @AWK@ * test/dictzip_test.in: avoid printing binary \0. This fixes test on some systems OBS-URL: https://build.opensuse.org/request/show/789765 OBS-URL: https://build.opensuse.org/package/show/Education/dictd?expand=0&rev=21
86 lines
2.1 KiB
Diff
86 lines
2.1 KiB
Diff
--- a/dictd.c
|
|
+++ b/dictd.c
|
|
@@ -332,6 +332,7 @@ static void xsigprocmask (int how, const
|
|
}
|
|
}
|
|
|
|
+/*
|
|
static void block_signals (void)
|
|
{
|
|
sigset_t set;
|
|
@@ -353,6 +354,7 @@ static void unblock_signals (void)
|
|
|
|
xsigprocmask (SIG_UNBLOCK, &set, NULL);
|
|
}
|
|
+*/
|
|
|
|
static void handler( int sig )
|
|
{
|
|
@@ -1266,21 +1268,22 @@ static void release_root_privileges( voi
|
|
* -- Bob Hilliard
|
|
*/
|
|
{
|
|
+ int unused __attribute__((unused));
|
|
if (geteuid() == 0) {
|
|
struct passwd *pwd;
|
|
|
|
if ((pwd = getpwnam("dictd"))) {
|
|
- setgid(pwd->pw_gid);
|
|
+ unused = setgid(pwd->pw_gid);
|
|
initgroups("dictd",pwd->pw_gid);
|
|
- setuid(pwd->pw_uid);
|
|
+ unused = setuid(pwd->pw_uid);
|
|
} else if ((pwd = getpwnam("nobody"))) {
|
|
- setgid(pwd->pw_gid);
|
|
+ unused = setgid(pwd->pw_gid);
|
|
initgroups("nobody",pwd->pw_gid);
|
|
- setuid(pwd->pw_uid);
|
|
+ unused = setuid(pwd->pw_uid);
|
|
} else {
|
|
- setgid(GID_NOGROUP);
|
|
+ unused = setgid(GID_NOGROUP);
|
|
initgroups("nobody", GID_NOGROUP);
|
|
- setuid(UID_NOBODY);
|
|
+ unused = setuid(UID_NOBODY);
|
|
}
|
|
}
|
|
}
|
|
@@ -1464,6 +1467,7 @@ static void pid_file_write ()
|
|
static void reopen_012 (void)
|
|
{
|
|
int fd = open ("/dev/null", O_RDWR);
|
|
+ int unused __attribute__((unused));
|
|
if (fd == -1)
|
|
err_fatal_errno (__func__, ":E: can't open /dev/null");
|
|
|
|
@@ -1471,9 +1475,9 @@ static void reopen_012 (void)
|
|
close (1);
|
|
close (2);
|
|
|
|
- dup (fd);
|
|
- dup (fd);
|
|
- dup (fd);
|
|
+ unused = dup (fd);
|
|
+ unused = dup (fd);
|
|
+ unused = dup (fd);
|
|
}
|
|
|
|
int main (int argc, char **argv, char **envp)
|
|
@@ -1489,6 +1493,7 @@ int main (int argc, char **argv, char **
|
|
int i;
|
|
|
|
int errno_accept = 0;
|
|
+ int unused __attribute__((unused));
|
|
|
|
const char * default_strategy_arg = "???";
|
|
|
|
@@ -1707,7 +1712,7 @@ int main (int argc, char **argv, char **
|
|
|
|
if (detach){
|
|
/* become a daemon */
|
|
- daemon (0, 1);
|
|
+ unused = daemon (0, 1);
|
|
reopen_012 ();
|
|
|
|
/* after fork from daemon(3) */
|