util-linux/0205-su-move-long-options-to-main.patch
Karel Zak 7443d56081 2.22.1-3: enable su(1) and runuser(1)
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-11-01 15:09:04 +01:00

61 lines
1.9 KiB
Diff

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