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

Update runcwd in command_info[] before passing it to the audit plugin.

Since sudoers does rejected commands itself the runcwd will still
not be correct for those.

168d5c47c99336ac3be70b2c04170b17e615919c authored about 3 years ago by Todd C. Miller <[email protected]>
Fix LD_PRELOAD formatting when there is an existing LD_PRELOAD var.

22de92b0da9c75106b1137ec4d7378c06d629187 authored about 3 years ago by Todd C. Miller <[email protected]>
intercept_check_policy: fix potential NUL dereference on the error path.

75bac8dee935cd5251da7ccec21413815a71a8c9 authored about 3 years ago by Todd C. Miller <[email protected]>
Rename log_children -> log_subcmds

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

d8d4023335818110c0d5889df1bc4cbf2e827bcf authored about 3 years ago by Todd C. Miller <[email protected]>
Add sudo_debug_register_v2() stub for fuzzing build.

dcab17900b4b43fa5384e7d04a2856622b5c3694 authored about 3 years ago by Todd C. Miller <[email protected]>
Fix use-after-free on error.

Also remove useless free of a ptr that is always NULL on the error path.

3d8b327c6056476a19b28325ba792d42ffd66f97 authored about 3 years ago by Todd C. Miller <[email protected]>
No longer need to remap intercept fd but we do need to remap debug fd.

The intercept fd is closed in the ctor but the debug fd will still be open.

dc30c842bb006d5ecb765399f0ca9eca7533beeb authored about 3 years ago by Todd C. Miller <[email protected]>
sudo_debug_register: add minfd argument to specify lowest fd number

Use this in sudo_intercept.so to avoid allocating a low-numbered
fd which the shell reserves for ...

70aef0eb2d11f6117400671fe4d4be71d90ae86e authored about 3 years ago by Todd C. Miller <[email protected]>
Fix command name of sub-command in logs when log_children is set.

d6a71fe32ebddf49299304b4efcebc254550d76a authored about 3 years ago by Todd C. Miller <[email protected]>
log_allowed: pass struct eventlog * instead of argv[] and envp[].

This lets us log based on the command_info[] list passed in from
the front-end. Previously, much...

ec751c63eb3f0a91e8d2e748a1b84ee2ee12641f authored about 3 years ago by Todd C. Miller <[email protected]>
sudo_compat.h: include unistd.h on HP-UX to safely redefine pread/pwrite

HP-UX 11.31 defines static functions for pread() and pwrite() which
will conflict with our macros.

e199dd825436c1da2f50d98e2cabedfc9fe0a1c9 authored about 3 years ago by Todd C. Miller <[email protected]>
Change intercept IPC to use a localhost socket instead of inherited fd.

This allows intercept mode to work with shells that close all open
fds upon startup. The ctor in...

c465d8971d08dd1b70a145501cf13656b6461828 authored about 3 years ago by Todd C. Miller <[email protected]>
Add a state variable to intercept_closure, replaces policy_result.

438a0cf07ef5ba8592a061c0c030156664fcb266 authored about 3 years ago by Todd C. Miller <[email protected]>
command_matches: avoid printf("%s") of NULL in debug for sudo ALL.

0aedc965f88a08912eae945cd6cb15ca4f8faae2 authored about 3 years ago by Todd C. Miller <[email protected]>
Merge pull request #111 from commodo/fix-cflags

lib/util/Makefile.in: use host CFLAGS and CPPFLAGS for mksig{name,list}

9980357a73183d1032b53d985a02d0790dbf296c authored about 3 years ago by Todd C. Miller <[email protected]>
lib: util: Makefile.in: use host CFLAGS and CPPFLAGS for mksig{name,list}

When cross-build support was added for mkig{name,list} was added, the
CFLAGS and CPPFLAGS should...

a12b15b436bae74375a82694dbd30e574796452f authored about 3 years ago by Alexandru Ardelean <[email protected]>
Fold intercept_closure_reset() into intercept_close().

448536e0f78a750566ff73a3f85cde5f48e19b2c authored about 3 years ago by Todd C. Miller <[email protected]>
Fix typo that caused SUDO_INTERCEPT_FD to overwrite LD_PRELOAD.

222d6f94cdad6000d76cea15b96c7fc1ea0de1fd authored about 3 years ago by Todd C. Miller <[email protected]>
Fix off-by-one that could result in duplicate SUDO_INTERCEPT_FD vars.

1391813443a724480a40e09d5daa27ebf08b925d authored about 3 years ago by Todd C. Miller <[email protected]>
Fix typo in macOS execv change.

df68f4c8d9ff59e0b6ab85660c832e0846ff2f5f authored about 3 years ago by Todd C. Miller <[email protected]>
Add execv(3) support to sudo_intercept.so.

This allows intercept to work with csh which uses execv(3) not execve(2).

98401c05881c6725d3c1c603c98c56aded1cf339 authored about 3 years ago by Todd C. Miller <[email protected]>
Sync the list of functions trapped by sudo_noexec.so.

02b78c38ed9cbd85f7c4f062f5f0cc29181910c6 authored about 3 years ago by Todd C. Miller <[email protected]>
Add a Debug example for sudo_intercept.so

Don't try to enumerate all the sudo programs that support debugging
since all of them do.

1e795b54877d5d3ab66ac044892ef87269a8a4a8 authored about 3 years ago by Todd C. Miller <[email protected]>
Update sudoers Debug example to match the debug changes from sudo 1.8.12.

bb40491c99f92dae0d672018a50c313078404658 authored about 3 years ago by Todd C. Miller <[email protected]>
sudo_intercept.so only intercepts execve(2) for now.

8ccb7f0096cfb1a8b7f155a86cde444af056b30c authored about 3 years ago by Todd C. Miller <[email protected]>
Fix formatting for bound defaults with multiple entries in the binding.

The entries in the binding were separated with " ," instead of ", ".

7df245dc91d45bf46abb79d71e3f824195f1250b authored about 3 years ago by Todd C. Miller <[email protected]>
Add exports file for sudo_intercept.so that only exports execve()

4ccd966e22d70263661cab8ed16ee99c0feef5e2 authored about 3 years ago by Todd C. Miller <[email protected]>
Add some debugging to the sudo_intercept.so.

dc281f0366fa0c48ad9b4546ea4dee6505219894 authored about 3 years ago by Todd C. Miller <[email protected]>
Use AC_FUNC_FSEEKO instead of AC_CHECK_FUNCS_ONCE([fseeko]).

This will define _LARGEFILE_SOURCE, if needed, to make the prototype
visible on older systems.

680fd4a62930f93a8bf314b5dc943aac737f466f authored about 3 years ago by Todd C. Miller <[email protected]>
We still need the pread/pwrite hack for HP-UX 11.11 at least.

This time around, avoid defining _LARGEFILE64_SOURCE and just declare
pread64/pwrite64 ourselves.

ad28b90c4dde83a0243af1fd78a2b8de4a183713 authored about 3 years ago by Todd C. Miller <[email protected]>
Fix prototypes for sudo_pread() and sudo_pwrite().

23e5304b7802c1575d43fa6d22fdcc9b21d11591 authored about 3 years ago by Todd C. Miller <[email protected]>
intercept_fd_cb: store the passed fd in newfd, not fd

only affects the old BSD-style fd passing code, not POSIX-style.

5d3ab032f2b5d93b164e092b6c912f6a61261faa authored about 3 years ago by Todd C. Miller <[email protected]>
Fix mksiglist and mksigname dependencies.

d333f484eca442023118105cc1ee969d53497f5d authored about 3 years ago by Todd C. Miller <[email protected]>
set-user-ID and set-group-ID not set user-ID and set group-ID.

52e7594ae584b1da3a4d34635011bae2de140366 authored about 3 years ago by Todd C. Miller <[email protected]>
The fix for bug #989 will make sudo 1.9.8.

Also mention intercept_authenticate and intercept_allow_setid.

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

90aee138baf82adc42a710d1e24d25aea3ad0705 authored about 3 years ago by Todd C. Miller <[email protected]>
Cross-build support for mksigname and mksiglist

We must build these with the host C compiler but use the target
preprocessor to generate the output.

b40f74cb24c5ecd377bd35b69d503d615c67b0a5 authored about 3 years ago by Todd C. Miller <[email protected]>
Minor cleanup (#110)

* fix trivial shell script issues
* remove trailing whitespace

bf7d20b482edea8c4f2f945a27f51c7eaf6aa203 authored about 3 years ago by a1346054 <[email protected]>
Replace messages like "unknown foo: %s" with "unknown foo %s".

The colon really doesn't belong there; we generally use a colon to
separate a message from the wa...

bb5843055ef0c3b84254769926f07cc9d668288b authored about 3 years ago by Todd C. Miller <[email protected]>
log_server_peer_cert and log_server_peer_key are not required by default.

They are only required if sudo_logsrvd has tls_checkpeer enabled.

1c52c24a9325204bfc31285a649b07ea62cef5a2 authored about 3 years ago by Todd C. Miller <[email protected]>
Sync warning messages with sudoers/logging.c

Avoids 3 translation strings that were effectively duplicated.

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

ad5feeb40b20cd81f028e7b00ac6305d2085629c authored about 3 years ago by Todd C. Miller <[email protected]>
Add intercept_allow_setid sudoers option, disabled by default.

With this change, a shell in intercept mode cannot run a setuid or
setgid binary by default. On ...

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

Previously we special-cased handling of ALL but this complicates
some upcoming changes.

53a95e3a50e38569b14a415e966c553a756e7f63 authored about 3 years ago by Todd C. Miller <[email protected]>
Update TAGS_CHANGED macro based on parse.h

dad40a50a1dab8f04fc1b3ed8c448b9395d72618 authored about 3 years ago by Todd C. Miller <[email protected]>
Better document the limitations of intercept mode.

Also mention log_children under "Preventing shell escapes"

fc9a01936c20ebf48b6ea7fee5b966e953263bb0 authored about 3 years ago by Todd C. Miller <[email protected]>
Update .pot files for 1.9.8.

e4809d634d0527da90b47fdf5b6e5137025edc15 authored about 3 years ago by Todd C. Miller <[email protected]>
Try to clarify log_server_peer_key and log_server_peer_cert.

These are client-side not server-side.

a85cf1f3fddf1a89da3013d1a443f56fbbeee3e7 authored about 3 years ago by Todd C. Miller <[email protected]>
Print the section when warning about an illegal key in the conf file.

This should make it easier to tell when a setting is present in the
wrong section.

bfcc31b19bd1f5fa3d3c44001ad0d3ac28f64c84 authored about 3 years ago by Todd C. Miller <[email protected]>
new_logline: limit offset to two significant digits after the decimal

Now instead of [email protected] we would log [email protected].

5902c0e21cc67f55773266d17c6d4f75a912a028 authored about 3 years ago by Todd C. Miller <[email protected]>
Set umask to be less restrictive before creating parent directories.

Otherwise we could end up creating them with a more restrictive
mode than indended. Coverity CID...

9248ea6bbe6ebe6d260feb22a3dada21c8053c18 authored about 3 years ago by Todd C. Miller <[email protected]>
new_logline: handle case where evlog is NULL

babb498c6ebe09723a751127b104f43ab643ee91 authored about 3 years ago by Todd C. Miller <[email protected]>
store_alert_local: fix memory leak on error path

Coverity CID 238642

6d3cf0ffda1dd7aab0b77c1d4319e50e09f7cf25 authored about 3 years ago by Todd C. Miller <[email protected]>
log_server_accept: fix memory leak of evlog when logging a sub-command.

Coverity CID 238643

e2abcd6cb63ab42ddf09d9a734580b319111d2fc authored about 3 years ago by Todd C. Miller <[email protected]>
Fix memory leak when client requests secret.

Move closure allocation closer to where it is used.

340d7539471faf1ca241a26151dcfad356055df2 authored about 3 years ago by Todd C. Miller <[email protected]>
store_accept_local: fix return value on error

4add9c2c0082ec0490dd5d11fb80a2d0a3f8cc98 authored about 3 years ago by Todd C. Miller <[email protected]>
Cast iolog_offset.tv_sec to long long for %lld printf format.

Quiets a compiler warning on systems where tv_sec in struct timeval
is not long long.

0f6a74f180307dcf3512478b71f52186f258f297 authored about 3 years ago by Todd C. Miller <[email protected]>
For intercepted commands, log an offset into the current I/O log.

This can be used with sudoreplay to jump to when a specific command
was executed within a session...

4aefd43948073ce95c47a55ee674fe7348c29195 authored about 3 years ago by Todd C. Miller <[email protected]>
Add support for an optional offset when parsing the ID to replay.

The offset is a suffix in the form of @sec[.nanosec]

695f4bea0588c8b29ac90d9b64fc1470e414d3b6 authored about 3 years ago by Todd C. Miller <[email protected]>
Don't overwrite closure->evlog for sub-commands.

064981fb146c6914d76bb36a8aa279f56ec38e72 authored about 3 years ago by Todd C. Miller <[email protected]>
Older Solaris has getusershell() et al but does not declare it.

62aca803ceb971e6c4024dbb1fe5b800408bdb50 authored about 3 years ago by Todd C. Miller <[email protected]>
Add missing stdint.h and sudo_rand.h includes.

Needed for arc4random() and uin64_t.

a55b54329e0276840af29d8dad34154d1afa9cf7 authored about 3 years ago by Todd C. Miller <[email protected]>
Pass a secret value to sudo_intercept.so and verify after policy check.

The goal is to make it harder for someone to have a fake policy checker.
This will not stop a det...

eaf03a382bef862bbb8f520424aa6a5a38f003f7 authored about 3 years ago by Todd C. Miller <[email protected]>
Split off intercept code into exec_intercept.c.

c9d9225469beb45d71e37d3171baa8d82dee93d9 authored about 3 years ago by Todd C. Miller <[email protected]>
Add trivial support for FreeBSD packages.

The actual FreeBSD port supports multiple options but this is sufficient
for testing purposes.

3f30704ab74d40cb7e28f026937accd16954466a authored about 3 years ago by Todd C. Miller <[email protected]>
FreeBSD: Set default directory and file mode if not specified in %files

Otherwise, a mode of 0 will be used, potentially rendering the
system unusable.

374d4998185f3b24d3e98c5962138182c1d02110 authored about 3 years ago by Todd C. Miller <[email protected]>
Use same check for intercepted commands as log_server_accept().

Previously, log_server_reject() and log_server_alert() just
checked whether client_closure has be...

f327a19f3444356ab2df364f8fc17b0f11f98f5f authored about 3 years ago by Todd C. Miller <[email protected]>
Call shutdown() on sockets before closing() if they are connected.

This should ensure that the other side sees any queued data before
the connection is dropped.

0e2094471be9116645d5917b5cb6c9073e87e0e7 authored about 3 years ago by Todd C. Miller <[email protected]>
If SSL_shutdown() returns 0 it needs to be called one more time.

79129613e5999addbe62bc12d67a829aba79f976 authored about 3 years ago by Todd C. Miller <[email protected]>
resolve_editor: sudoers_gc_remove(editor) before freeing it.

ffdd7920cd98b495a42775bb35012ec259e33a46 authored about 3 years ago by Todd C. Miller <[email protected]>
Sync siglist.in with the generated files.

The change to prefer SIGSYS over SIGUNUSED wasn't made to siglist.in.
Also, mksigname.c doesn't n...

ef91b90ad64a8c3f7b34842a3f25de303b349c07 authored about 3 years ago by Todd C. Miller <[email protected]>
Add garbage collection to resolve_editor().

Fixes a leak when evaluating the policy multiple times if sudoedit
is set.

9798fd86bf14122098474544ca8ebc32815d242f authored about 3 years ago by Todd C. Miller <[email protected]>
Fix compilation when configure option --disable-shared is specified.

abac069566a73172f6c48c661b28e4347281a157 authored about 3 years ago by Todd C. Miller <[email protected]>
Avoid some double frees in the fuzzer

Now that sudoers free old values of NewArgv and command_info the
fuzzer needs to reset those valu...

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

aa20eccad4a313b859abf914355e508b10182b77 authored about 3 years ago by Todd C. Miller <[email protected]>
Plug some memory leaks when sudoers_policy_main is called multiple times.

These would get cleaned up a policy close time but we don't want
to bloat sudo's memory footprint...

3a090dcdcdf1a1594a3606b36f437503ea3c4209 authored about 3 years ago by Todd C. Miller <[email protected]>
Add intercept_authenticate sudoers option, defaults to false.

By default, sudoers will not require authentication of commands run
via an intercepted session. ...

788708c9ff925a79ffdd56612f86d3dfc36d7232 authored about 3 years ago by Todd C. Miller <[email protected]>
Use a separate uuid for intercepted commands.

We use the uuid to match the command with its exit status.

dae370fb70da81a0e7f358e61c146215deca870a authored about 3 years ago by Todd C. Miller <[email protected]>
Fix logging intercepted commands to a log server in sudoers.

Only available when the server supports the subcommands capability.

2e99450d4017e20c3e716635f32e5939bd07125c authored about 3 years ago by Todd C. Miller <[email protected]>
If building with address sanitizer make sure its DSO is first.

Address sanitizer requires that it be preloaded before any other
DSO in LD_PRELOAD. This should ...

dfe26f8c3438b685177f904c19fa7d792c58b052 authored about 3 years ago by Todd C. Miller <[email protected]>
Require that our dso be first in the list to make sure it takes effect.

Otherwise, another dso could take precedence and ours would not be run.

8f8a9c37b35ba8deba3dc4e0ccee2b934b3c4f0d authored about 3 years ago by Todd C. Miller <[email protected]>
If msg_control is not present in struct msghdr use msg_accrights instead.

Fixes building on Solaris and probably others. It is possible to
expose msg_control on Solaris b...

0ea5efd8b7a6cf4c56216a7470e7ebd40101dd22 authored about 3 years ago by Todd C. Miller <[email protected]>
Add debug support to sudo_intercept.so

258fa9d4f934af8777ab229d14dd4301201895b8 authored about 3 years ago by Todd C. Miller <[email protected]>
Move preload_dso() to its own file and rename to sudo_preload_dso().

It now takes an intercept fd as an optional argument instead of a
list of extra variables to add....

9c3df47da9969958c8c352a0cfee9b8144ca4a6f authored about 3 years ago by Todd C. Miller <[email protected]>
Take control of the tty and save its settings before doing a policy check.

Otherwise the policy plugin won't be able to read the password.

60e76e3e3567880346de939f06d74ebe539cfaf3 authored about 3 years ago by Todd C. Miller <[email protected]>
Call the approval plugin after the policy plugin accepts a command.

Previously, for intercepted commands we only called the policy plugin.

42598735d007f6e7933243689e7c6e701b64c286 authored about 3 years ago by Todd C. Miller <[email protected]>
Reduce the number of function args passed to plugin wrappers.

This makes sudo_settings, user_info, submit_argv, submit_envp and
submit_optind global. This wil...

4ff3f7604dc2f59b50b8ec2d9299f82c3d85c131 authored about 3 years ago by Todd C. Miller <[email protected]>
Add return values for most of the plugin function wrappers that returned void.

Previously, they would just exit if there was an error.
Now the error is passed back up the stack...

840bf4b09df721ffc14ff3441abdaea651607cdd authored about 3 years ago by Todd C. Miller <[email protected]>
Implement sudo_intercept.so.

Uses protobuf to talk to main sudo process over a socketpair.

4cf3d1c416775c592433a40b25bd7d9fb0d69d1a authored about 3 years ago by Todd C. Miller <[email protected]>
Implement the sudo side of the sudo_intercept.so communication.

d7380bb271c3dd02bd4f38d5f9989931cb6f19b6 authored about 3 years ago by Todd C. Miller <[email protected]>
Define protocol for sudo <-> sudo_intercept.so communication.

Uses google protocol buffers.

cede7dd92dec7e0290ded3ae3e0d66b97f33265c authored about 3 years ago by Todd C. Miller <[email protected]>
Add separate convenience lib for protobuf-c

We need to use it for sudo <-> sudo_intercept.so communication.

5d4120fa5d908689a55a85564dd76f5af3e153c8 authored about 3 years ago by Todd C. Miller <[email protected]>
Allow multiple accept/reject messages during a logsrv conversation.

The log server now advertises a subcommands flag if it supports
logging subcommands (e.g. command...

9d776b4e7b4d87882d11480219011ce0a6ccedd7 authored about 3 years ago by Todd C. Miller <[email protected]>
Use run_argv and run_envp passed into the audit plugin for event logging.

Previously we used NewArgv[] and env_get() but now that logging is
performed via an audit plugin ...

1ae9954c635c31b28e4e23c6ed257b457836b038 authored about 3 years ago by Todd C. Miller <[email protected]>
Allow set_perms(PERM_INITIAL) to be called more than once.

If the perm stack depth is non-zero when set_perms(PERM_INITIAL)
is called, rewind it first and r...

5e3ce532fe05cab42a2fa55d1249d992d772de3b authored about 3 years ago by Todd C. Miller <[email protected]>
Make it possible to call the sudoers policy check function multiple times.

We need to reset the Defaults values to their original state.

132936f8f0a4cc6daaa74699e42bd0534eb5e031 authored about 3 years ago by Todd C. Miller <[email protected]>
Allocate a socketpair to communicate with sudo_intercept.so over.

This is used for the intercept and log_children options.

a556b373c989bec2b7268715585c7f641c28a999 authored about 3 years ago by Todd C. Miller <[email protected]>
Add support for loading the sudo_intercept.so DSO.

6287e8ca7d3295c6f123b0fed84ddd5a0cd4891a authored about 3 years ago by Todd C. Miller <[email protected]>
Add "intercept" Defaults setting to allow interception of sub-commands.

This causes "intercept" to be set to true in command_info[] which
the sudo front-end will use to ...

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