Commit Graph

9039 Commits

Author SHA1 Message Date
Todd C. Miller
d5d170252a In pty_cleanup() we need to call sudo_term_restore() even if no I/O
plugins are present as long as /dev/tty exists.  Fixes the use_pty
case with no I/O plugins.
2018-02-19 11:00:12 -07:00
Todd C. Miller
42fe0409f6 Add sudo_ev_dispatch(), a wrapper for ev_loop() with no flags.
Similar the dispatch function in libevent.
2018-02-19 11:00:10 -07:00
Todd C. Miller
525c6a3d94 Use /run in preference to /var/run if it exists.
Bug #822
2018-02-19 10:59:12 -07:00
Todd C. Miller
59086e9c8a mention common sudoers formatting changes 2018-02-14 11:30:49 -07:00
Todd C. Miller
43a3a23fed Move LDAP configuration bits into ldap_conf.c 2018-02-11 07:36:08 -07:00
Todd C. Miller
0c08de88cd No longer need to include stddef.h 2018-02-10 13:37:59 -07:00
Todd C. Miller
e2213dc1e3 Remove dead store, found by cppcheck. 2018-02-10 09:44:34 -07:00
Todd C. Miller
34820c6b15 simplify iterator 2018-02-10 04:29:43 -07:00
Todd C. Miller
6e2a267060 Silence a false positive from cppcheck. 2018-02-10 04:08:42 -07:00
Todd C. Miller
d0d413d077 Cast version to int when printing. Avoids a cppcheck warning. 2018-02-10 04:00:17 -07:00
Todd C. Miller
4459ee42ed Use an iterator instead of fragile pointer arithmetic to iterate
over value arrays in sudo_ldap_role_to_priv().
2018-02-09 22:06:56 -07:00
Todd C. Miller
64e99328e3 Move sudoers formatting code into fmtsudoers. 2018-02-09 18:22:04 -07:00
Todd C. Miller
dda1d6cef7 Clean up some XXX in parse.c 2018-02-09 18:22:03 -07:00
Todd C. Miller
2522229e86 Rename sudo_file_append_default() -> sudo_lbuf_append_default() and
use it for ldap and sssd too.
2018-02-09 18:22:02 -07:00
Todd C. Miller
3226f7e28b Move common bits of ldap to sudoers conversion into ldap_common.c
and use it in sssd.c.
2018-02-09 18:21:40 -07:00
Todd C. Miller
4e2402a8e4 Convert ldap results into a sudoers userspec so we can use the "sudo
-l" output functions in parse.c.
2018-02-09 18:21:01 -07:00
Todd C. Miller
787717755b Don't mark sudoers.dist volatile, it only gets used on systems that
don't have the concept of volatile files.
2018-02-08 09:14:12 -07:00
Todd C. Miller
5cca4b6906 Refactor member freeing code into free_member().
Refactor userspec freeing code into free_userspec().
2018-02-05 13:33:29 -07:00
Todd C. Miller
9d49592f14 Fix compilation with glibc where stdout is not constant. 2018-02-05 06:23:33 -07:00
Todd C. Miller
57e7b4b49e For "sudo -l", if a word includes spaces, print it in double quotes.
Also escape spaces in the command path.  This matches the sudoers
quoting rules.
2018-02-04 12:53:32 -07:00
Todd C. Miller
3189de5bb9 Display sudoNotBefore and sudoNotAfter in "sudo -l" 2018-02-03 14:56:00 -07:00
Todd C. Miller
105ced47b8 For "sudo -l", if a word includes spaces, print it in double quotes.
Also escape spaces in the command path.  This matches the sudoers
quoting rules.
2018-02-03 06:59:37 -07:00
Todd C. Miller
40c200af18 Add back printing of negation operator ('!') when printing a word
with spaces in it.
2018-02-03 06:57:12 -07:00
Todd C. Miller
1aca11c788 Use visudo to validate "cvtsudoers -f sudoers" output. 2018-02-03 06:46:56 -07:00
Todd C. Miller
f31ba6c22f Remove syslog_goodpri and syslog_badpri without a value that causes
visudo to report an error.
2018-02-03 06:45:39 -07:00
Todd C. Miller
61b6ae64de When outputting sudoers, if a word includes spaces, print it in
double quotes.  Also escape spaces in the command path.
2018-02-03 06:18:47 -07:00
Todd C. Miller
3354cbd021 Add sudoers output format to cvtsudoers. In the future this may
be used with filters to emit a partial sudoers file instead of a
full one.
2018-02-02 14:29:19 -07:00
Todd C. Miller
df08d0d8f4 When printing a member name, quote sudoers special characters unless
it is a UID/GID, in which case we print the '#' unquoted.
2018-02-02 14:29:17 -07:00
Todd C. Miller
f4ce2b25fc Move SUDOERS_QUOTED define to parse.h 2018-02-02 06:28:04 -07:00
Todd C. Miller
07d9cec271 Remove extraneous break statement and fix some whitespace. 2018-01-30 11:12:38 -07:00
Todd C. Miller
5de49b2d6b The max timeout for kernel time stamps is 60 minutes, not 3600 minutes. 2018-01-30 11:11:48 -07:00
Todd C. Miller
5e9e641b3d Check the return value of sudoers_debug_register().
Coverity CID 182574
2018-01-29 14:02:21 -07:00
Todd C. Miller
f3ef0f5091 Fix memory leak, su->count is now 0 when it is unused, not 1.
Covertity CID 182573
2018-01-29 13:58:25 -07:00
Todd C. Miller
7766278031 Quiet a clang analyzer false positive. 2018-01-29 11:50:56 -07:00
Todd C. Miller
b374effcb4 Quote special characters when creating the cn as per RFC2253 2018-01-29 11:00:43 -07:00
Todd C. Miller
d2303d8b12 Sudo 1.8.23 2018-01-29 09:40:12 -07:00
Todd C. Miller
9d49c9193b Remove the C-style comment charactes from the getopt_long.c and
inet_pton.c license text as it was inconsistent with the rest of
the file and messed up the html formatting.
2018-01-29 09:31:54 -07:00
Todd C. Miller
7f310d7386 Remove sudoers2ldif, it has been replaced by cvtsudoers. 2018-01-29 09:18:48 -07:00
Todd C. Miller
831de0fc8b Add -b option to specify the base dn. 2018-01-28 19:58:10 -07:00
Todd C. Miller
b0abdd5a17 Document limitations of LDIF conversion. 2018-01-28 19:38:00 -07:00
Todd C. Miller
4acaa9c74a Switch the default output format to LDIF 2018-01-28 19:36:16 -07:00
Todd C. Miller
7e5e1f6a6d Execute cvtsudoers if the user runs "visudo -x" but also emit a
warning.
2018-01-28 16:34:16 -07:00
Todd C. Miller
63321f19a9 Revert 04ec05108b2b, change the default input source back to stdin. 2018-01-28 16:11:02 -07:00
Todd C. Miller
6272829dcc Add LDIF conversion to sudoers tests 2018-01-28 10:07:15 -07:00
Todd C. Miller
7dd620981b Add notbefore and notafter support to the backends. 2018-01-28 07:09:22 -07:00
Todd C. Miller
ea7daee6f7 cvtsudoers instead of sudoers2ldif 2018-01-27 20:12:34 -07:00
Todd C. Miller
681fb2e76e Add ldif backend to cvtsudoers, to replace sudoers2ldif 2018-01-27 20:08:02 -07:00
Todd C. Miller
7638e71730 fix make check 2018-01-27 19:52:20 -07:00
Todd C. Miller
cc31b3fd40 Parse sudoers in the front end, not the back end. 2018-01-26 17:29:56 -07:00
Todd C. Miller
c360ad4605 install the cvtsudoers manual 2018-01-26 13:19:03 -07:00