Ecosyste.ms: OpenCollective

An open API service for software projects hosted on Open Collective.

github.com/sudo-project/sudo

Utility to execute a command as another user
https://github.com/sudo-project/sudo

Add build user for circleci instead of running as root.

3fa025281f10c7886b58f4ddcaa67549138828ec authored about 3 years ago by Todd C. Miller <[email protected]>
Use circleci for continuous integegration.

Build container descriptions are in the new docker directory.

8d98a447c580fc39d3a2b390e32e8093af2529f2 authored about 3 years ago by Todd C. Miller <[email protected]>
Update ignore file.

a02af3a45c1e73fdc61a72a2195d8a54dac76700 authored about 3 years ago by Todd C. Miller <[email protected]>
Sync "sudo -l" output with normal sudo log format.

It now prints runchroot and runcwd (falling back on cwd).
As a result, submithost is now printed ...

4e4b506f22006c485c7ce557c9905dae16c5c12e authored about 3 years ago by Todd C. Miller <[email protected]>
iolog_parse_json_object: optimize for large argv

3575e995a9f06a2002186741a85da7f622acea75 authored about 3 years ago by Todd C. Miller <[email protected]>
Add "-fcf-protection" to SSP_CFLAGS and SSP_LDFLAGS if supported.

Can be disabled via --disable-hardening.

c5f983c643ec87f078b8a13fd35a718655d19b10 authored about 3 years ago by Todd C. Miller <[email protected]>
Add "-z now" to hardened link options if supported.

Can be disabled via --disable-hardening.

edf30c727398f8de75f5b366c47cc4ebe7ee25d0 authored about 3 years ago by Todd C. Miller <[email protected]>
find_editor: remove the env_error argument

There is no case where we should fail to find an editor just because
the values of EDITOR, VISUAL...

d15e117c2eaae7bca2cae16415aa4ffa685fe919 authored about 3 years ago by Todd C. Miller <[email protected]>
Use sudo_printf(SUDO_CONV_ERROR_MSG) instead of fprintf(stderr).

Avoids extraneous output in the fuzzer.

dde951a09892a67b0f687dd087ff44fed5299da3 authored about 3 years ago by Todd C. Miller <[email protected]>
Stub out sudo_printf() and avoid other use of stderr in fuzzers.

This makes it possible to parse sudoers without using quiet mode,
resulting in better coverage.

2aa6cb13a56a5dac2fad22d50708e8ea3d4423b9 authored about 3 years ago by Todd C. Miller <[email protected]>
Use a consistent version of fuzz_conversation() with all fuzzers.

Also undo a change to fuzz_sudoers.c that snuck in to the last commit.

eefb7b0d5480343011ee1bdd176e06406f9f4c0c authored about 3 years ago by Todd C. Miller <[email protected]>
Fuzzers should not produce output.

Excessive output makes the fuzzer runs much less efficient.

7d964875df610bf995389f81f43950d62e2abd59 authored about 3 years ago by Todd C. Miller <[email protected]>
expand_buf: fix conditional for when we need to preserve existing data

It is possible for the buffer offset to be zero when the length is
non-zero. The proper value to...

dea7e6aefdfde992b65f3b6e259e7e88670ef512 authored about 3 years ago by Todd C. Miller <[email protected]>
Emulate closefrom() on macOS using proc_pidinfo().

This avoids relying on /dev/fd which may not exist in a chroot jail.
Adapted from a change in Ope...

476f00b82fec880b67bd8feb181b55eee8f0ebe6 authored about 3 years ago by Todd C. Miller <[email protected]>
Handle EMLINK and EFTYPE errno values for O_NOFOLLOW failure.

FreeBSD returns EMLINK and NetBSD returns EFTYPE instead of ELOOP.
This is only used to present t...

73e9256f9ddad53a9fac55b27a9a4391fda04250 authored about 3 years ago by Todd C. Miller <[email protected]>
Fix typo in last commit, use boolean AND not bitwise.

1d203c83441c93c548f88f59b83e1a374504d27d authored about 3 years ago by Todd C. Miller <[email protected]>
Add the ability to filter/match by command via the -m option.

For example "cvtsudoers -m cmd=/bin/ls" would only display entries
that would allow /bin/ls to be...

1831176a1a9cf1ed50867eabbb73c6183d141c21 authored about 3 years ago by Todd C. Miller <[email protected]>
Add --group-file and --passwd-file options to cvtsudoers.

These are based on the code in testsudoers.

41f116050fcac0a34e4834648559d6e838a3b523 authored about 3 years ago by Todd C. Miller <[email protected]>
Move cppcheck suppression annotation to where it needs to be.

a7367ce47de9bf824b301fc77bc9b4187623e1a6 authored about 3 years ago by Todd C. Miller <[email protected]>
format string fix: print signal number as unsigned.

Quiets a cppcheck warning; mksiglist.c already has this fixed.

99655f28dee1ea6f77d74f175bc7e719af27c799 authored about 3 years ago by Todd C. Miller <[email protected]>
Fix memory leak on error path if snprintf() overflows.

Coverity CID 188804

86df86ed9407d9d37495c3649e7e4e7be4a9ad98 authored about 3 years ago by Todd C. Miller <[email protected]>
Avoid reinitializing other auth methods.

b9b84518304b9dd42f071f5a607ddfd300d2640e authored about 3 years ago by Todd C. Miller <[email protected]>
expand_include: add bounds checking when expanding %h escape.

4a49f169679b455bf4b9b1bcd312d9081e62429f authored about 3 years ago by Todd C. Miller <[email protected]>
Check snprintf() return values even if we preallocated the correct amount.

There are no remaining unchecked snprintf() that can actually overflow.

dc90df8de5164af992391aa970c368c2031cf2c4 authored about 3 years ago by Todd C. Miller <[email protected]>
iolog_nextid(): make iolog_dir argument const.

We make a copy of the directory so there's no real reason that
parameter can't be const.

23d04dde2496ffcd527a0bb5bc81faf4c85dbd9e authored about 3 years ago by Todd C. Miller <[email protected]>
Amend truncation fix, the real problem was the size passed to snprintf().

sudo_rcstr_alloc() takes a length (not a size) parameter so when
calling snprintf() we need to ad...

0f2252f898e0de8cb2c026cfd9ce404d5f336d3c authored about 3 years ago by Todd C. Miller <[email protected]>
Fix truncation of the last char of the sudoRole cn passed to append_default().

This string is primarily used for warning messages.
Also check the snprintf() return value to avo...

e23874d0faa35c61b4823adffd28dfdf041c148d authored about 3 years ago by Todd C. Miller <[email protected]>
Sudo 1.9.8p2

4fef09e1c2e30e9cd2a8142279807d43376634c8 authored about 3 years ago by Todd C. Miller <[email protected]>
Standardize on "front-end" not "front end" in the man pages.

0340a9056e014064a710794991d3cf48dedd2904 authored about 3 years ago by Todd C. Miller <[email protected]>
fix typo

a036cb02525af24653e0540d3e76e356c31fb736 authored about 3 years ago by Todd C. Miller <[email protected]>
Reuse existing journal file for an accepted/rejected sub-command.

Otherwise we end up with zero-length files in the incoming queue
dir and may end up relaying one ...

a78d3cc25d01a90181fd43ac29e1c4f6bf34c578 authored about 3 years ago by Todd C. Miller <[email protected]>
Re-enable error output for the sudoers parser.

It is only the alias and defaults warnings we need to suppress.

b6561831b454a2a253967061221452c38cdd66cc authored about 3 years ago by Todd C. Miller <[email protected]>
Add intercept_cleanup() stub for when building w/o intercept support.

5421c6182824e6b0dcc522db7fe24ede4737c288 authored about 3 years ago by Todd C. Miller <[email protected]>
Add intercept_cleanup() to free the closure used by intercept_accept_cb().

a8c4d9800b6c567f5020cef5f0907f5fcaba33d1 authored about 3 years ago by Todd C. Miller <[email protected]>
Don't re-initialize PAM for sub-commands.

328bc282e0de0014612829dd2991a1acd94f8883 authored about 3 years ago by Todd C. Miller <[email protected]>
sudo_logsrvd: only send log ID for first command of a session

There is no need to send the log ID for each sub-command.

8cc7e4bb5e4cb843e9df0ec31db42ef204442259 authored about 3 years ago by Todd C. Miller <[email protected]>
Only store the first log id received from the server.

Plugs a small memory leak in intercept mode if the log server sends
the log ID again for sub-comm...

0eb677b74a8ee734485d0e081dd1e40e2144ff05 authored about 3 years ago by Todd C. Miller <[email protected]>
fuzz_sudoers: don't warn about unknown defaults entries

Some fuzzing inputs cause a huge number of warnings and displaying
them all can result in the fuz...

77ef8baa9704f4c47170dff4aad43bc67bbf19db authored about 3 years ago by Todd C. Miller <[email protected]>
Limit paths for command, cwd and chroot to PATH_MAX bytes.

This helps prevent the fuzzer from going off the rails.

0ea561ca6ac1a0020250e962dbded8e31324de90 authored about 3 years ago by Todd C. Miller <[email protected]>
sudo -i: missing NULL terminator when moving argv to make room for --login

Fixes a potential crash for "sudo -i" when the target user has bash
as the shell (which needs the...

7ab66eb3a8c35a1bef2f0b85bde231c91521d04b authored about 3 years ago by Todd C. Miller <[email protected]>
Only append argv[] to the log line if argv[0] is not NULL.

It should not be possible to reach this point with a command defined
but argv[] empty but it does...

518bc1b25f5cdf8ee3f9388ce77d5e7acd3589ce authored about 3 years ago by Todd C. Miller <[email protected]>
Only warn about an undefined alias or a cycle a single time.

There's no point in warning about the same problem multiple times.
This implementation assumes a ...

613468e4d2e6d91b93f4a299134e6c39d56f8297 authored about 3 years ago by Todd C. Miller <[email protected]>
Remove now-unused CHECK_INTERCEPT variable.

1d2512ae10c8a337d0313f9de78503d5767307e0 authored about 3 years ago by Todd C. Miller <[email protected]>
Quiet pvs-studio false positive: V557 Array overrun is possible.

Make the zero length check explicit so as not to confuse static
(or human) analyzers.

d9e8c852bae9714d0c18ae0757273bfd30bf6515 authored about 3 years ago by Todd C. Miller <[email protected]>
Test that digest matching works with LDAP sudoCommand: ALL

292916f43c9948caced9b62018d5ff510a5e0497 authored about 3 years ago by Todd C. Miller <[email protected]>
Allow a digest to be specified with the "ALL" command for ldap/sssd back-ends.

This has been possible with sudoers file entries since sudo 1.9.0
but no corresponding change was...

702746f96b0728e215066e9689aca75bfb3c6b5d authored about 3 years ago by Todd C. Miller <[email protected]>
Use localtime_r() not gmtime_r() when formatting the local time.

This is consistent with how sudo formatted time stamps prior to
the logging code being split off ...

49bf0cc84bd583b3559657cc736b2b30a875618a authored about 3 years ago by Todd C. Miller <[email protected]>
Check strftime(3) return value in all cases.

Old versions of strftime(3) didn't guarantee to NUL-terminate the buffer
so we explicitly clear t...

55171df5e5d837ff9e8de7ef7cf5e07eba0979c6 authored about 3 years ago by Todd C. Miller <[email protected]>
Use gmtime_r() and localtime_r() instead of gmtime() and localtime().

18f1884ddc6b984b463e4392bdd0444431471d5c authored about 3 years ago by Todd C. Miller <[email protected]>
Use the EVP digest routines instead of calling SHA2 functions directly.

Avoids compiler warnings with OpenSSL 3.0. EVP_MD_CTX_new() is
only available for OpenSSL 1.1 an...

921bc1c697020623a2dcee5b12298befd46d8a86 authored about 3 years ago by Todd C. Miller <[email protected]>
Standardize on "front-end" not "front end" in the man pages.

698481492c5838969272a7569499732c1bb5b365 authored about 3 years ago by Todd C. Miller <[email protected]>
Plugin lines are for approval and audit plugins too.

7c550c5d10801ceea24fa2eba4528c309f31296d authored about 3 years ago by Todd C. Miller <[email protected]>
Store milliseconds in the debug file timestamp.

Sometime second granularity is not enough.

46d71c4360257d4fa97fb2163303d69f383b4ddb authored about 3 years ago by Todd C. Miller <[email protected]>
Add gmtime_r and localtime_r tests and compat if missing.

fa71679b5a93046cf2b45451d4808cbd49745f8e authored about 3 years ago by Todd C. Miller <[email protected]>
When using pkg-config, don't assume the names of the ssl and crypto libs.

On the HP-UX build machines these are named libssl_pic.a and
libcrypto_pic.a to avoid conflicting...

78eb240642c766588223bbc8a6da99c91e76f5c3 authored about 3 years ago by Todd C. Miller <[email protected]>
tls_init.c: use SSL_CTX_set0_tmp_dh_pkey if present.

Fixes a warning on OpenSSL 3.0 and plugs a memory leak of dhparams
on config reload.

4e0b77be4b637246f15c4c4dbc827e9f73a7af41 authored about 3 years ago by Todd C. Miller <[email protected]>
mkpkg: limit the number of cores used to 16

18613eee229f28cd730d988988e9f7db8db0ee42 authored about 3 years ago by Todd C. Miller <[email protected]>
Add a test to exercise Bug #994

cf225d2f10325cd11dadf11b91ce17de4f6dcba8 authored about 3 years ago by Todd C. Miller <[email protected]>
fix typo

2445576e9bff7583be8f3cc99fd48f0c35f6ac51 authored about 3 years ago by Todd C. Miller <[email protected]>
Bug #994.

eab915ae9740cc7611451ace4ea9e497a2b3b6e6 authored about 3 years ago by Todd C. Miller <[email protected]>
Always allocate a struct sudo_command for the command, even for ALL.

This was missed in the previous set of changes, resulting in a crash
for LDAP and SSSD rules that...

0c30976ae683d1d76e3a258aa76e0d5c51b8ed83 authored about 3 years ago by Todd C. Miller <[email protected]>
Add SUDOERS_LDFLAGS to FUZZ_LDFLAGS

Fixes a fuzzer link error when building with ldap if the ldap libs
are not in the default library...

31e4a0a0a67f8fed3e9e20dcbb4ff18fdd3e62b7 authored about 3 years ago by Todd C. Miller <[email protected]>
Fix the OpenSSL link order for the non-pkg-config case.

Since -lssl depends on -lcrypto, -lcrypto must be listed after -lssl.
Fixes linking of non-dynami...

2d632937e67fff1a5183c5b1c79d4314e39d9cfb authored about 3 years ago by Todd C. Miller <[email protected]>
Sudo 1.9.8p1

e1653be4351665eba5a7cc909c44b3c9dbadbde8 authored about 3 years ago by Todd C. Miller <[email protected]>
sudo_interposer_init: verify message type from sudo

We should only get a HelloResponse from sudo at this point.

51d5f05e67e6d53064258c489540591640a216b2 authored about 3 years ago by Todd C. Miller <[email protected]>
Avoid symbol name clash to fix --enable-static-sudoers linking.

db750232c5a63b74779a5e5a5b27c7cba9d2c450 authored about 3 years ago by Todd C. Miller <[email protected]>
append_defaults() should not be passed a value for boolean flags.

The operation should simply be set to true/false.
Also treat a NULL file as coming from the front...

d7cdf1e47c596c3fa6cffedd4904c67919389668 authored about 3 years ago by Todd C. Miller <[email protected]>
Teach mkdep.pl about --tag=disable-static in LTFLAGS.

If static objs are disabled we need to add explicit dependencies for
.o files. The OpenBSD libto...

4289e9609d4a18b50b146d5215d25f3cd53359a0 authored about 3 years ago by Todd C. Miller <[email protected]>
Use SUDO_APPEND_LIBPATH when appending to LIBTLS and LIBMD.

The OpenSSL pkgconfig files only include -L paths, not -R paths.
Using SUDO_APPEND_LIBPATH ensure...

229dfe175dce71351a1a1451ed88966fca68359d authored about 3 years ago by Todd C. Miller <[email protected]>
Add --enable-openssl-pkgconfig-template option.

This can be used to find the correct openssl pkg-config file
if it is not named "openssl" (also l...

052391da9c175f7916961a3a77ec6f12b3bcc392 authored about 3 years ago by Todd C. Miller <[email protected]>
Some POSIX yacc fixes for bison 3.8

yyerror() must be extern void
declare tokens with type instead of using separate %type lines

ecc3aeffc6d3f908f72dc10235a0fdfacd2cabad authored about 3 years ago by Todd C. Miller <[email protected]>
Add src/intercept.exp to ignore files.

4b5a67cf8e63aa8ed505c08e2b709a73ca7988a0 authored about 3 years ago by Todd C. Miller <[email protected]>
regen

197d4ced38045174a0156316924173008fce6326 authored about 3 years ago by Todd C. Miller <[email protected]>
Mention --enable-static-sudoers fix.

02966f059ec0563fb8a492c0a08af4de0b8804f4 authored about 3 years ago by Todd C. Miller <[email protected]>
Fix typo introduced in 1.9.7 that set SUDO_LDFLAGS to SUDOERS_LDFLAGS.

Copy pasta is not always the best kind of pasta.

4b365300a70900f000886729431be93dbbc323b0 authored about 3 years ago by Todd C. Miller <[email protected]>
sudo_intercept.so: only replace execvpe() if it is present.

execvpe() is a GNU extension also found on *BSD (but not macOS).

3a4aec7a6216063701f63ed01291cdf4da52f173 authored about 3 years ago by Todd C. Miller <[email protected]>
We now intercept more than just execve().

6d5f450a62c52befb14132bf35397ce00a25829e authored about 3 years ago by Todd C. Miller <[email protected]>
Implement simple PATH resolution for execvp().

We want to use PATH from the current value of the environment, not
the initial value of PATH when...

6c456127b3c99d8a7128f18640916be5e71512a1 authored about 3 years ago by Todd C. Miller <[email protected]>
Add support for execl, execle, execlp, execvp, and execvpe.

Currently, PATH traversal is handled by sudoers which uses
the original PATH, not the one updated...

7ae62866e41255e34bf209598a4102be00ce7b8b authored about 3 years ago by Todd C. Miller <[email protected]>
Remove conditional include of alloca.h, we don't define HAVE_ALLOCA_H.

The configure check for alloca() was removed long ago but this got
missed.

bf60451845494782fa3d8b75a07ac0ed16c83c4a authored about 3 years ago by Todd C. Miller <[email protected]>
Define RBAC and mention incompatibility with intercept/log_subcmds.

aac09cf7be452704da4dc06dc439e3a487fb00c0 authored about 3 years ago by Todd C. Miller <[email protected]>
Fix computation of the token address when handling a partial read.

We want to treat it as an array of bytes, not an array of tokens.
Coverity CID 240011

157ceadfab17753763a9d5c49f75e0d66a935c1c authored about 3 years ago by Todd C. Miller <[email protected]>
Quiet a PVS-Studio format string warning.

f64d71674ea0a346942b84db7866af53fecf579a authored about 3 years ago by Todd C. Miller <[email protected]>
Regen .pot files.

9a9a22e93ead03a543345778fe7218e4c022b4bb authored about 3 years ago by Todd C. Miller <[email protected]>
Updated translations from translationproject.org

2f6cacd1ec7c78531e686d69fc9ec936eabb5b3f authored about 3 years ago by Todd C. Miller <[email protected]>
regen

967bcab4dbfa79bc7b47233861b97710841d82c5 authored about 3 years ago by Todd C. Miller <[email protected]>
Do not compile intercept code if --disable-intercept is specified.

38d884a62d618140ffefd3dfa2370dfc06c344b5 authored about 3 years ago by Todd C. Miller <[email protected]>
We now intercept execv() too.

5c2f1ebbcfeac3dbe31f6b6d57446661914a461d authored about 3 years ago by Todd C. Miller <[email protected]>
INSTALL: --disable-intercept will also disable "log_subcmds"

190e495b64d025aed72d2186fe1d4ea93c0cf293 authored about 3 years ago by Todd C. Miller <[email protected]>
Can't use intercept or log_subcmds with SELinux RBAC.

SELinux policy will prevent the inherited socket from sudo from
being used and may also restrict ...

f40afd73fe9b32ffa1ac8bb537516d7c95e97762 authored about 3 years ago by Todd C. Miller <[email protected]>
Fix typo in comment.

242e4d070fc2036515941ae3860b6b5eafb156d0 authored about 3 years ago by Todd C. Miller <[email protected]>
Updated translations from translationproject.org

4ca5c7d64360bbbf3d46a7a6fb7e439a0455a972 authored about 3 years ago by Todd C. Miller <[email protected]>
Switch to a 128-bit token instead of a 64-bit secret.

Protobuf doesn't have a 128-bit type so use two u64s.
We now support partial reads of the token.

9a690a89846f732a73f070e2f414841f7c803e25 authored about 3 years ago by Todd C. Miller <[email protected]>
Fix random uuid generation, no need to convert between byte order.

Also add regression test.

4bff82cab42af89b680b344c3d5fea2d87b33153 authored about 3 years ago by Todd C. Miller <[email protected]>
sudo_intercept.so: send the secret immediately after connecting.

Sending the secret out of band, before the message size is read,
should make it harder to mount a...

9137909c7d0a917aa1821a139f96fa760ad75bbf authored about 3 years ago by Todd C. Miller <[email protected]>
Handle reading large messages that don't fit in a single recv().

We know the length of what we are receiving so just loop until
we have it all, get EOF or an error.

26938012f8158177afa6c526a698801bd3a3582a authored about 3 years ago by Todd C. Miller <[email protected]>
Add checks for -fstack-clash-protection and -Wl,-z,noexecstack

We use -Wc,-fstack-clash-protection as the linker flag to prevent
libtool from removing it from t...

c0630a36c8a5afc9efed823a166b71fe6b8becc6 authored about 3 years ago by Todd C. Miller <[email protected]>
Make the sudo side of the intercept socket non-blocking.

a078bc64bb5ac715e60eed84e4a5d553b527334e authored about 3 years ago by Todd C. Miller <[email protected]>
Handle partial read/write by dropping back into the event loop.

3c26b92a756a3d734bd9248e0bed15276527eadc authored about 3 years ago by Todd C. Miller <[email protected]>
intercept_check_policy: Fix double free introduced in last commit

If the command is not accepted we don't rebuild command_info[] and
must not free it. It will be ...

33d1b26c6abd04a595dd5cd740b2bbde76a69562 authored about 3 years ago by Todd C. Miller <[email protected]>