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

The set_sc_arg3, get_sc_arg3 and set_sc_arg4 functions are not used.

Use ifdef notyet to disable for now since they may be used in the
future.

161a97260084ffe306aeccb9565345f0464c6128 authored over 2 years ago by Todd C. Miller <[email protected]>
Use __x86_64__ preprocessor symbol, not __amd64__

Also clarify a comment about MIPS ptrace.

0bfbef0169a6f1bfef7c1808ca2248e520f3c6c4 authored over 2 years ago by Todd C. Miller <[email protected]>
ptrace support has been tested on Debian/s390x.

It should also work on s390 but this has not been tested.
I have not added a compat mode to trace...

7329a4a8646435b8ce25d55d307a435fd5fc1e24 authored over 2 years ago by Todd C. Miller <[email protected]>
Define sudo_pt_regs instead of user_pt_regs and include the struct keyword.

On s390, the struct is typedef'd without a name.

2eb8ff17be0d028cc44aaaca0a74eb75a6151305 authored over 2 years ago by Todd C. Miller <[email protected]>
ptrace support has been tested on Debian/riscv64.

74c6353a84bd9995e529621726e3abfd1db68e63 authored over 2 years ago by Todd C. Miller <[email protected]>
Add maxseq setting to log_output example.

This should make it more obvious that you need to adjust maxseq
unless you have (virtually) unlim...

906eb19ece47023c659b4b3db2e7a6bb57dff0d9 authored over 2 years ago by Todd C. Miller <[email protected]>
Fix dependency check for libssl on Debian/Ubuntu with OpenSSL 3.

Also add check for python 3.10 and 3.11 and remove versions < 3.4.
Fixes building on Ubuntu 22.04.

b61a55eb1be4feaba503670cf80adc6e5c5f3554 authored over 2 years ago by Todd C. Miller <[email protected]>
Tracing 32-bit arm binaries from a 64-bit sudo works.

55bd6272c0bbd4d09ef0804b8713ed7522e7cefa authored over 2 years ago by Todd C. Miller <[email protected]>
ptrace_write_string: the terminating NUL fix was reverted by mistake.

3238c43f92e84f8dbde52099920238306646c5db authored over 2 years ago by Todd C. Miller <[email protected]>
ptrace-based intercept has now been tested on 32-bit arm

cb95b75ffac5a8427c4d2d74742b47ba1a57a40f authored over 2 years ago by Todd C. Miller <[email protected]>
Don't use PTRACE_SET_SYSCALL for 32-bit arm binaries running on aarch64.

Use PTRACE_SETREGSET with NT_ARM_SYSTEM_CALL instead just like we
would for a 64-bit binary. New...

bb3c4ba07ce0b66c594c935cfa9608caf3a18365 authored over 2 years ago by Todd C. Miller <[email protected]>
Replace verbose flag with debug flag.

This is more accurate since it actually uses the debug subsystem.

6a196190cf96f79c09b4bed5d5972bd58ceb4bd3 authored over 2 years ago by Todd C. Miller <[email protected]>
Initial cut at MIPS support, untested.

Mips is a bit different in that most Linux distros appear to use
the n32 ABI on 64-bit CPUs. We ...

3226c2df40a96266a11590c933608d26b56e99c4 authored over 2 years ago by Todd C. Miller <[email protected]>
Add have_seccomp_action("trap") call to check for SECCOMP_MODE_FILTER.

f4cc99c0633d3e64361e47478dce3cd650302c79 authored over 2 years ago by Todd C. Miller <[email protected]>
Add arm-specific code to set the system call number.

Fixes rejection of commands due to policy on arm when in intercept mode.

b99debf92f590200a441b215fb8546c6ae6fdaab authored over 2 years ago by Todd C. Miller <[email protected]>
Fix OS major version detection on CentOS Stream

4a7d26c38114db5b6dd8321f38d6564b7a94cc30 authored over 2 years ago by Todd C. Miller <[email protected]>
Repair ptrace_write_vec() for compat binaries.

4ecada04a496effbd8b4ce173cbf72405d5c8ff0 authored over 2 years ago by Todd C. Miller <[email protected]>
Fix a crash when not run in verbose mode.

0f104d2ff126ef83044be5a237c409d8163e042c authored over 2 years ago by Todd C. Miller <[email protected]>
ptrace_intercept_execve: read back the updated syscall args in test mode.

This makes it easier to detect problems with the syscall rewrite code
when testing with test_ptrace.

ea2bf7f1f2489fa73ce0b0ae15da66d28b5caefe authored over 2 years ago by Todd C. Miller <[email protected]>
Move code to write a string vector to ptrace_write_vec().

64aba8f88eab9131f6e16365727fcdef316d3c2d authored over 2 years ago by Todd C. Miller <[email protected]>
Enable ptrace intercept on powerpc.

Tested on ppc64 and ppc64le.

31e8506c822bd8ae90aa983d2d247f3b266d0f90 authored over 2 years ago by Todd C. Miller <[email protected]>
Fix tracing compat binaries on big endian systems.

We need to swap the order of the two 32-bit addresses for big-endian.

55f5e389ba21710bc6b36e58b534ae198864cedb authored over 2 years ago by Todd C. Miller <[email protected]>
Fix compilation error on systems with no compat arch.

Currently only affects i386.

f94e5d40db1cf9c8d67d839d26199291a5169379 authored over 2 years ago by Todd C. Miller <[email protected]>
Add test_ptrace program to test ptrace-based intercept support.

040e75a07b49acf8b37cb5cc3d49ce14690ae796 authored over 2 years ago by Todd C. Miller <[email protected]>
Use unsigned long for addresses so we don't have to worry about sign extension.

532e8218b29efad9bf5a05b017563647445a3a5c authored over 2 years ago by Todd C. Miller <[email protected]>
ptrace_write_string: make sure we always write the terminating NUL.

We can't check *str for NUL since it may not have been written yet.

6cd461d9f89cca12df5f7311afc182bc432b036c authored over 2 years ago by Todd C. Miller <[email protected]>
Fix compilation error when SECCOMP_AUDIT_ARCH_COMPAT is not defined.

8fe1238679faf7ceba205323a4cce687c88d2165 authored over 2 years ago by Todd C. Miller <[email protected]>
It is now safe to make WORDALIGN use compat (not native) aligment.

We allocate space for an extra pointer between argv and the string
table for compat binaries so t...

a40d62b3d55fd5aca06843c9a3f4a7f437f38759 authored over 2 years ago by Todd C. Miller <[email protected]>
Use the entire word in ptrace_get_vec_len() and ptrace_read_vec().

For compat binaries, use the upper 32-bits as the next word instead
of calling ptrace(2) to get i...

f82aa334ccae85eb8f4c1134eddcc363b8e16402 authored over 2 years ago by Todd C. Miller <[email protected]>
We don't need to align strings in the string table.

We align the start of the string table to a word boundary to help
prevent overlap when writing th...

c9a481506d52cb50540f77f88cc0bd2f7eb9914a authored over 2 years ago by Todd C. Miller <[email protected]>
Avoid potentially overwriting string table when writing argv.

In compat mode, if argc is odd, writing the last pointer of argv will
overlap with the address of...

206cd10ed5df8e87eeec12290f5b965e397dad61 authored over 2 years ago by Todd C. Miller <[email protected]>
Use native word size for padding and when reading/writing strings.

If we try to use the compat word size we can end up in a situation
where a subsequent PTRACE_POKE...

a15ca9c85b5f3cc1897b7fd0c5dfe3ed9bfc3c9b authored over 2 years ago by Todd C. Miller <[email protected]>
ptrace_intercept_execve: rewrite path to exec if changed by the policy

0a2975367ec35255dbfff39dfc59de3e9211d078 authored over 2 years ago by Todd C. Miller <[email protected]>
ptrace_intercept_execve: plug memory leak of get_execve_info() buffer

339746730c535a0f52d0ad460d46472355b851fc authored over 2 years ago by Todd C. Miller <[email protected]>
Move register definitions to exec_ptrace.h

35ea534b3eecf608150f51450fc9a66bcd7b36b6 authored over 2 years ago by Todd C. Miller <[email protected]>
Add support for intercepting 32-bit binaries on 64-bit systems.

We need to define the ptrace register struct ourselves for the
32-bit system since there is no go...

d3a1bf4216990da710999d0c679d116dc82175eb authored over 2 years ago by Todd C. Miller <[email protected]>
Add setters and getters for ptrace(2) register access.

This will be used when running 32-bit binaries from a 64-bit sudo.

de678ba775fe9e5079a45d240551c35d9e93f8a6 authored over 2 years ago by Todd C. Miller <[email protected]>
exec_ptrace_handled: don't return early if ptrace_intercept_execve() fails.

We need to continue the traced process even if there is a fatal
error. Otherwise, sudo will appe...

f53053a66f386e07af2dd9f9c10887ead62e2a47 authored over 2 years ago by Todd C. Miller <[email protected]>
Don't use PTRACE_GETREGS, it is too complicated when runing compat binaries.

Unlike PTRACE_GETREGSET, PTRACE_GETREGS requires that we manually
map registers from 64-bit to 32...

bbbb6e2ace4ebc3b798cd66febb6f9c63a0815f1 authored over 2 years ago by Todd C. Miller <[email protected]>
Initialize intercept_allow_setid to true if we use ptrace(2) and seccomp(2).

4ab6a87b96a5ae7677e33893e1c71f73c1b0feb0 authored over 2 years ago by Todd C. Miller <[email protected]>
If the process is already being traced, just resume it and clear flags.

This makes it possible to run sudo in ptrace intercept mode from within
a shell (or other process...

e84fdd99fd07ee491659a9aff04726b290082de3 authored over 2 years ago by Todd C. Miller <[email protected]>
exec_ptrace_handled: fix delivery of non-stop signals.

We need to deliver signals to the tracee as long as it is not
a group stop. Fixes a hang while t...

cc52ab770c20ee9eee5065e8f390d0db95053c0b authored over 2 years ago by Todd C. Miller <[email protected]>
Make SIGCHLD handler more consistent with the pty version.

No real change other than a few debug statements.

4cac34b86d8e99d44456088b2d9a1913bb059ef4 authored over 2 years ago by Todd C. Miller <[email protected]>
sudoers_lookup_check: preserve intercepted flag when reinitializing cmnd_info

Otherwise we may not reject an attempt to run a set-user-ID command.

4d75b32799ef1d137b33fd703a7f1a258298573d authored over 2 years ago by Todd C. Miller <[email protected]>
Kill the command if intercept_setup() or ptrace_seize() fail.

3ee8bcefb084c06abb968db3fdb32d95eeb2aad9 authored over 2 years ago by Todd C. Miller <[email protected]>
Move intercept setid check out of do_stat() and into its own function.

For command_matches_all() we should only perform the setid check
if the file exists and intercept...

42117a1ce22745eb07eb1cff193892fe511dbff5 authored over 2 years ago by Todd C. Miller <[email protected]>
Add support for intercepting x32 binaries on Linux x64_64.

1d17415b69f9ad96cc20f27f5bd1206463bc44ed authored over 2 years ago by Todd C. Miller <[email protected]>
Sudo 1.9.11

4ac1237bd38a9722dd1913b8a93d3c1008bc997b authored over 2 years ago by Todd C. Miller <[email protected]>
Fix typos

307b4f69b88d63879c37bc75215f5834238740cd authored over 2 years ago by Todd C. Miller <[email protected]>
New Georgian translation from translationproject.org

77979932b151d68ccf199b564a6a782a90e90b37 authored over 2 years ago by Todd C. Miller <[email protected]>
Short-circuit the policy check if the command doesn't exist.

Otherwise, both sudo and the shell will report the error.

cdc35afff302494e953356fc415ba3ea460d51c2 authored over 2 years ago by Todd C. Miller <[email protected]>
For ptrace intercept mode, do not do a policy check for the initial command.

We can skip the policy check for the execve(2) of the initial command
since it has already been c...

52cacfc3027b6f19884dea41f15cdd59b6671d6a authored over 2 years ago by Todd C. Miller <[email protected]>
In ptrace(2) intercept mode, add execveat to the seccomp(2) filter.

This allows us to avoid logging the initial command twice regardless
of whether the kernel suppor...

4010d06ed05a6b47d202efe5bd86f7c77b67a7fd authored over 2 years ago by Todd C. Miller <[email protected]>
Suspend the child process and wait for SIGUSR when using ptrace.

This fixes a race condition in ptrace-based intercept mode when
running the command in a pty. It...

423fbedb655d36be5dd59fee692caccc731cba0c authored over 2 years ago by Todd C. Miller <[email protected]>
Enable intercept and log_subcmds for SELinux using ptrace and seccomp.

5d385b3c580d34555880e72afb92895c578d972f authored over 2 years ago by Todd C. Miller <[email protected]>
Update intercept documentation.

052d3d1d9155b6557239b2006a3d4fdf7957bf8f authored over 2 years ago by Todd C. Miller <[email protected]>
Check architecture in the seccomp filter.

Currently only supports the native architecture.

fe80dc0bc23a32257522d66ab6513200be8cfbf2 authored over 2 years ago by Todd C. Miller <[email protected]>
Add support for replacing argv in ptrace intecept mode.

The new argv is written below the tracee's stack and the system
call argument is replaced with th...

8e7ead57f61d3d14d76c37fdbfa686f3cc19bcf4 authored over 2 years ago by Todd C. Miller <[email protected]>
Use PTRACE_GETREGS/PTRACE_SETREGS on platforms that support it.

This has a better chance of working on things like user-mode Linux.

b75a8be34db509f9de8cee194a2b61eaf7a2320f authored over 2 years ago by Todd C. Miller <[email protected]>
Check the policy for ptrace-based intercept mode.

8e375445fb8165a7526f043b30073ffbb8b4f1b5 authored over 2 years ago by Todd C. Miller <[email protected]>
Add support for getting the execve(2) arguments via ptrace(2).

This will be used to perform a policy check in intercept mode.

3e73644cde7295fd704acc02d08ab1c7dd7d8e39 authored over 2 years ago by Todd C. Miller <[email protected]>
Add scaffolding for ptrace-based intercept mode.

01733a52140de846b95f494e80918ffd213052bd authored over 2 years ago by Todd C. Miller <[email protected]>
Stop using the WCONTINUED flag with waitpid(2).

We don't use it for anything other than a debug message and it will
cause problems when intercept...

46edc4e19823cbbfb83a0af8273f496e1d67110e authored over 2 years ago by Todd C. Miller <[email protected]>
Handle multiple child processes in the SIGCHLD handler.

This is required by the uncoming ptrace intercept code.

22866f24233e0f118ae2a870cec9487a21558ea7 authored over 2 years ago by Todd C. Miller <[email protected]>
sudo_logsrvd: update elapsed time for winsize and suspend in journal mode

Fixes a bug in store-first relay mode where the commit point messages
sent by the server were inc...

c7ed03c986beefa48201a4a9990d655eff1d6746 authored over 2 years ago by Todd C. Miller <[email protected]>
Fix typo; GitHub issue #144

72794ecd7595d8d1548f2c357007a69e1e8d5314 authored over 2 years ago by Todd C. Miller <[email protected]>
Expand section about expired accounts to include /etc/shadow info.

GitHub issue #143

c51b81fa53dd6d34e1300d2ead3f0ff479bf308d authored over 2 years ago by Todd C. Miller <[email protected]>
Add struct command details * to struct monitor_closure.

This will be used in the future by the ptrace intercept code.

d2da56dacc68a2c572c8ad1665dabf1a97d102df authored over 2 years ago by Todd C. Miller <[email protected]>
Translate "unable to set limit privileges" strings.

839c189373903e070a9cd45684b143daa24f2379 authored over 2 years ago by Todd C. Miller <[email protected]>
Remove ABOUT-NLS file, it is no longer maintained as part of GNU gettext.

Expand the Translations section in CONTRIBUTING.md.

c414a89eb35f8e4376384b0119e47dd0d497c8c7 authored over 2 years ago by Todd C. Miller <[email protected]>
Don't require a pty for intercept or log_subcmmds.

The code to take back control of the tty before a policy check
doesn't appear to be needed. If t...

841375783a46583caf0db6afa5fa32d475dc204a authored over 2 years ago by Todd C. Miller <[email protected]>
Define _TIME_BITS=64 on systems that define __TIMESIZE, like GNU libc.

This should be replaced by a specialized autoconf macro when one
becomes available.

ec5164ced227fc3e634dea614e7b999bb8266138 authored over 2 years ago by Todd C. Miller <[email protected]>
clean_output: prune lines that consisting of '^' characters and whitespace.

Starting with Python 3.11, backtraces may contain a line with '^'
characters to bring attention t...

930271847a71018c404443a4afe6dd22dcc1b26c authored over 2 years ago by Todd C. Miller <[email protected]>
Fix check for EVP_MD_CTX_new() when -pthread is in Libs.private.

a1e20ddd955736f9dc09149b5494c540183e5bfa authored over 2 years ago by Todd C. Miller <[email protected]>
Rename SSP_(C|LD)FLAGS -> HARDENING_(C|LD)FLAGS

dcb2fb26a5ca0bfac57e37aa57132b3720de745f authored over 2 years ago by Todd C. Miller <[email protected]>
Mention other hardening compilation and linker options.

4a8877bebece7d590e8d59c51fd4d78da400081a authored over 2 years ago by Todd C. Miller <[email protected]>
Fix check for EVP_MD_CTX_new using static libcrypto with dependencies.

90501b7000e3ba293c41dd707fa8aa5d504d9b30 authored over 2 years ago by Todd C. Miller <[email protected]>
Update to libtool 2.4.7.

cc4d7196ff5f697610707ce6d40cbd75377c2621 authored over 2 years ago by Todd C. Miller <[email protected]>
--enable-openssl: don't add non-existent directories to PKG_CONFIG_LIBDIR

c77cba373a7c23a4398980c229da1c42197b9385 authored over 2 years ago by Todd C. Miller <[email protected]>
Fix a typo in the AIX section.

dfd8ef293156010df03ee79d9e29869c416867f0 authored over 2 years ago by Todd C. Miller <[email protected]>
Update embedded copy of zlib to version 1.2.12.

Fixes CVE-2018-25032

5c0436f0b3f33296161b4465ef4492710e48c77d authored over 2 years ago by Todd C. Miller <[email protected]>
Minor style nit.

6af2b4188a4c053553b0d5bb762d009e72b1a15c authored over 2 years ago by Todd C. Miller <[email protected]>
Merge pull request #138 from dfskoll/main

If we're using Kerberos, don't overwrite a custom prompt

6143dcae97472bbda50925f8089cd63585edb593 authored over 2 years ago by Todd C. Miller <[email protected]>
If we're using Kerberos, don't overwrite a custom prompt if one was given with -p

Thanks to @thend20 for testing this patch.

11c6cdc02b8b889fe800d410f1e3e9a5d78ed815 authored over 2 years ago by Dianne Skoll <[email protected]>
Write the \r\n pair to ttyfp if possible, falling back on fp.

This is consistent with the vfprintf() call and fixes a problem
introduced by the last commit whe...

e2692f10953c389b71c4ca04bbdc44902760d929 authored over 2 years ago by Todd C. Miller <[email protected]>
Adjust starttime test when run under Debian faketime.

Bug #1026

75377139045da05b427b2797720c5d6f9335608b authored over 2 years ago by Todd C. Miller <[email protected]>
sudo_conversation_printf: convert trailing nl to cr + nl combo.

This fixes output when the terminal is in raw mode and is consistent
with how sudo_conversation()...

210875796d4b7db6ed7c9c968daa6b67594ae40a authored over 2 years ago by Todd C. Miller <[email protected]>
Block SIGCHLD when forking the mailer.

Otherwise, it may be picked up by the signal handler instead of our
waitpid(2) call.
Don't warn i...

de47380350722cbf4e43d973d6e6e83ebe70d5b2 authored over 2 years ago by Todd C. Miller <[email protected]>
Do not warn, log or send mail for errors when reinitializing defaults.

If there is a problem, we would have already warned, logged or mailed it.
The one exception is th...

ff173179887b5d7e64c5d7e4c177b929659ac07c authored over 2 years ago by Todd C. Miller <[email protected]>
If there are multiple parse errors, send them in a single mail message.

e5a50ae42975e17046e4f96adc538ed99cae20b0 authored over 2 years ago by Todd C. Miller <[email protected]>
Unset LANGUAGE when running tests, otherwise it may override LC_ALL.

Bug #1025.

1f64aca229e052d44a12cadd2ad265d01234ae12 authored over 2 years ago by Todd C. Miller <[email protected]>
Looser owner/permission checks for an uninstalled sudoers file.

We don't check the owner or permissions on a sudoers file that is
specified as an argument to vis...

ef4ce5c08a5f5c19398d9ce0db2972cdfea2f29f authored over 2 years ago by Todd C. Miller <[email protected]>
getdelim_test: increase longstr to check end pointer after realloc

This would have caught the recent bug in our getdelim replacement
when run under address-sanitize...

b2a32f95ee109d3b26d65c300516a94861cd236c authored over 2 years ago by Todd C. Miller <[email protected]>
Add missing va_start/va_end around call to sudoers_error_hook().

Coverity CID 250885

8e7c004c7ffd78ccde68abdb7e4071ab403bd169 authored over 2 years ago by Todd C. Miller <[email protected]>
Correctly update the end pointer when we expand the buffer.

From Robert Manner.

c48c511e9113d47bd5c7b4f48a217545ffd33b66 authored over 2 years ago by Todd C. Miller <[email protected]>
sudo_secure_path: pass the struct stat * argument directly to stat(2)

Set the pointer to a struct stat on the stack if st is NULL.
Avoids a needless memcpy() at the end.

6ff33922f4bc24bf003f25aae85abcb4ff7a5330 authored over 2 years ago by Todd C. Miller <[email protected]>
Fix off-by-one when storing line number in userspec.

We store the line number *after* parsing the newline so we need to
subtract one.

8dae0ba06c73a6b4f56f2f86f38b7030d8ed9764 authored over 2 years ago by Todd C. Miller <[email protected]>
For alert messages, the command or runuser may not be set.

This fixes the logging of parse errors when JSON logging is enabled.

eb2803c3e936fc5c9114657019f2d87148ecd101 authored over 2 years ago by Todd C. Miller <[email protected]>
Pass file, line and column to sudoers defaults callbacks.

65e5b89f1d1f450dfadd1aecf12e441b20e7ecb1 authored over 2 years ago by Todd C. Miller <[email protected]>
Add a hook for sudoers parse errors (including defaults and aliases).

The hook can be used to log parser errors (sudoers module) or keep
track of which files have an e...

d7ddff2a312de9780693390d0262c747648a9403 authored over 2 years ago by Todd C. Miller <[email protected]>