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