]> git.ipfire.org Git - thirdparty/coreutils.git/commit
(run_shell): Pass a new n_additional_args arg, so that
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Aug 2004 22:23:25 +0000 (22:23 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 3 Aug 2004 22:23:25 +0000 (22:23 +0000)
commitd2940e7cd484f1076752d2c17b80938200d4ffa1
tree101bab9205a6c91d6de501ffe5a2794ffc825c7b
parentcee6afd01e52cf73b6047bb9a1f2132d71a7d829
(run_shell): Pass a new n_additional_args arg, so that
the callee doesn't have to count 'em.  All callers changed.
Don't allocate more space for the arg vector than we'll need.
Use memcpy to copy the args rather than rolling our own loop.
Use size_t for sizes.
(fast_startup, simulate_login, change_environment, log_su,
correct_password, restricted_shell, main): Use bool for booleans.
(longopts): Don't assume change_environment is an int.
Use NULL, not 0, for pointers.
(xsetenv): New function, replacing xputenv and concat.
All callers changed.
(elements): Remove; no longer needed.
(log_su, correct_passwd, main): Prefer !x to x==NULL.
(log_su): 2 -> STDERR_FILENO.
(modify_environment, main): Don't assume that getenv's returned value
has an indefinite lifetime.
(modify_environment): Allocate a larger environ.
(main): Remove an impossible 'case 0'; if it happens now, it'll
get diagnosed.  Don't assume getpwnam results outlive endpwent.
Check for null or empty pw_name, pw_dir and for null pw_passwd.
src/su.c