diff -u -r1.61 -r1.62
--- shadow/src/su.c	2006/01/02 22:37:47	1.61
+++ shadow/src/su.c	2006/01/07 19:38:15	1.62
@@ -256,6 +256,7 @@
 	fprintf (stderr, _("Usage: su [options] [login]\n"
 			   "\n"
 			   "Options:\n"
+			   "  -c, --command COMMAND		pass COMMAND to the invoked shell\n"
 			   "  -h, --help			display this help message and exit\n"
 			   "  -, -l, --login		make the shell a login shell\n"
 			   "  -m, -p,\n"
@@ -286,7 +287,7 @@
 	uid_t my_uid;
 	struct passwd *pw = 0;
 	char **envp = environ;
-	char *shellstr = 0;
+	char *shellstr = 0, *command = 0;
 
 #ifdef USE_PAM
 	int ret;
@@ -328,6 +329,7 @@
 		int option_index = 0;
 		int c;
 		static struct option long_options[] = {
+			{"command", required_argument, NULL, 'c'},
 			{"help", no_argument, NULL, 'h'},
 			{"login", no_argument, NULL, 'l'},
 			{"preserve-environment", no_argument, NULL, 'p'},
@@ -336,7 +338,7 @@
 		};
 
 		while ((c =
-			getopt_long (argc, argv, "-hlmps:", long_options,
+			getopt_long (argc, argv, "-c:hlmps:", long_options,
 				     &option_index)) != -1) {
 			switch (c) {
 			case 1:
@@ -349,6 +351,9 @@
 				optind--;
 				goto end_su_options;
 				break;	/* NOT REACHED */
+			case 'c':
+				command = optarg;
+				break;
 			case 'h':
 				usage ();
 				break;
@@ -423,6 +428,8 @@
 		(void) strcpy (name, "root");
 
 	doshell = argc == optind;	/* any arguments remaining? */
+	if (command)
+		doshell = 0;
 
 	/*
 	 * Get the user's real name. The current UID is used to determine
@@ -832,6 +839,11 @@
 	if (!doshell) {
 		/* Position argv to the remaining arguments */
 		argv += optind;
+		if (command) {
+			argv -= 2;
+			argv[0] = "-c";
+			argv[1] = command;
+		}
 		/*
 		 * Use the shell and create an argv
 		 * with the rest of the command line included.
