Commit Graph

564 Commits

Author SHA1 Message Date
Todd C. Miller
b124635b04 Instead of keeping separate groups and gids arrays, create struct
group_info and use it to store both, along with a count for each.
Cache group info on a per-user basis using getgrouplist() to get
the groups.  We no longer need special to special case the user or
list user for user_in_group() and thus no longer need to reset the
groups list when listing another user.
2011-07-20 11:58:45 -04:00
Todd C. Miller
6d8788a6cd Do not shadow global sudo_mode with a local variable in set_cmnd() 2011-07-18 16:23:38 -04:00
Todd C. Miller
54bf162e60 bash 2.x doesd not support the -l flag and exits with an error if
it is specified so use --login instead.  This causes an error with
bash 1.x (which uses -login instead) but this version is hopefully
less used than 2.x.
2011-07-17 10:37:15 -04:00
Todd C. Miller
37873051a8 Make error strings translatable. 2011-07-13 16:50:25 -04:00
Todd C. Miller
d7c0798865 Add missing logwrap.c 2011-07-11 15:57:13 -04:00
Todd C. Miller
f90731596a Split out log file word wrap code into its own file and add unit
tests.  Fixes an off-by one in the word wrap when the log line
length matches loglinelen.
2011-07-11 15:22:25 -04:00
Todd C. Miller
56321ec778 Resolve the list of gids passed in from the sudo frontend (the
result of getgroups()) to names and store both the group names and
ids in the sudo_user struct.  When matching groups in the sudoers
file, match based on the names in the groups list first and
only do a gid-based match when we absolutely have to.  By matching
on the group name (as it is listed in sudoers) instead of id
(which we would have to resolve) we save a lot of group lookups
for sudoers files with a lot of groups in them.
2011-07-01 14:13:47 -04:00
Todd C. Miller
20972da410 Workaround for "sudo -i command" and newer versions of bash which
don't go into login mode when -c is specified unless -l is too.
2011-06-26 18:02:09 -04:00
Todd C. Miller
9ba98ef7b5 Rewrite logfile word wrapping code to be more straight-forward
and actually wrap at the correct place.
2011-06-23 14:17:38 -04:00
Todd C. Miller
39be82e32f Set use_pty=true in command details when use_pty is set in sudoers.
From Ludwig Nussel
2011-06-22 10:06:35 -04:00
Todd C. Miller
2bd874febc Sync Chinese (simplified) PO files from translationproject.org 2011-06-20 08:30:10 -04:00
Todd C. Miller
26ec20f8b1 Add Danish translation from translationproject.org and add missing
Basque mo files.
2011-06-18 13:21:48 -04:00
Todd C. Miller
7a06f32cbb Preserve SHELL variable for "sudo -s". Otherwise we can end up
with a situation where the SHELL variable and the actual shell being
run do not match.
2011-06-13 07:20:28 -04:00
Todd C. Miller
2c4a5e905c Do not declare yyparse() static as the actual function generated
by yacc is extern.
2011-06-07 11:45:06 -04:00
Todd C. Miller
e95c7130d7 Add Basque translation and sync Finish and Ukranian translations. 2011-06-06 13:38:54 -04:00
Todd C. Miller
4f22a39803 Load plugins with RTLD_GLOBAL instead of RTLD_LOCAL. This fixes
problems with pam modules not having access to symbols provided by
libpam on some platforms.  Affects FreeBSD and SLES 10 at least.
2011-06-06 10:53:58 -04:00
Todd C. Miller
750c0d2ebe Regenerate .pot files for 1.8.2rc2 2011-06-04 18:27:59 -04:00
Todd C. Miller
e66169b3ed Move nls targets to the top level Makefile so the paths in
the pot file are saner
2011-06-04 18:27:13 -04:00
Todd C. Miller
5fdfefb9dc Update MANIFEST with .po and .mo files
Rebuild sudoers fi and uk .mo files
2011-06-04 10:11:10 -04:00
Todd C. Miller
707bad44d4 Add Finish translation from translationproject.org 2011-06-04 09:58:44 -04:00
Todd C. Miller
7199afec89 Clean up regress files
Generate proper dependencies for regress objs in compat
2011-05-31 09:58:41 -04:00
Todd C. Miller
43fef79b05 Add missing dependency for check_fill.o. 2011-05-31 09:43:37 -04:00
Todd C. Miller
d5e1cbbfaa Include gettext.h 2011-05-28 15:32:11 -04:00
Todd C. Miller
ab3b3eb83b Quiet gcc warnings. 2011-05-28 15:27:14 -04:00
Todd C. Miller
8513c48185 Add missing space between command name and the first command line argument. 2011-05-27 14:07:23 -04:00
Todd C. Miller
3e2f4037cc Quiet a compiler warning on some platforms. 2011-05-27 13:50:37 -04:00
Todd C. Miller
9b7cd235e7 README file that directs people to translationproject.org 2011-05-27 13:15:27 -04:00
Todd C. Miller
6fccd6bfda Sync translations with TP 2011-05-27 12:53:05 -04:00
Todd C. Miller
4ab4114c48 install nls files from install target 2011-05-27 10:24:55 -04:00
Todd C. Miller
38db44b80c Include .mo files in sudo binary packags. 2011-05-27 10:17:34 -04:00
Todd C. Miller
47adbf8d33 Add simplified chinese translation 2011-05-27 07:54:52 -04:00
Todd C. Miller
c202c4e6d8 Add ukranian translation 2011-05-26 15:23:55 -04:00
Todd C. Miller
67e8e56534 Set def_preserve_groups before searching for the command when the -P
flag is specified.
2011-05-26 12:52:59 -04:00
Todd C. Miller
f7cb73abdb Add dependency for siglist.lo in compat. This is a generated file so
"make depend" needs to depend on it.
2011-05-26 12:12:43 -04:00
Todd C. Miller
6c13614a51 Place compiled mo files in the src dir, not the build dir.
When installing compiled mo files, display a status message.
2011-05-26 11:12:54 -04:00
Todd C. Miller
086cbfe376 Tivoli Directory Server requires that seconds be present in a
timestamp, even though RFC 4517 states that they are optional.
2011-05-25 15:04:34 -04:00
Todd C. Miller
b463d026b7 Add missing bit of copyright 2011-05-25 14:15:37 -04:00
Todd C. Miller
5b7e231dd3 When checking aliases, also check the contents of the alias in case there
are problems with an alias that is referenced inside another.
Replace the self reference check with real alias cycle detection.
2011-05-25 13:04:13 -04:00
Todd C. Miller
2b98492871 Set errno to ELOOP in alias_find() if there is a cycle.
Set errno to ENOENT in alias_find() and alias_remove() if the
entry could not be found.
2011-05-25 12:54:15 -04:00
Todd C. Miller
682333ae2d Increment alias_seqno before calls to alias_remove_recursive() to
avoid false positives with the alias loop detection.  Fixes spurious
warnings about unused aliases when they are nested.
2011-05-25 11:31:11 -04:00
Todd C. Miller
c8dda2b856 Add dependency on convenience libs to binaries 2011-05-25 10:19:29 -04:00
Todd C. Miller
78e235945f Auto-generate Makefile dependencies with a perl script. 2011-05-25 09:02:25 -04:00
Todd C. Miller
d9e807b269 If the user specifies a runas group via sudo's -g option that matches
the runas user's group in the passwd database and that group is not
denied in the Runas_Spec, allow it.  Thus, if user root's gid in
/etc/passwd is 0, then "sudo -u root -g root id" is allow even if
no groups are present in the Runas_Spec.
2011-05-23 14:00:54 -04:00
Todd C. Miller
3833efaf04 Add dependencies on gettext.h 2011-05-22 13:31:48 -04:00
Todd C. Miller
9b3653fca0 Fix install-nls target with HP-UX sh when gettext is not present. 2011-05-22 10:10:43 -04:00
Todd C. Miller
f8df14034a regenerate .pot files for lbuf changes 2011-05-20 15:33:34 -04:00
Todd C. Miller
bd36d4f2ab Add primitive format string support to the lbuf code to make translations
simpler.
2011-05-20 15:25:03 -04:00
Todd C. Miller
681547c5fa Add message catalog template files for sudo and the sudoers module. 2011-05-20 13:20:14 -04:00
Todd C. Miller
bf7e7b5752 Add gettext.h convenience header. This is similar to but distinct from
the one included with the gettext package.
2011-05-20 11:48:17 -04:00
Todd C. Miller
645b5c1c7e Fix C format warnings. 2011-05-19 16:21:59 -04:00