su's arguments are now reordered. If needed, use -- to separate su's
options from the shell's options.
This commit is contained in:
parent
65d0682647
commit
e663c696c2
@ -1,3 +1,8 @@
|
|||||||
|
2007-12-26 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
Merge Debian's patch 480_getopt_args_reorder
|
||||||
|
* NEWS, src/su.c: su's arguments are now reordered.
|
||||||
|
|
||||||
2007-12-26 Nicolas François <nicolas.francois@centraliens.net>
|
2007-12-26 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
Merge RedHat's patch shadow-4.0.18.1-mtime.patch:
|
Merge RedHat's patch shadow-4.0.18.1-mtime.patch:
|
||||||
|
3
NEWS
3
NEWS
@ -10,6 +10,9 @@ shadow-4.1.0 -> shadow-4.1.1 UNRELEASED
|
|||||||
- usermod
|
- usermod
|
||||||
* Keep the access and modification time of files when moving an user's home
|
* Keep the access and modification time of files when moving an user's home
|
||||||
directory.
|
directory.
|
||||||
|
- su
|
||||||
|
* su's arguments are now reordered. If needed, use -- to separate su's
|
||||||
|
options from the shell's options.
|
||||||
|
|
||||||
shadow-4.0.18.2 -> shadow-4.1.0 09-12-2008
|
shadow-4.0.18.2 -> shadow-4.1.0 09-12-2008
|
||||||
|
|
||||||
|
14
src/su.c
14
src/su.c
@ -362,19 +362,9 @@ int main (int argc, char **argv)
|
|||||||
};
|
};
|
||||||
|
|
||||||
while ((c =
|
while ((c =
|
||||||
getopt_long (argc, argv, "-c:hlmps:", long_options,
|
getopt_long (argc, argv, "c:hlmps:", long_options,
|
||||||
&option_index)) != -1) {
|
&option_index)) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case 1:
|
|
||||||
/* this is not an su option */
|
|
||||||
/* The next arguments are either '-', the
|
|
||||||
* target name, or arguments to be passed
|
|
||||||
* to the shell.
|
|
||||||
*/
|
|
||||||
/* rewind the (not yet handled) option */
|
|
||||||
optind--;
|
|
||||||
goto end_su_options;
|
|
||||||
break; /* NOT REACHED */
|
|
||||||
case 'c':
|
case 'c':
|
||||||
command = optarg;
|
command = optarg;
|
||||||
break;
|
break;
|
||||||
@ -399,7 +389,7 @@ int main (int argc, char **argv)
|
|||||||
usage (); /* NOT REACHED */
|
usage (); /* NOT REACHED */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
end_su_options:
|
|
||||||
if (optind < argc && !strcmp (argv[optind], "-")) {
|
if (optind < argc && !strcmp (argv[optind], "-")) {
|
||||||
fakelogin = 1;
|
fakelogin = 1;
|
||||||
optind++;
|
optind++;
|
||||||
|
Loading…
Reference in New Issue
Block a user