lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1358948265-20867-2-git-send-email-jsynacek@redhat.com>
Date:	Wed, 23 Jan 2013 14:37:44 +0100
From:	Jan Synacek <jsynacek@...hat.com>
To:	yoshfuji@...ux-ipv6.org
Cc:	netdev@...r.kernel.org, Jan Synacek <jsynacek@...hat.com>
Subject: [PATCH 1/2] ninfod: Call limit/drop_capabilities() and open_sock() after checking for -h or -v.

Signed-off-by: Jan Synacek <jsynacek@...hat.com>
---
 ninfod/ninfod.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/ninfod/ninfod.c b/ninfod/ninfod.c
index d1b99d9..58b15aa 100644
--- a/ninfod/ninfod.c
+++ b/ninfod/ninfod.c
@@ -637,16 +637,8 @@ int main (int argc, char **argv)
 
 	appname = argv[0];
 
-	limit_capabilities();
-
-	sock = open_sock();
-	if (sock < 0)
-		sock_errno = errno;
-
 	parse_args(argc, argv);
 
-	drop_capabilities();
-
 	if (opt_h || opt_v)
 		print_copying();
 	if (opt_h) {
@@ -654,6 +646,14 @@ int main (int argc, char **argv)
 		exit(1);
 	}
 
+	limit_capabilities();
+
+	sock = open_sock();
+	if (sock < 0)
+		sock_errno = errno;
+
+	drop_capabilities();
+
 	if (sock_errno) {
 		DEBUG(LOG_ERR, "socket: %s\n", strerror(sock_errno));
 		exit(1);
-- 
1.8.1

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ