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

get_user_info: pass sudo_get_ttysize() the fd of /dev/tty, not stderr.

Both the plugin API and the main event loop expect lines/cols to
refer to the user's terminal, so...

d1912957aed41b8fc31a9ff5a93d8e1a9c4b7106 authored over 1 year ago by Todd C. Miller <[email protected]>
Add an fd argument to sudo_get_ttysize() instead of always using stderr.

For sudoreplay we open /dev/tty, so use that instead of stderr when
determining the terminal size.

cc22cca34fb8899c86c5d2f7a9c81bb8e06c8594 authored over 1 year ago by Todd C. Miller <[email protected]>
Check whether stderr is a tty before trying TIOCGWINSZ.

5650b436e6ba20807758a4154e709c10c1c87be8 authored over 1 year ago by Todd C. Miller <[email protected]>
Use -no-undefined on macOS to avoid "-undefined dynamic_lookup" warnings.

Starting with macOS 13, the linker warns when "-undefined dynamic_lookup"
is used. This is adde...

ae12d18ff04c3b242c2790a937659cfd68649947 authored over 1 year ago by Todd C. Miller <[email protected]>
Add make to Dockerfile and sort packages.

62a2d9f94c3455e5bd53d6844e1137d8de20e144 authored over 1 year ago by Todd C. Miller <[email protected]>
Enable the use_pty option by default for sudo 1.9.14.

GitHub issue #258

894daa88f66a69d3c6fe4d2255183d4c0b33a464 authored over 1 year ago by Todd C. Miller <[email protected]>
Split up the monolithic sudoers_policy_main() function.

This splits the code to find the command, perform a sudoers lookup,
ask for a password as needed...

d7b8f3ffbf278ba87946851f8d8c1b21e3fe4818 authored over 1 year ago by Todd C. Miller <[email protected]>
Move the root_sudo check until after we apply per-command Defaults.

It is possible, though unlikely, for "root_sudo" to be used in
a per-command Defaults statement.

859a81ad241240b68443bb630b7f124fa44d0588 authored over 1 year ago by Todd C. Miller <[email protected]>
sudoers_policy_main: restore locale if sudoers_lookup() fails.

Previously, if sudoers_lookup() set VALIDATE_ERROR, the sudoers
locale would still be in effect ...

ab4b94716900d17ee0f022c1aba6c840f0628804 authored over 1 year ago by Todd C. Miller <[email protected]>
sudoers_lookup_pseudo: remove validated function argument

This was always set to FLAG_NO_USER|FLAG_NO_HOST which are cleared
at the top of the fuction. M...

fb0a36c1a5db4295c3ae7ea0c0d2e4d8077e4bba authored over 1 year ago by Todd C. Miller <[email protected]>
The I/O log file name is not just the basename of the full iolog_path.

The audit plugin already has the correct value for iolog_file, don't
overwrite it with basename(i...

0a4c8872a804e581e3f4a20b614882fbbafefd71 authored over 1 year ago by Todd C. Miller <[email protected]>
Warn with "unknown user" not "unknown uid" if user cannot be resolved.

Prior to sudo 1.8 this was after a getpwuid() but now we use
getpwnam().

ac12f82d86b5134a5d108ad739a3656715c60f57 authored over 1 year ago by Todd C. Miller <[email protected]>
Set timestamp_uid and timestamp_gid via a callback.

This also makes it possible to include the location of the line in
the sudoers file in the warnin...

ad890acf6c63fc19ffcd8c236e3a99d9cec1b649 authored over 1 year ago by Todd C. Miller <[email protected]>
Fix display of escape sequencees in ldapsearch example.

493b2441d4ea84f53f018ddae9dbca0a9d45de85 authored over 1 year ago by Todd C. Miller <[email protected]>
White space is not allowed between Defaults and '@', ':', '!', '>'.

The EBNF made it appear that this is allowed when it really is not.

3b55de4e832b537242f988f3cd3723ecbb493423 authored over 1 year ago by Todd C. Miller <[email protected]>
Make struct {command,user}_details pointers const where possible.

f0030cf30f10a4645eaf034cea2aee82b575f400 authored over 1 year ago by Todd C. Miller <[email protected]>
Make user_details private to main.

554397eaeaf68b8251e325bda98db7e0ef920759 authored over 1 year ago by Todd C. Miller <[email protected]>
Make user_details private to sudo.c.

5108c279afe9dd098f1595f9cc3b5d6581db02de authored over 1 year ago by Todd C. Miller <[email protected]>
Regenerate with the autoconf 2.72c snapshot.

f95c9f839c8d80f504856ec005a44815b73ccc32 authored over 1 year ago by Todd C. Miller <[email protected]>
Use sudo_get_ttysize() in help() and usage().

This eliminates a dependency on the user_details global.

e435b158b81fb5c2c500498e8b434c35781aaf35 authored over 1 year ago by Todd C. Miller <[email protected]>
Store submitcwd (from user_details) in struct command_details.

This eliminates use of the user_details global from exec_setup().

86002226b65286ba1bd8fec12e73a900e240970b authored over 1 year ago by Todd C. Miller <[email protected]>
utmp_fill: user is now always non-NULL, no need for user_details.

51453c4f2e844bbc80c818e23c7a5f6324ace273 authored over 1 year ago by Todd C. Miller <[email protected]>
Remove list_user global.

fa5a28f34517bde2124afc264ec56af3762103f2 authored over 1 year ago by Todd C. Miller <[email protected]>
No need to declare tgetpass_flags, it is already in sudo.h.

a5b11a58b7f74701b1c5ebcc3103339047715cfd authored over 1 year ago by Todd C. Miller <[email protected]>
No need for sudo_mode to be global anymore.

9fd787343d24e633023b490ab0798dc3705a393d authored over 1 year ago by Todd C. Miller <[email protected]>
Make command_details private to main().

11277bb921d98efb0a33e8604e135a7970d921bb authored over 1 year ago by Todd C. Miller <[email protected]>
Make iobufs private to exec_iolog.c.

8d2b9a43431127110b8c5c179b76586c79aa7eae authored over 1 year ago by Todd C. Miller <[email protected]>
Remove ttymode and its associated values.

ee3f99c88c9d897eafd7f739e80fe597c48e8650 authored over 1 year ago by Todd C. Miller <[email protected]>
Move ptyname to struct exec_closure

f9b1beced260f9ebb0d9087e4e1f37212eee3dee authored over 1 year ago by Todd C. Miller <[email protected]>
Move pty_make_controlling() to exec_monitor.c where it is called.

We can use details->tty to access the pty follower path.

22776b0be6ae1a5233bc31b829a5dd064f4431ec authored over 1 year ago by Todd C. Miller <[email protected]>
Eliminate utmp_user global, just use the value in struct command details.

7ac9ce001cf898a7db28d41e704a821b801b083c authored over 1 year ago by Todd C. Miller <[email protected]>
Replace tty_mode global with term_raw flag in struct exec_closure.

The pty_cleanup hook needs access to the closure so add
pty_cleanup_init() to store a pointer to...

778688d4fc2f9913d25a6607c9e8582efb8252d5 authored over 1 year ago by Todd C. Miller <[email protected]>
Register pty cleanup function in exec_pty(), not exec_cmnd_pty().

We want it to execute in the main sudo process, not the monitor.

b81c5e8dac64dbf43555ae4569704d00bd64ac00 authored over 1 year ago by Todd C. Miller <[email protected]>
Make ttyblock private to exec_iolog.c

11739e3defab1cf3cfac268405101e54057ab6f2 authored over 1 year ago by Todd C. Miller <[email protected]>
exec_pty.c: move foreground flag to struct exec_closure.

Also make pipeline flag private to exec_pty() and remove the unneeded
check_foreground() prototype.

3303dd98c03b30f2c8187aed38e863907bc16fc0 authored over 1 year ago by Todd C. Miller <[email protected]>
On resume, always sync the pty terminal settings with /dev/tty.

Changes made to the terminal settings while the command is suspended
are now reflected in the pt...

51cdb194b88ebde21b5f90b2d77c36588fb0f0b4 authored over 1 year ago by Todd C. Miller <[email protected]>
Correct a comment.

3e734fa51b64c22290e654340af0ec1e14a2233d authored over 1 year ago by Todd C. Miller <[email protected]>
GitHub sponsor settings.

2a5d8bfea1928da3f613abf03c779f6168b91220 authored over 1 year ago by Todd C. Miller <[email protected]>
Use built-in tests for bit types instead of using AC_CHECK_TYPES.

This should be more portable as it handles the quirks of some older
systems.

f0f5e1b5bc8bf841d42e9a0278463c13e9f6ea43 authored over 1 year ago by Todd C. Miller <[email protected]>
Quiet compiler warnings on systems where pid_t is not an int.

Historically, pid_t was a long on some 32-bit systems like Solaris.

a17491972b1a98b32a4df90fe2e67e0872089d2b authored over 1 year ago by Todd C. Miller <[email protected]>
Silence "used uninitialized" false positives with older gcc versions.

775059156fd8bd9505d6c2dc0446fa9a72702b08 authored over 1 year ago by Todd C. Miller <[email protected]>
exec_pty: always copy the terminal settings from /dev/tty the pty.

Previously, we only did this when running in the foreground but
this can cause problems when runn...

9d55ae892f82a792fffccf6ec902d3f452807bb2 authored over 1 year ago by Todd C. Miller <[email protected]>
check_foreground: use SFD_LEADER not SFD_FOLLOWER (which was closed).

Also use SFD_LEADER for sudo_term_copy() in exec_pty() for consistency.
From Duncan Overbruck.

98ec786b44fa6a09c3dae2c56850078f82418007 authored over 1 year ago by Todd C. Miller <[email protected]>
suspend_sudo_pty: fix cut & pasto in last commit to catch SIGCONT.

Also set sa.sa_handler to SIG_DFL instead of SIG_IGN. There is no
difference for SIGCONT but it ...

acbe617fb4e4c6539470bdf63fe255225811ef03 authored over 1 year ago by Todd C. Miller <[email protected]>
Catch SIGCONT and restore terminal settings on resume from SIGSTOP.

While we cannot catch SIGSTOP, we _can_ catch SIGCONT and set
/dev/tty to raw mode when running i...

0fcbcaede01549ddabecc855732236d3473a96fa authored over 1 year ago by Todd C. Miller <[email protected]>
Only convert a signal number to a name if we are going to use it.

It is mostly used for debug logging.

1772fc7b660b33e264fe3459745db3ed04793255 authored over 1 year ago by Todd C. Miller <[email protected]>
Move updating of the window size back to the main sudo process.

We can use the leader file descriptor with TIOCGWINSZ to set the
window size of the pty. Thanks ...

adb84293abfc1c3349ab34c03b036f1756e89aca authored over 1 year ago by Todd C. Miller <[email protected]>
visudo: restore controlling terminal after running the editor.

Otherwise, visudo will get SIGTTOU if it tries to write to the
terminal after the editor finishes...

c64993a0b34c392ed0c369a6790d9bf5574dab50 authored over 1 year ago by Todd C. Miller <[email protected]>
Warn about ignored files in sudoers.d in visudo.

28ecbe4d519970d3ccf8fef1a69800773c0c50fc authored over 1 year ago by Todd C. Miller <[email protected]>
Replace sudoers_warnings with sudoers_verbose.

This is now an int, with values > 1 reserved for visudo.

8049e4e32f81424b01ac9c83eacefc3de3640ef5 authored over 1 year ago by Todd C. Miller <[email protected]>
Split push_include() into push_include() and push_includedir().

This moves the "isdir" function argument to the internal version.

738387aa4d38cb02da9c97aa2effed8ce88afeef authored over 1 year ago by Todd C. Miller <[email protected]>
Pass around const struct sudo_nss pointers where possible.

4b563ea44f98e6d0acd5b0c43c71ef043ac47885 authored over 1 year ago by Todd C. Miller <[email protected]>
Pass around const struct sudoers_parse_tree pointers where possible.

1f19a6b72bb26f8e86a84c8d4b2269b55d05483b authored over 1 year ago by Todd C. Miller <[email protected]>
Move non-config-related macros to from sudo_ldap_conf.h to sudo_ldap.h.

70c533ec79d3320152a73e5927f10f767831254e authored over 1 year ago by Todd C. Miller <[email protected]>
Remove portable getcwd.c, nothing uses it anymore.

Any operating system supported by sudo already includes getcwd(3).

f5d0b7abf74e35040c0918489c9576348531409e authored over 1 year ago by Todd C. Miller <[email protected]>
Use LIBPROTOBUF_C and LIBUTIL variables and use them.

f2f233336e32dfea2464836d64af1e4e737d21b4 authored over 1 year ago by Todd C. Miller <[email protected]>
Remove now-unused sudo_timeval* macros.

14dd995b8933c85336bead108b374030e959d6eb authored over 1 year ago by Todd C. Miller <[email protected]>
nanosleep: clear remainder on successful completion

Also switch to doing everything in terms of struct timespec except
for the actual select(2) call.

708cdc61ba169c701c581a9cd3d8132948f2d96c authored over 1 year ago by Todd C. Miller <[email protected]>
Add lib dependencies for fuzzer and test targets.

3f5e7df3cd0399b48f0f19ad3099d9cd793cf5ee authored over 1 year ago by Todd C. Miller <[email protected]>
eventlog_free: free peeraddr

7683ba1b889f7a97512bd8dcf67ede86b966878c authored over 1 year ago by Todd C. Miller <[email protected]>
sudo_ldap_netgroup_match_str: "-" in a netgroup can never match.

We already check for a NULL value above so "str == NULL" is always
false. Found by PVS-Studio.

b965d222d8d0442ea0aa7e45e5a56296c833472a authored over 1 year ago by Todd C. Miller <[email protected]>
Fix static compilation.

027b42d5a6588b76f2e00a376aa04c931caec4f0 authored over 1 year ago by Todd C. Miller <[email protected]>
Replace eventlog_json.h with parse_json.h.

33cb885cf6f1c265a5c26a936f30948c9c0ca03a authored over 1 year ago by Todd C. Miller <[email protected]>
Add support for parsing all fields of struct eventlog.

0f46ffa9f1c5b56616673e3962967c7506440494 authored over 1 year ago by Todd C. Miller <[email protected]>
Add tests for JSON and sudo-style log output.

1b3991b7179b8dfd79414acd3d62ba89f3420a1c authored over 1 year ago by Todd C. Miller <[email protected]>
Declare domain even if the system lacks innetgr().

Fixes a build error on musl-based systems like Alpine.

d8e6396c55b9b4b127abc22da096e3ed03445bd8 authored over 1 year ago by Todd C. Miller <[email protected]>
Add missing definition of $(SED).

918af413f3d3ab21802aa66b14ea3a518bd84221 authored over 1 year ago by Todd C. Miller <[email protected]>
Move JSON log parsing from libsudo_iolog.la to libsudo_eventlog.la

It will be used in the upcoming log output tests.

86ab362fd49c2e5bf203c2073e306f9ec8f10532 authored over 1 year ago by Todd C. Miller <[email protected]>
Add missing " ; " separator between environment variables and command.

This is a regression introduced in sudo 1.9.13.
GitHub issue #254.

12648b4e0a8cf486480442efd52f0e0b6cab6e8b authored over 1 year ago by Todd C. Miller <[email protected]>
Add example to verify support for searching by nisNetgroupTriple.

24f04c8cb37946510fa37d0bf68aa2b3e1ea7136 authored over 1 year ago by Todd C. Miller <[email protected]>
Remove unused sudoers_gc_init() function.

34933ef9d0046b8095633b3d88ef1dc8817a707d authored over 1 year ago by Todd C. Miller <[email protected]>
Sudo now does its own netgroup lookups if NETGROUP_BASE is set.

Previously, it only performed netgroup queries to determine the
list of netgroups a user was a me...

916d8b47c16fbd366c9ac3225bb0e2c237324875 authored over 1 year ago by Todd C. Miller <[email protected]>
sudoers_cleanup: free cached environment before running g/c.

Avoids a double free in fuzz_policy.

c76ac1cab37532672462267984fb7b0b994f180a authored over 1 year ago by Todd C. Miller <[email protected]>
sudoers_cleanup: run the garbage collector at the end

cd5cd45336ea3077b7a9639c9489549d0284193c authored over 1 year ago by Todd C. Miller <[email protected]>
Plugin a memory leak in intercept mode.

c09aabecdc898c074813aebb0a8900418aa3ae9e authored over 1 year ago by Todd C. Miller <[email protected]>
Sync non-intercept version of intercept_cleanup() declaration.

d5a7844423afad3faa8efa55e292fef741584c29 authored over 1 year ago by Todd C. Miller <[email protected]>
Plug memory leak if ldap_get_option() fails with LDAP_NO_MEMORY.

33c385a78e657e1429435650f98efef18ad82cf2 authored over 1 year ago by Todd C. Miller <[email protected]>
Plug a memory leak with ptrace-based intercept.

c61306e583e878a72cda618235b11605b7904003 authored over 1 year ago by Todd C. Miller <[email protected]>
Plug memory leak when log_subcmds is enabled.

31dad6b179d24e9aa9cc2e39f731c8aa960e13f6 authored over 1 year ago by Todd C. Miller <[email protected]>
Pass closure to callback, not the callback pointer itself.

cb7b1dd89c4c74911ea59c592c166ba0174830bf authored over 1 year ago by Todd C. Miller <[email protected]>
Add LDAP-specific innetgr() implementation.

Wheh netgroup_base is set we now do out own netgroup lookups using
LDAP. Previously, LDAP was qu...

fc253048f5bc3f3459830615745c54cc74af250c authored over 1 year ago by Todd C. Miller <[email protected]>
Move some functions from ldap.c to ldap_util.c.

These will be used by the LDAP innetgr() implementation.

554df8d934484bfba92b520d53f347650facb4f9 authored over 1 year ago by Todd C. Miller <[email protected]>
fix typo in uninstall target

d2582c2cdb0d819c5a318184113e545ab161424a authored over 1 year ago by Todd C. Miller <[email protected]>
Merge pull request #252 from bin-ly/main

fix typo in uninstall target

954980b566660b0c58b1c1887d9a65e5c27552ce authored over 1 year ago by Todd C. Miller <[email protected]>
fix command error for lib/util/Makefile.in

ec255dca1e5a10eb818fbc664d64e2b07a56ed1e authored over 1 year ago by bin-ly <[email protected]>
Add per-source innetgr function pointer and use it in netgr_matches().

This will be used to implement LDAP-specific netgroup lookups when
netgroup_base is set in ldap.c...

0aad96bba1cbda283a7eac81b7c395d61bb19c67 authored over 1 year ago by Todd C. Miller <[email protected]>
Add tests for SHA2 digest support.

This uses the NIST byte-oriented short message test vectors.

dea110a8486283baf0a4eeb6c4a3a58173e4816c authored over 1 year ago by Todd C. Miller <[email protected]>
Sudo 1.9.13p3

0df56634c3deabb4049cd1bbe0fe3bc95c797926 authored over 1 year ago by Todd C. Miller <[email protected]>
A user with "list" privs for root may not list all users.

A user with "sudo ALL" for root _is_ allowed to list any user.

689022978c15e1ecdb7410855dd46d070118b204 authored over 1 year ago by Todd C. Miller <[email protected]>
sudoers_policy_list: do not set runas_pw to list_pw when listing

This change introduced in sudo 1.9.13 is not actually needed. The
"list" pseudo-command checks a...

452d63d6c1a778466723a9a38c9053f99b53f7f5 authored over 1 year ago by Todd C. Miller <[email protected]>
Fix "sudo -l command args", broken in sudo 1.9.13.

The value of user_args should not contain the command to be run in
"sudo -l command args", only t...

d9e9307d98ffdba6460225036451d379f3a24adb authored over 1 year ago by Todd C. Miller <[email protected]>
Check for sudo_pow2_roundup() overflow.

Calling sudo_pow2_roundup(INT_MAX+2) will return since there is no
power of 2 larger than INT_MAX...

b013711e489b917b80d73d42656b3bc05c26d3e7 authored over 1 year ago by Todd C. Miller <[email protected]>
write_callback: only enable /dev/tty reader if the command is running

This fixes a hang when there is /dev/tty data in a buffer to be
flushed by the final call to del_...

19a660612f02d24b3cede13f99643cc40ba2a0b3 authored over 1 year ago by Todd C. Miller <[email protected]>
Test non-fully qualified path name.

43378de75efccf4147c632312963782672556c33 authored over 1 year ago by Todd C. Miller <[email protected]>
Fix removal of y.tab.[ch] when generating gram.[ch].

7356a77969181e77a49a618bfcca86ffd83dc614 authored over 1 year ago by Todd C. Miller <[email protected]>
Add test for using "list" as user, runas and host.

172515c94d654f0abfbd99bfad1bb61eadfe7918 authored over 1 year ago by Todd C. Miller <[email protected]>
Move handling of the "list" pseudo-command from lexer to parser.

The special handling of "list" in the lexer meant it could not
be used as a user, group or host, ...

0197491e9c7969048d0e28c89d5ad725cfc83416 authored over 1 year ago by Todd C. Miller <[email protected]>
Make the check for HAVE_DECL_NSIG consistent with other decl checks.

6c97b84c0cb7809af423f7c371dd96999f410d8b authored over 1 year ago by Todd C. Miller <[email protected]>
Plug memory leak with multiple matching CHROOT= entries.

Found by oss-fuzz.

a4f31cff2b43cc0e5ad6b5c19ef5dd9a64bd883c authored over 1 year ago by Todd C. Miller <[email protected]>
Sudo 1.9.13p2.

f4d241262890f2b2213ebaf7ecc8540801c07d7a authored over 1 year ago by Todd C. Miller <[email protected]>