Skip to contentSkip to conversation

su: Remove the impossible -C option to request the same session.

PATCH In review Colin Guthrie 3 participants 3 messages Nov 18, 2013 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 su: Remove the impossible -C option to request the same session.

It's impossible to pass this argument so it is pointless to keep the code to support it.

---
 login-utils/su-common.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
login-utils/su-common.c +1 -7
index 7fd2792..ca9f24b 100644
@@ -744,7 +744,6 @@ su_main (int argc, char **argv, int mode)
   int optc;
   const char *new_user = DEFAULT_USER, *runuser_user = NULL;
   char *command = NULL;
-  int request_same_session = 0;
   char *shell = NULL;
   struct passwd *pw;
   struct passwd pw_copy;
@@ -786,11 +785,6 @@ su_main (int argc, char **argv, int mode)
 	  command = optarg;
 	  break;
 
-        case 'C':
-          command = optarg;
-          request_same_session = 1;
-          break;
-
 	case 'f':
 	  fast_startup = true;
 	  break;
@@ -924,7 +918,7 @@ su_main (int argc, char **argv, int mode)
 
   authenticate (pw);
 
-  if (request_same_session || !command || !pw->pw_uid)
+  if (!command || !pw->pw_uid)
     same_session = 1;
 
   /* initialize shell variable only if "-u <user>" not specified */
Signature · 1 line
1.8.4.3
maintainer
#1 lore raw
Quoted 2 lines · Colin Guthrie

It's impossible to pass this argument so it is pointless to keep the code to support it.

Really? See struct option longopts[] and --session-command.

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com
#2 lore raw

'Twas brillig, and Karel Zak at 18/11/13 16:42 did gyre and gimble:

Quoted 5 lines · Colin Guthrie
Quoted 2 lines

It's impossible to pass this argument so it is pointless to keep the code to support it.

Really? See struct option longopts[] and --session-command.

Gah, sorry! Could have sworn I'd searched for the 'C' but must have been fat fingers while on a bumpy train.

Sorry 'bout that.

Col

Signature · 10 lines
Colin Guthrie
gmane(at)colin.guthr.ie
http://colin.guthr.ie/

Day Job:
  Tribalogic Limited http://www.tribalogic.net/
Open Source:
  Mageia Contributor http://www.mageia.org/
  PulseAudio Hacker http://www.pulseaudio.org/
  Trac Hacker http://trac.edgewall.org/