Commit Graph

33 Commits

Author SHA1 Message Date
bjorn3 8bcdb70d76 sudo: Switch to the root namespace before execing the target process 2026-03-01 13:08:07 +01:00
Ibuki Omatsu 3bdd1d9a6e Adapt sudo and getty to new namespace management, and enforce strict namespace at login. 2026-01-20 20:58:27 -07:00
Wildan M 9dc487e1d8 Fix compilation with newer syscall 2025-12-28 17:40:14 +07:00
bjorn3 6d50c1220e Leave daemonization to init 2025-11-30 10:45:21 +01:00
bjorn3 4ed8323351 passwd: Remove suid usage though the sudo daemon 2025-04-20 21:10:22 +02:00
bjorn3 9c53a9a775 Use the sudo daemon rather than setuid for su 2025-04-20 16:46:50 +02:00
bjorn3 bfd521ff49 Fix sudo for procmgr 2025-04-20 16:20:56 +02:00
bjorn3 1fbb804f35 Introduce a sudo daemon as replacement for suid/escalated
This daemon will request the password of the user, check that the user
is in the sudo group and if everything checks out elevate the sudo
process to root after which the sudo process can exec the target process.
2025-04-14 20:16:33 +02:00
bjorn3 7fa1bf8df4 sudo: Simplify a bit 2025-04-13 18:03:49 +02:00
bjorn3 6a208c6b34 Rustfmt 2025-04-13 16:51:27 +02:00
bjorn3 6f2514ed95 Move to the 2024 edition 2025-04-13 16:50:06 +02:00
bjorn3 4ccec7baae sudo: Reduce indentation 2025-03-11 21:31:54 +01:00
bjorn3 88ccab8844 sudo: Rustfmt 2025-03-11 21:31:49 +01:00
4lDO2 8ab925eb65 Fully switch to libredox 2023-11-04 20:04:59 +01:00
Jeremy Soller 93b6791e29 Update redox_users 2021-01-26 12:52:03 -07:00
Jeremy Soller 2fd54ec8d4 Update liner 2019-11-29 19:37:53 -07:00
Jeremy Soller a208ce4aa8 Update redox_users 2019-08-07 20:00:09 -06:00
MggMuggins 48a8e2fa56 Update redox-users v0.2: Shadowfile support 2018-07-25 15:18:19 -05:00
MggMuggins 69838054ab Remove ArgParser dep, whoami
Remove Arg parsing from sudo, (maybe in prep to deprecate in favor of
rudo)

Port login to clap-rs

Remove ArgParser dep

Remove whoami in favor of a link to id, and implemented linking in id.
2018-02-10 12:09:10 -06:00
MggMuggins 5e53b4b161 Port to redox_users break-api
All the utilities use the new API I defined in mu recent PR to
redox_users. `su`'s behavior was also fixed.

I also updated Cargo.toml (removing unused deps). This may require
another commit after my first PR is merged in order to appropriately
update Cargo.lock and make sure everything builds.
2018-01-29 16:39:52 -06:00
Jose Narvaez 0e327d8124 Using new 'unwrap_or_exit' from libextra. 2017-12-15 18:31:25 +00:00
Jose Narvaez 13681c3442 Moved to new error hadling of . 2017-11-30 22:41:57 +00:00
MggMuggins d9d3635916 Implemented useradd; groupadd fix 2017-11-28 21:39:20 -06:00
Jose Narvaez 0ed14bec6d Migrated to redox_users and some refactoring and docs.
Details

- Updated dependencies with `redox_users`.
- Migrated all user/group dependent functionality to calls to `redox_users`.
- Added top level documentation to the crate.
- Added a `spawn_shell` function to reuse a bit of code.
- `login`: Handled the case of an invalid login with "Login incorrect" (as in BSD).
- `passwd`: Refactored a bit and used `eprintln!` where possible.
- `su`: Refactored a bit and used `eprintln!` where possible.
- `sudo`: Refactored a bit to simplify logic also used `eprintln!` where possible.
- `whoami`: Refactored a bit and used `eprintln!/println!` where possible.
- Also added myself on the AUTHORS section :).
2017-11-08 22:49:00 +00:00
Jeremy Soller 28d097dbf3 Fix man pages 2017-10-14 08:49:19 -06:00
Andre Richter 2a6615d343 Fix unused extern crates 2017-08-31 11:36:30 +02:00
Jeremy Soller d811d8758c Update password read to new method 2017-08-02 21:09:36 -06:00
Jose Narvaez ef5fdc82a0 Improved id and whoami.
Details

- New implementation of `id` inspired by BSD's one.
- Refactoring on `whoami`.
- Added few utility functions in `userutils` for getting processes user and group
real/effective ID and names.

Added docs do `getty`, `login`, `passwd`, `su`, and `sudo`.

Details

- The docs are from BSD's ones.
- Also added `ArgParser` to all of them and added a -h/--help flag
to all of them.
- This is the start of a revision of all of those commands.
2017-07-19 18:06:48 +01:00
Jeremy Soller 3ca18917f8 Update to use sudo password 2017-04-06 21:05:46 -06:00
Jeremy Soller 1ee223f926 Better error messages for sudo 2017-02-27 15:34:35 -07:00
Jeremy Soller ccae9c0b0a Correctly set environment 2017-01-10 09:50:23 -07:00
Jeremy Soller d32f2dc10e Correctly use salt 2016-10-24 13:12:58 -06:00
Jeremy Soller 860c1f5f25 Initial commit 2016-10-07 10:19:08 -06:00