util-linux/0205-su-move-long-options-to-main.patch

61 lines
1.9 KiB
Diff
Raw Normal View History

From bea3752e9d048895b6750e2d0d8ce72fed20cef9 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Wed, 5 Sep 2012 11:26:20 +0200
Subject: [PATCH 205/208] su: move long options to main()
Signed-off-by: Karel Zak <kzak@redhat.com>
---
login-utils/su-common.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/login-utils/su-common.c b/login-utils/su-common.c
index 1f97328..778738f 100644
--- a/login-utils/su-common.c
+++ b/login-utils/su-common.c
@@ -115,21 +115,6 @@ static pam_handle_t *pamh = NULL;
static int restricted = 1; /* zero for root user */
-static struct option const longopts[] =
-{
- {"command", required_argument, NULL, 'c'},
- {"session-command", required_argument, NULL, 'C'},
- {"fast", no_argument, NULL, 'f'},
- {"login", no_argument, NULL, 'l'},
- {"preserve-environment", no_argument, NULL, 'p'},
- {"shell", required_argument, NULL, 's'},
- {"group", required_argument, NULL, 'g'},
- {"supp-group", required_argument, NULL, 'G'},
- {"help", no_argument, 0, 'h'},
- {"version", no_argument, 0, 'V'},
- {NULL, 0, NULL, 0}
-};
-
static struct passwd *
current_getpwuid(void)
@@ -656,6 +641,20 @@ su_main (int argc, char **argv, int mode)
int num_supp_groups = 0;
int use_gid = 0;
+ static const struct option longopts[] = {
+ {"command", required_argument, NULL, 'c'},
+ {"session-command", required_argument, NULL, 'C'},
+ {"fast", no_argument, NULL, 'f'},
+ {"login", no_argument, NULL, 'l'},
+ {"preserve-environment", no_argument, NULL, 'p'},
+ {"shell", required_argument, NULL, 's'},
+ {"group", required_argument, NULL, 'g'},
+ {"supp-group", required_argument, NULL, 'G'},
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {NULL, 0, NULL, 0}
+ };
+
setlocale (LC_ALL, "");
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
--
1.7.11.7