2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-28 13:08:06 +00:00

150 Commits

Author SHA1 Message Date
Mark Andrews
4bc3de070f Resize unamebuf[] to avoid warnings about snprintf() not having
enough buffer space.  Also change named_os_uname() prototype so
that it is now returning (const char *) rather than (char *).  If
uname() is not supported on a UNIX build prepopulate unamebuf[]
with "unknown architecture".
2020-06-24 23:21:36 +00:00
Ondřej Surý
ee2f3039df Hide setperms when not in use 2020-04-28 17:33:57 +02:00
Ondřej Surý
6c82e2af92 Don't change effective uid when we already dropped privileges
When running on Linux and system capabilities are available, named will
drop the extra capabilities before loading the configuration.  This led
to spurious warnings from `seteuid()` because named already dropped
CAP_SETUID and CAP_GETUID capabilities.

The fix removes setting the effective uid/gid when capabilities are
available, and adds a check that we are running under the user we were
requested to run.
2020-04-28 15:22:41 +02:00
Ondřej Surý
262f087bcf Fix 'Dead nested assignment's from scan-build-10
The 3 warnings reported are:

os.c:872:7: warning: Although the value stored to 'ptr' is used in the enclosing expression, the value is never actually read from 'ptr'
        if ((ptr = strtok_r(command, " \t", &last)) == NULL) {
             ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

--

rpz.c:1117:10: warning: Although the value stored to 'zbits' is used in the enclosing expression, the value is never actually read from 'zbits'
        return (zbits &= x);
                ^        ~
1 warning generated.

--

openssleddsa_link.c:532:10: warning: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
        while ((err = ERR_get_error()) != 0) {
                ^     ~~~~~~~~~~~~~~~
1 warning generated.
2020-03-25 17:33:07 +01:00
Ondřej Surý
3178974f0c Use the new sorting rules to regroup #include headers 2020-03-09 16:19:22 +01:00
Evan Hunt
e851ed0bb5 apply the modified style 2020-02-13 15:05:06 -08:00
Ondřej Surý
056e133c4c Use clang-tidy to add curly braces around one-line statements
The command used to reformat the files in this commit was:

./util/run-clang-tidy \
	-clang-tidy-binary clang-tidy-11
	-clang-apply-replacements-binary clang-apply-replacements-11 \
	-checks=-*,readability-braces-around-statements \
	-j 9 \
	-fix \
	-format \
	-style=file \
	-quiet
clang-format -i --style=format $(git ls-files '*.c' '*.h')
uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h')
clang-format -i --style=format $(git ls-files '*.c' '*.h')
2020-02-13 22:07:21 +01:00
Ondřej Surý
f50b1e0685 Use clang-format to reformat the source files 2020-02-12 15:04:17 +01:00
Ondřej Surý
78d0cb0a7d Use coccinelle to remove explicit '#include <config.h>' from the source files 2019-03-08 15:15:05 +01:00
Evan Hunt
38cf56ac38 call named_os_changeuser() when setting minimal privileges on linux 2018-09-10 20:17:41 -07:00
Ondřej Surý
8ffd9a9b71 Remove PR_SET_DUMPABLE check as it is available since Linux 2.3.20 2018-09-07 12:48:49 +02:00
Ondřej Surý
8e4cc152f7 Remove HAVE_SYS_PRCTL_H check as the prctl() system call was introduced in Linux 2.1.57. 2018-09-07 12:43:43 +02:00
Ondřej Surý
c7b1e7fd08 Linux (glibc) has NPTL since LinuxThreads are no-more, so remove HAVE_LINUXTHREADS 2018-09-07 12:17:40 +02:00
Evan Hunt
1656152d76 Ensure that POSIX strerror_r variant is use even when _GNU_SOURCE is enabled by default 2018-08-29 13:31:28 +02:00
Ondřej Surý
1672935717 Use strerror_r from POSIX.1-2001 (strerror_s on Windows) instead of custom isc__strerror() 2018-08-28 10:31:48 +02:00
Ondřej Surý
c19713aa51 Remove support for legacy SGI IRIX 2018-08-28 10:31:47 +02:00
Ondřej Surý
994e656977 Replace custom isc_boolean_t with C standard bool type 2018-08-08 09:37:30 +02:00
Michał Kępień
c356413294 libcap ships with <sys/capability.h>, so use an #ifdef associated with that header to determine whether to enable capabilities support 2018-06-30 16:50:22 +02:00
Michał Kępień
e299a870b3 Revert parts of 3dd314590e introducing WANT_LINUX_CAPABILITY 2018-06-30 16:50:22 +02:00
Ondřej Surý
c4a436569a Make libcap mandatory when Linux capabilities are enabled 2018-06-30 16:50:22 +02:00
Ondřej Surý
921d05ddcf Replace usage of strsep with POSIX strtok_r() 2018-04-12 10:37:33 +02:00
Ondřej Surý
843d389661 Update license headers to not include years in copyright in all applicable files 2018-02-23 10:12:02 +01:00
Mark Andrews
0ec66f5e51 conditionally declare strbuf 2018-02-16 10:20:39 +11:00
Mark Andrews
23a4f70be0 remove unused variable 2017-10-10 20:02:35 +11:00
Michał Kępień
077f9626c2 [master] Add isc_buffer_printf()
4767.	[func]		Add a new function, isc_buffer_printf(), which can be
			used to append a formatted string to the used region of
			a buffer. [RT #46201]
2017-10-09 11:43:07 +02:00
Evan Hunt
114f95089c [master] cleanup strcat/strcpy
4722.	[cleanup]	Clean up uses of strcpy() and strcat() in favor of
			strlcpy() and strlcat() for safety. [RT #45981]
2017-09-13 00:14:37 -07:00
Evan Hunt
f3ce87e1a1 [master] copyrights 2017-09-11 17:01:09 -07:00
Evan Hunt
8eb88aafee [master] add libns and remove liblwres
4708.   [cleanup]       Legacy Windows builds (i.e. for XP and earlier)
                        are no longer supported. [RT #45186]

4707.	[func]		The lightweight resolver daemon and library (lwresd
			and liblwres) have been removed. [RT #45186]

4706.	[func]		Code implementing name server query processing has
			been moved from bin/named to a new library "libns".
			Functions remaining in bin/named are now prefixed
			with "named_" rather than "ns_".  This will make it
			easier to write unit tests for name server code, or
			link name server functionality into new tools.
			[RT #45186]
2017-09-08 13:47:34 -07:00
Tinderbox User
a00838da96 update copyright notice / whitespace 2017-06-13 23:45:34 +00:00
Evan Hunt
bf05e66bb3 [master] prevent reload failure due to LMDB database perms
4638.	[bug]		Reloading or reconfiguring named could fail on
			some platforms when LMDB was in use. [RT #45203]
2017-06-13 10:15:34 -07:00
Mark Andrews
c9ee977f31 added -T keepstderr to keep stderr open when daemonizing [RT #43736] 2016-12-05 10:38:16 +11:00
Mark Andrews
0c27b3fe77 4401. [misc] Change LICENSE to MPL 2.0. 2016-06-27 14:56:38 +10:00
Evan Hunt
f02c22d58a [master] add uname data to named -V
4308.	[func]		Added operating system details to "named -V"
			output. [RT #41452]
2016-01-30 11:06:58 -08:00
Tinderbox User
811acf52b8 update copyright notice / whitespace 2015-03-04 23:45:21 +00:00
Mark Andrews
d869bc7685 address -Wshaddow of lockfile 2015-03-04 13:49:48 +11:00
Evan Hunt
7ae96d8823 [master] add "lock-file" and fix up singleton code
4080.	[func]		Completed change #4022, adding a "lock-file" option
			to named.conf to override the default lock file,
			in addition to the "named -X <filename>" command
			line option.  Setting the lock file to "none"
			using either method disables the check completely.
			[RT #37908]
2015-03-02 19:27:54 -08:00
Mukund Sivaraman
47d837a499 Make named a singleton process [RT#37908]
Conflicts:
	bin/tests/system/conf.sh.in
	lib/dns/win32/libdns.def.in
	lib/isc/win32/file.c

The merge also needed to update files in legacy and tcp system tests
(newly introduced in master after branch was created) to introduce use
of lockfile.
2014-12-18 12:31:25 +05:30
Evan Hunt
b454c03196 [master] use ANSI prototypes, clean up some casts 2014-03-04 10:42:25 -08:00
Tinderbox User
3fd910dec5 update copyright notice 2014-02-17 23:46:29 +00:00
Mark Andrews
5114325978 3742. [port] linux: libcap support: curval was used before it
was declared. [RT #35387]
2014-02-18 00:27:15 +11:00
Mark Andrews
7433a204d3 3658. [port] linux: Address platform specific compilation issue
when libcap-devel is installed. [RT #34838]
2013-09-26 15:26:43 +10:00
Tinderbox User
dbd8673fa0 update copyright notice 2013-07-11 23:46:13 +00:00
Evan Hunt
c174d5c13c [master] portability fix
3614.	[port]		Check for <linux/types.h>. [RT #34162]
2013-07-10 20:44:58 -07:00
Mark Andrews
88c63fe9c7 3039. [bug] Save and restore the gid when creating creating
named.pid at startup. [RT #23290]
2011-03-02 00:02:54 +00:00
Automatic Updater
b01d422daf update copyright notice 2011-02-21 23:47:45 +00:00
Mark Andrews
a360461b34 check for snprintf failure 2011-02-21 07:14:43 +00:00
Automatic Updater
33cc94f04c update copyright notice 2010-11-17 23:47:09 +00:00
Mark Andrews
cd9d825a71 remove accidental commit 2010-11-16 05:38:31 +00:00
Mark Andrews
f85281de08 check for snprintf failure 2010-11-16 00:47:48 +00:00
Mark Andrews
de3200acf4 silence format warnings: treat uid/gid as longs when printing 2009-08-13 07:04:38 +00:00