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

No need to set pass to NULL after freeing at the end of the loop

it since it is already set to NULL each time through the loop.

b9dde1480842eae87229a76ffc454776bd3a7171 authored over 8 years ago by Todd C. Miller <[email protected]>
SELinux fixes in 1.8.17.

67eb6dad0fa760734159e4dcbc66071a0e011cbb authored over 8 years ago by Todd C. Miller <[email protected]>
Check fprintf() return value in writeln_wrap() and return the number

of characters actually written, or -1 on error.

787912fa91fe1e549b527ee4f2653dd3776a8040 authored over 8 years ago by Todd C. Miller <[email protected]>
Check fputs() return value.

009f3e6456e2248b852cb15726e69a22888d817a authored over 8 years ago by Todd C. Miller <[email protected]>
Do not write directly to stdout/stderr, use sudo_printf which calls

the conversation function.

9d526c1af542d7913aef92d65810a4458e27acf6 authored over 8 years ago by Todd C. Miller <[email protected]>
Do not write directly to stdout/stderr, use sudo_printf which calls

the conversation function.

90fdb6a316f3795ee6f195146a21d97412de13ee authored over 8 years ago by Todd C. Miller <[email protected]>
Use ferror() after fflush() to check the error status of the stdio

stream we wrote to.

578af5af4d069e9daac94c2556a5004965347dee authored over 8 years ago by Todd C. Miller <[email protected]>
printf() returns < 0 on error, not explicitly -1

6d63ed8a92d19d3e89f019f3e190406e2f33fbd7 authored over 8 years ago by Todd C. Miller <[email protected]>
Regen for 1.8.17

7461dcf9a8da9555a619c570046db13e0efcf0ce authored over 8 years ago by Todd C. Miller <[email protected]>
Document that you need to preserve EDITOR and/or VISUAL for env_editor

to be useful.

d25500afa8b336a7159d47338c53493dea45c02c authored over 8 years ago by Todd C. Miller <[email protected]>
Fix last commit, now that argc is not reset we need to explicitly

start the copy from argv[1]. From Daniel Kopecek

a2085809fab3b0eb29f07f1763f0bedfcb6b60c4 authored over 8 years ago by Todd C. Miller <[email protected]>
cosmetic change to warning string

ea5bd18b9224ba8b722d4c92bc0e00592f2131a3 authored over 8 years ago by Todd C. Miller <[email protected]>
Avoid adding an extraneous warning string to sudoers.pot.

4f46e07209b24af2cea83739d4440ff17802405e authored over 8 years ago by Todd C. Miller <[email protected]>
Use EOVERFLOW, not ENOMEM for overflow conditions.

For snprintf() and vsnprintf(), POSIX says we should return -1 and
set errno to EOVERFLOW if the ...

e014159fe8955c61fa49c8a7428752b5094d6802 authored over 8 years ago by Todd C. Miller <[email protected]>
Now that pam_open_session() failure is fatal we should print and log

an error from it. Bug #744

b0be9895d966cdcf47bb76e33e363e90dd1a4fff authored over 8 years ago by Todd C. Miller <[email protected]>
Repair SELinux support, broken by 397722cdd7ec.

From Daniel Kopecek.

d3622b0f2c96fb57b9b60d168beff78c892dbb49 authored over 8 years ago by Todd C. Miller <[email protected]>
Remove sudo_mkpwcache() and sudo_mkgrcache(). We now create the

caches as needed on demand. Also remove calls to sudo_freepwcache()
and sudo_freegrcache() that ...

05db5aa3b885e00e9345ea5ed80e9f2a91c4c2fb authored over 8 years ago by Todd C. Miller <[email protected]>
Eliminate use of setpwent()/endpwent() and setgrent()/endgrent().

Sudo never iterates over the passwd or group file.
Rename sudo_set{pw,gr}ent() -> sudo_mk{pw,gr}c...

23d288563ec1f3812ff0a30e9bf6b87918b022c2 authored over 8 years ago by Todd C. Miller <[email protected]>
Remove unnecessary NULL checks in the RUNAS_CHANGED macro. The

only place where the pointers could be NULL is in visudo_json.c but
we already check for "next" b...

8b4de84049a3f836608382c16b77d7ca159aecc6 authored over 8 years ago by Todd C. Miller <[email protected]>
In replay_session() free iov at the end of the function (if needed)

instead of after processing each line from the timing file.
Coverity CID 104843.

398ddd0467e0ca07a1159b95ded94cf3a7074cd2 authored over 8 years ago by Todd C. Miller <[email protected]>
Add io_log_read() and io_log_gets() to hide differences between

gzread/fread and gzgets/fgets. Check for premature EOF and error
from io_log_read(). Also sanit...

e528cad7955cc9a341527e50854db53c66fa541e authored over 8 years ago by Todd C. Miller <[email protected]>
Break up io_callback() into read_callback() and write_callback()

to make it clear that we can't get an event with both read and write
set.

b04c49dbd312e2effdada1b3e9fcbd63eb26149c authored over 8 years ago by Todd C. Miller <[email protected]>
In io_callback() make sure we clear SUDO_EV_READ if we close the

fd. It should not be possible for SUDO_EV_READ to be set when
revent is non-NULL but this makes ...

094854adfee86565230b1a737ae50bef6840c640 authored over 8 years ago by Todd C. Miller <[email protected]>
In sudo_krb5_copy_cc_file() move the close(ofd) to the done: label

so we only have to cleanup in one place. Coverity CID 104577.

194c7c806975084abc36e539bb198b6fae45a15e authored over 8 years ago by Todd C. Miller <[email protected]>
Fix memory leak in sudo_netgroup_lookup() in the non-error case.

Coverity CID 104572, 104573, 104574, 104575.

0568fa90cf081116543d01358dc510809f28979e authored over 8 years ago by Todd C. Miller <[email protected]>
Fix fd leak in sudo_krb5_copy_cc_file() if restore_perms() fails.

Coverity CID 104571.

334b8f36a8f0195f1f10467888ff41946450ccc1 authored over 8 years ago by Todd C. Miller <[email protected]>
Free the events and event base before returning from replay_session().

Coverity CID 104116, 104117.

b84b2e6805b889486724d19efcab7bb01a50824d authored over 8 years ago by Todd C. Miller <[email protected]>
In sudo_edit_create_tfiles(), fix fd leak if sudo_edit_mktemp() fails.

Coverity CID 104114.

e99e3c26c855bd47d82a9b72f901e7d789453eeb authored over 8 years ago by Todd C. Miller <[email protected]>
Fix fd leak in sudo_edit_open_nonwritable() if dir_is_writable()

returns an error. Coverity CID 104113.

355cce4570c8c4cb6f1030c06a7360cbea44edd2 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix memory leak of sesh_args in selinux_edit_copy_tfiles().

Coverity CID 104112.

d733dd7783b6dae6615ab7155a45ff44f3466e79 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix memory leak in get_editor() if resolve_editor() fails with

an error. Coverity CID 104107.

bbda2e7b5b9e770c6022f6b3b2896c382ae2ff10 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix memory leak on error if sudo_new_key_val() fails.

Coverity CID 104103.

0f359e038c7ea34525c4673dfb07f803d4b264be authored over 8 years ago by Todd C. Miller <[email protected]>
Ignore the return value of the initial sudoersparse(), before

we have actually edited any files. Coverity CID 104078.

96f5fe4cd0b5df7ee5d7a44a20d49d3110d9c2ba authored over 8 years ago by Todd C. Miller <[email protected]>
Ignore the result of send() on exec error, if it fails the other

end of the pipe is gone and we are headed for exit.
Coverity CID 104066.

00727a310c6cbd849dd47bd6de83f60880451c8a authored over 8 years ago by Todd C. Miller <[email protected]>
In fill_args() clean up properly if there is an internal overflow

(which should not be possible). Coverity CID 104569.

edd1a1cac543576062bece45d94107c7b9701d98 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix logic inversion in sudoers_gc_remove(), currently unused.

Coverity CID 104568

0ecc6025a24c437d67176ac47f0c0187388493b5 authored over 8 years ago by Todd C. Miller <[email protected]>
In io_mkdirs(), change the order from stat then mkdir, to mkdir then stat.

This more closely matches what "mkdir -p" does.
Coverity CID 104120.

c56a812ea2f4800af1b2093bfc6f43f4badb3a76 authored over 8 years ago by Todd C. Miller <[email protected]>
In ts_mkdirs(), change the order from stat then mkdir, to mkdir then stat.

This more closely matches what "mkdir -p" does.
Coverity CID 104119.

602ed0c74794a3c05bbcbd90cd4fc49194842e54 authored over 8 years ago by Todd C. Miller <[email protected]>
Newer versions of Ubuntu have switched from using the "admin" group

to the "sudo" group to align with Debian. create_admin_success_flag()
now accepts either one.
ht...

5ee1e5bbcbd047a9bd0f9fd18434393e149498c0 authored over 8 years ago by Todd C. Miller <[email protected]>
Cast off_t printed via printf(3) instead of assuming it is long long.

7a86430d41d182285608afec26c9e31264088593 authored over 8 years ago by Todd C. Miller <[email protected]>
Instead of using stat(2) to see if the admin flag file exists and

creating it if not, just try to create the file and treat EEXIST
as a non-error. Coverity CID 10...

151e03fb5b51e3d4efd69c37d71bf62c91d3a7ba authored over 8 years ago by Todd C. Miller <[email protected]>
README file for the sample plugin that tells the user how to build,

install and enable it.

bb12328064153a5cd77154b10c9e27a040562013 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix compilation error and export sample_policy struct.

From Michael Evans

cc82c3193e1682161f00d9ab25a7fc534fb1e091 authored over 8 years ago by Todd C. Miller <[email protected]>
Update for 1.8.17

3b4f2bbfff5ad6eab450998194a4e8da81d50e11 authored over 8 years ago by Todd C. Miller <[email protected]>
Sudo 1.8.17

3b043207b24ff7e988bc45dda01290edd19ec13b authored over 8 years ago by Todd C. Miller <[email protected]>
Check return value of restore_perms() in vlog_warning().

Coverity CID 104079.

7b302e09aed3001d456b7744a5572a42f91a1d80 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix memory leaks in resolve_editor() in the error path.

Coverity CID 104109, 104110

b4cb1c0a1f0293c56b8421634fa0b5504d9dcd3b authored over 8 years ago by Todd C. Miller <[email protected]>
Fix memory leak of gid_list in sudoers_policy_exec_setup() in the

error path. Coverity CID 104111.

61c53c8e668f48e6841e70b14a20aea6747a263d authored over 8 years ago by Todd C. Miller <[email protected]>
Fix fd leak in do_logfile() if we fail to lock the log file.

Coverity CID 104115.

0690793c253c11a8a5c5f290ec56b434ea0571b3 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix memory leak of sss_result in sudo_sss_lookup()

Coverity CID 104106

7a5149d73891a5ff5c69a551ea62eb8ff4b44d27 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix fd leak in open_io_fd() if gzdopen/fdopen fails.

Coverity CID 104105

4bfdf0c2b410bfbe2a2dfc08abe174de0dfd3a91 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix fd leak in io_nextid() in error path.

Coverity CID 104104

444d2a5c3ef00f74a76cc8e1e4f1de79573c4789 authored over 8 years ago by Todd C. Miller <[email protected]>
Check lseek() return value.

Coverity CID 104061.

562b5cb59b57ff726adcb24a99f448e7330ea997 authored over 8 years ago by Todd C. Miller <[email protected]>
Ignore ts_write() return value when disabling an entry with a bogus

timestamp. We ignore the timestamp entry even it doesn't succeed.
Coverity CID 104062.

60e740dd60ab59c5d44284aea64db17dec341412 authored over 8 years ago by Todd C. Miller <[email protected]>
Cast the return value of fcntl() to void when setting FD_CLOEXEC.

Coverity CID 104063, 104064, 104069, 104070, 104071, 104072, 104073, 104074

6473d55aa7be4665f21cc29d2289fb5a482a1405 authored over 8 years ago by Todd C. Miller <[email protected]>
Cast the return value of fcntl() to void when setting FD_CLOEXEC.

Coverity CID 104075, 104076, 104077.

9471ec45a1452bf2de3581675bc7ea7fbd33093f authored over 8 years ago by Todd C. Miller <[email protected]>
Avoid a false positive. Coverity CID 104056.

a7fa036d4273f9a1c653cc4675a8b113bf233c58 authored over 8 years ago by Todd C. Miller <[email protected]>
Avoid calling fclose(NULL) on error in export_sudoers().

Coverity CID 104091.

c0a3c6bb9dca588f999992d9b4ea1deccd513d27 authored over 8 years ago by Todd C. Miller <[email protected]>
In fill_args(), check for "arg_size == 0" instead of

"sudoerslval.command.args == NULL" since the latter leads Coverity
to imply that sudoerslval.comm...

a09e45d339c79deb074a5a38b54a2c9317d1acf5 authored over 8 years ago by Todd C. Miller <[email protected]>
Avoid calling fclose(NULL) if the sudoers file is not secure and

restore_perms() fails. Coverity CID 104090.

64142f9da2a47477eceeb4c2162a68c51bcf5609 authored over 8 years ago by Todd C. Miller <[email protected]>
In fill_args(), replace loop that increments arg_size() with

a simple add and mask. Should prevent a false positive from
Coverity CID 104094.

5725acd1c401ec45fc8f999e4b71b9eed50758d2 authored over 8 years ago by Todd C. Miller <[email protected]>
In parse_expr(), move the "bad" label after the "default" case in

the switch(), not before it. This seemed to confuse Covertity,
resulting in a false positive, CI...

bf734419bfb37f88a463528706f0475a2e43a1e7 authored over 8 years ago by Todd C. Miller <[email protected]>
For "sudoreplay -l", not all predicates may be shortened to a single

character. Both 'c' and 't' have more than one possibility.

ea44d3757e7e080571d8c654e8b8a64710d9137a authored over 8 years ago by Todd C. Miller <[email protected]>
pid_t is defined by POSIX as a signed integer type so we don't need

a cast when comparing to -1.

829917f0089bdd0e9c9ae006f197731879aceb2b authored over 8 years ago by Todd C. Miller <[email protected]>
In dispatch_signal() for stopped processes check for tcgetpgrp()

returning -1. Also change checks from "saved_pgrp != -1" to
"fd != -1". Coverity CID 104098.

c70da6dcdfad1b5512f6350e57365e98dea19d55 authored over 8 years ago by Todd C. Miller <[email protected]>
In relabel_tty() always jump to bad: on error, regardless of the

value of se_state.enforcing. On error, return -1 if enforcing,
else 0. Coverity CID 104099.

2cd22f290632c5c3e49dc21ad1267080037f2fa1 authored over 8 years ago by Todd C. Miller <[email protected]>
Define NO_LEAKS when sudo is built with Coverity.

b20b411e71114d8cb97f406b68a182639e3cf587 authored over 8 years ago by Todd C. Miller <[email protected]>
In io_callback() if we write the complete buffer and find that there

is no associated reader just return as there is nothing else to be
done. In practice is it not p...

4ce39df38f79e5c078d95d46d71d8135bf713c17 authored over 8 years ago by Todd C. Miller <[email protected]>
Handle read() returning -1 when creating temporary files.

Coverity CID 104100

6ea903623b9960a6bbe8476f52f8cb71dd720cd4 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix cut and paste error when checking cols for 0.

Coverity CID 104081

20ff6023aa5254f79ad6defc94639d3130b26d6b authored over 8 years ago by Todd C. Miller <[email protected]>
Use a single debug message for cache hit or store to avoid another

situation where they get out of sync. Bug #743

2152f053b13ecbac7914e3d40715bbf8384c1f96 authored over 8 years ago by Todd C. Miller <[email protected]>
Sync the "cache hit" debug messages with the "cached" debug messages.

This fixes a bug where we could dereference a NULL pointer when we
look up a negative cached entr...

a152afaeb538db6785c1170377e40dad62546f2f authored over 8 years ago by Todd C. Miller <[email protected]>
Remove the check for __sprintf_chk when checking for _FORTIFY_SOURCE,

Some implementations are purely header-file based. As long as we
can link a test program using s...

9d5c6fbd64e196b2c9c298a93545b0d685b7feb6 authored over 8 years ago by Todd C. Miller <[email protected]>
Remove configure checks for dev_t, id_t, ino_t, ptrdiff_t, size_t

and ssize_t. These have been specified by either ANSI C or POSIX
for long enough that if the sys...

e0f12d81a70c8916cf36d9a444a272a9aea74877 authored over 8 years ago by Todd C. Miller <[email protected]>
Do group setup in policy_init_session() before calling out to the

plugin. This makes it possible for the pam_group module to change
the group in pam_setcred(). I...

f88da1c1a07fa25a2d4edc8499e579c1dd35e5a9 authored over 8 years ago by Todd C. Miller <[email protected]>
Add missing newline when logging to a file (not syslog) and

loglinelen is set to a non-positive number. Bug #742

57b1dc5e1d85a408d42ef15d513e138a130522c9 authored over 8 years ago by Todd C. Miller <[email protected]>
style fix; fork_cmnd should start on a new line

3e9702580ef3328f6de23eeef329a4db519ed271 authored over 8 years ago by Todd C. Miller <[email protected]>
Ignore SIGPIPE for the duration of sudo and not just in a few select

places. We have no control over what nss, PAM modules or sudo
plugins might do so ignoring SIGPI...

b4309d4aea1ec349e86f637b99a68763d64daf58 authored over 8 years ago by Todd C. Miller <[email protected]>
Use string_to_security_class() instead of pulling SECCLASS_CHR_FILE

from flask.h. Avoids a warning with new SELinux includes.

70cf5674b5536b3b1840314c04f35ccaa2b64c3e authored over 8 years ago by Todd C. Miller <[email protected]>
When determining whether or not "sudo -l" or "sudo -b" should prompt

for a password, take all sudoers sources into account. In other
words, if both file and ldap sud...

6717c32022153bcc0aa9afa87aa96e208a6a86c5 authored over 8 years ago by Todd C. Miller <[email protected]>
If the auth_type setting in /etc/security/login.cfg is set to

PAM_AUTH but pam_start() fails, fall back to use AIX authentication.
Skip the auth_type check if ...

b2d1c457ce01752d3e77acb944d024946006190e authored over 8 years ago by Todd C. Miller <[email protected]>
The header for sudo.conf(5) should be SUDO.CONF(5) not SUDO(5).

7cd6d4ec79831a617d1fb61e41e9bae677ba8a7a authored over 8 years ago by Todd C. Miller <[email protected]>
hook_version and hook_type are unsigned so use 0, not -1 in the

final (empty) entry. Quiets a warning on Solaris Studio 12.2.

c5cafb4331ed4b805833430891f108a29f7b415c authored over 8 years ago by Todd C. Miller <[email protected]>
Work around an ambiguity in the PAM spec with respect to the conversation

function. It is not clear whether the "struct pam_message **msg" is an
array of pointers or a po...

48dff840810a6ec6d56422e687a7eb464dc27ad1 authored over 8 years ago by Todd C. Miller <[email protected]>
sync with translationproject.org

93536726086a26466b97f421b3564b1874152e13 authored over 8 years ago by Todd C. Miller <[email protected]>
Bug #738

f5b8ad480e605b1dff1b7de478d9aaff376b5e8b authored over 8 years ago by Todd C. Miller <[email protected]>
sync with translationproject.org

514c62fc245f764c9b8604f8dd90d7cd78724ba7 authored over 8 years ago by Todd C. Miller <[email protected]>
Better test for negated character classes.

70f2f4eee919d10ad8b1a87da8bdb94069590fb8 authored over 8 years ago by Todd C. Miller <[email protected]>
Add test for negated character class

f222a20b13b8480976dcb70eba28d7eac9ac1d53 authored over 8 years ago by Todd C. Miller <[email protected]>
sync with translationproject.org

159aa2ba6cb0c0bb5ac2f63d4ae2e68d37526e5c authored over 8 years ago by Todd C. Miller <[email protected]>
sync

d1a3da4175454b1d3c3f4a1545794341fdd09998 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix negation of character classes.

547a9b7d9cb5673bdc2f393081dc18ec92cbb653 authored over 8 years ago by Todd C. Miller <[email protected]>
Fix the check for whether a user is allowed to lists another user's

privileges. The "matched" variable is not boolean, it can also
have the value UNSPEC so we need ...

95dd64ea7513e4034d787e82fbcbe84c758c0c98 authored over 8 years ago by Todd C. Miller <[email protected]>
Log the number of PAM messages in the conversation function at debug

level.

5dd7ac20e176936ddd3771a0d279930b5dab3ee3 authored over 8 years ago by Todd C. Miller <[email protected]>
Don't check for posix_spawn() or posix_spawnp() if we were unable

to find spawn.h. This should only be a problem on systems with
broken headers. Bug #730

4b079ee7e6171e26b2fc11a7863708fde0a6bef5 authored over 8 years ago by Todd C. Miller <[email protected]>
update for 1.8.16

1d796d629fca12339456228b3f1e1210b7caa0cb authored over 8 years ago by Todd C. Miller <[email protected]>
Fix documented bug with duplicate role names and turn on perl warnings.

Based on a diff from Aaron Peschel

99978e4a7037732a2094d367afb3dbef1668284c authored over 8 years ago by Todd C. Miller <[email protected]>
Add declaration of getauthdb() for AIX 5.1

47adf0d3cb7245bcdfe359f6ec05c23eddc7f804 authored over 8 years ago by Todd C. Miller <[email protected]>
regen

6848a7f1a6eee3183f43315ba0def40793076466 authored over 8 years ago by Todd C. Miller <[email protected]>
sync with translationproject.org

fafbc9a55a6e499268831e5074306d3afb591df2 authored over 8 years ago by Todd C. Miller <[email protected]>