Todd C. Miller [Sat, 15 Feb 2014 23:04:07 +0000 (16:04 -0700)]
Remove some extraneous markup; from Ingo Schwarze
* No need to explicitly end a macro with No before |
because | counts as middle punctuation
and falls out of the macro, anyway.
* No need to explicitly re-open in-line macros after |
because | counts as middle punctuation
and the macros resume afterwards, anyway.
* Simplify the mnemonic remarks regarding the option letters,
no need for manual font and spacing control with No and Ns.
* Trim Ns No to just Ns, it already implies No.
Todd C. Miller [Tue, 11 Feb 2014 16:40:59 +0000 (09:40 -0700)]
We must include gettext.h before missing.h as it includes system
headers. Also add missing DEFAULT_TEXT_DOMAIN defines in sudoers
audit code that does not include sudoers.h.
Todd C. Miller [Tue, 11 Feb 2014 14:43:13 +0000 (07:43 -0700)]
When emulating DSO_NEXT with shl_get() we need to skip the program's
handle. This used to be documented as being index -2 but now it
seems to be index 0. As this is not guaranteed we need to look up
the real handle value for PROG_HANDLE and skip it when interating
through all the DSOs. Fixes infinite recursion on HP-UX in the
getenv() replacement.
Todd C. Miller [Fri, 7 Feb 2014 21:58:48 +0000 (14:58 -0700)]
Add use_netgroups sudoers option. For LDAP-based sudoers, netgroup
support requires an expensive substring match on the server. If
netgroups are not needed, this option can be disabled to reduce the
load on the LDAP server.
Todd C. Miller [Thu, 6 Feb 2014 22:50:08 +0000 (15:50 -0700)]
Use a default LDAP search filter of (objectClass=sudoRole). When
constructing the netgroup query, add (sudoUser=*) to the query so
we don't fall below the 3 character OpenLDAP substring threshold.
Otherwise the index for sudoUser will never be used for that query.
Pointed out by Michael Stroeder.
Todd C. Miller [Wed, 5 Feb 2014 19:03:58 +0000 (12:03 -0700)]
In term_restore(), only restores the terminal if we are in the
foregroup process group. Instead of calling tcgetpgrp(), which is
racy, we set a temporary handler for SIGTTOU and check whether it
was received after a failed call to tcsetattr().
Todd C. Miller [Tue, 4 Feb 2014 13:22:19 +0000 (06:22 -0700)]
When the closefrom limit is greater than any of the preserved fds,
the pfds list will be non-empty but lastfd will be -1 triggering
an ecalloc(0) assertion. Instead, test for lastfd being -1 and
make sure we always update it, even if dup() fails.
Also restore initial value of lowfd after we are done relocating.
Fixes bug #633
Todd C. Miller [Mon, 3 Feb 2014 23:51:51 +0000 (16:51 -0700)]
syscall restarting is broken on Mac OS X when interrupted by a tty
signal so restart tcsetattr() by hand. For details, see.
http://openradar.appspot.com/radar?id=6402578615107584
Todd C. Miller [Mon, 3 Feb 2014 12:45:27 +0000 (05:45 -0700)]
Bring back boot time checking code and zero out time stamp files
that predate the boot time. This should help systems w/o /var/run
where the admin has setup rc.d to clear the timestamp directory.
Todd C. Miller [Sat, 1 Feb 2014 13:30:40 +0000 (06:30 -0700)]
Remove the time stamp dir and its contents when uninstalling. We
currently leave the lecture status files installed until there is
a better way to detect upgrades.
Todd C. Miller [Sat, 1 Feb 2014 12:57:34 +0000 (05:57 -0700)]
Replace --with-timedir and --with-lecture_dir with --with-rundir
and --with-vardir which are the parent directories of the time stamp
and lecture dirs. These directories need to be searchable by
non-root so that the timestampowner setting can function.
Todd C. Miller [Sat, 1 Feb 2014 12:47:16 +0000 (05:47 -0700)]
Fix use of timestampowner in the new time stamp world order. Parent
directories for timestampdir and lecture_dir are now created with
the execute bit set so that we can traverse them as non-root.
Todd C. Miller [Thu, 30 Jan 2014 22:50:40 +0000 (15:50 -0700)]
Switch to new time stamp file format. Each user now has a single
file which may contain multiple records when per-tty time stamps
are in use (the default). The time stamps use a monotonic timer
where available and are once again stored in /var/run/sudo. The
lecture status is now stored separately from the time stamps in a
different directory.
Todd C. Miller [Sun, 26 Jan 2014 20:23:09 +0000 (13:23 -0700)]
Use inet_aton() instead of inet_addr() as it allows us to distinguish
between the address (or mask 255.255.255.255) and an error. In the
future we may consider switching to inet_pton() for IPv4 too.
Todd C. Miller [Wed, 15 Jan 2014 03:34:20 +0000 (20:34 -0700)]
If the event loop exits due to an error and we are not logging I/O,
kill the command if still running. Fixes a bug where sudo could
exit while the command was still running.
Todd C. Miller [Wed, 15 Jan 2014 03:20:26 +0000 (20:20 -0700)]
When relocating preserved fds, start with the highest ones first
to avoid moving fds around more than we have to. Now uses a bitmap
to keep track of which fds are being preserved. Fixes a bug where
the debugging fd could be relocated to the same fd as the error
backchannel temporarily, resulting in debugging output being printed
to the backchannel if util@debug was enabled.
Todd C. Miller [Tue, 14 Jan 2014 17:54:56 +0000 (10:54 -0700)]
If not logging I/O we may get EOF when the command is executed and
the other end of the backchannel is closed. Just remove the
backchannel event in this case or we will continue to receive
the event. Bug #631