diff mbox

[1/2] ninfod: Call limit/drop_capabilities() and open_sock() after checking for -h or -v.

Message ID 1358948265-20867-2-git-send-email-jsynacek@redhat.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Jan Synacek Jan. 23, 2013, 1:37 p.m. UTC
Signed-off-by: Jan Synacek <jsynacek@redhat.com>
---
 ninfod/ninfod.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
diff mbox

Patch

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);