summaryrefslogtreecommitdiff
path: root/src/unistd.rs
AgeCommit message (Collapse)Author
2023-04-16Fixing linkAustin Keeley
2023-01-31setgroups type mismatches on Solaris #1986gco
2023-01-27Merge #1978bors[bot]
1978: Null-check `libc::group` members before converting r=rtzoeller a=djkoloski This mirrors the approach used for the `From<&libc::passwd> for User` impl. Co-authored-by: David Koloski <djkoloski@gmail.com>
2023-01-24Make `*::from_anything` methods unsafeDavid Koloski
The called function must uphold some invariants about initializing data in order for the calls to `from_anything` to be sound.
2023-01-24Null-check `libc::group` members before convertingDavid Koloski
This mirrors the approach used for the `From<&libc::passwd> for User` impl.
2023-01-08feat: I/O safety `ftruncate`Jonathan
2022-12-09Formatting only changes for #1928 and #1863Alex Saveau
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-12-04Move some pure formatting changes out of #1863Alex Saveau
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-10-13Merge #1842bors[bot]
1842: add eaccess on freebsd, dragonfly and linux r=rtzoeller a=SteveLauC #### man pages * [FreeBSD](https://www.freebsd.org/cgi/man.cgi?query=eaccess&sektion=2&n=1) * [DragonFly](https://man.dragonflybsd.org/?command=access&section=2) * [Linux](https://man7.org/linux/man-pages/man3/euidaccess.3.html) #### difference between `eaccess` and `access/faccessat` IMHO, `eaccess` uses effective identifiers to perform the permission check while `access/faccessat` use real IDs. Fixes #1373 Co-authored-by: Steve Lau <stevelauc@outlook.com>
2022-10-12fix '<newline>' being interpreted as htmlRyan Zoeller
2022-10-13add eaccess on FreeBSD, DragonFly and Linux (musl and glibc)Steve Lau
2022-10-11Remove unnecessary verb from doc comment of `dup`Yusuke Tanaka
2022-10-10add faccessat on illumosSteve Lau
2022-10-08add syncfs on linuxSteve Lau
2022-09-25fix crash on Android platformwdsgyj
2022-09-11Handle unacceptable name gracefully in {User,Group}::from_nameWATANABE Yuki
Calling `unwrap` on the result of `CString::new` may cause the current thread to panic, which is a bit surprising undocumented behavior. It would be more reasonable to treat the erroneous name as a non-existing user or group.
2022-08-20Remove MSRV-related workaround for doc aliasesRyan Zoeller
2022-08-12Merge #1785bors[bot]
1785: Remove deprecated items r=asomers a=SteveLauC #### What this pr does 1. Convert `assert!(x == y)` to `assert_eq!(x, y)` 2. Convert `assert!(x != y)` to `assert_ne!(x, y)` 3. Add `.unwrap()` to unused `Result/Option` (in code comments) 4. Convert `std::ixx::MAX` to `ixx::MAX` 5. Convert `Box<Trait>` to `Box<dyn Trait>` Co-authored-by: SteveLauC <stevelauc@outlook.com> Co-authored-by: SteveLau <stevelauc@outlook.com>
2022-08-11minor terminology fix in User docsJack O'Connor
Passwords are hashed, not encrypted.
2022-08-09format codeSteveLauC
2022-08-09remove deprecated itemsSteveLauC
2022-08-05add faccessatZhang Miaolei
2022-07-16Fix description of fchownatvaldaarhun
2022-07-13Add chflagsmusikid
2022-07-13Added non-standard Linux `SysconfVar` variantsSteven Engler
2022-07-10Merge #1745bors[bot]
1745: Change gethostname to use a buffer of MaybeUninit values r=asomers a=nathaniel-daniel Changing `gethostname` to accept a buffer of `MaybeUninit` bytes allows the user to avoid needlessly initializing a buffer. This is a breaking API change. Co-authored-by: Nathaniel Daniel <nathaniel.daniel12@gmail.com>
2022-07-07Fix clippy on nightlyRyan Zoeller
2022-06-27Change gethostname to return an OsStringNathaniel Daniel
2022-06-27Change gethostname to use a buffer of MaybeUninit valuesNathaniel Daniel
2022-06-26Document aliases for functions like getuid()Ryan Zoeller
Add the autocfg crate as a build dependency, and introduce has_doc_alias as a conditional compilation symbol.
2022-06-24Fix all formating problems to pass CI formating testCostin-Robert Sin
Signed-off-by: Costin-Robert Sin <sin.costinrobert@gmail.com>
2022-06-19Minimise the use of the unsafe block inside pipe functionCostin-Robert Sin
Some of the operations inside the pipe function are safe and should not be included inside an unsafe block. Signed-off-by: Costin-Robert Sin <sin.costinrobert@gmail.com>
2022-06-19Fix typo by adding a semicolonCostin-Robert Sin
Signed-off-by: Costin-Robert Sin <sin.costinrobert@gmail.com>
2022-05-30Merge #1727bors[bot]
1727: Add From<uid_t> and From<gid_t> r=rtzoeller a=vkkoskie Conversions to/from primitive uid_t and gid_t to newtype Uid and Gid types are valid and infallible, but are only implemented in one direction. This provides the counterparts in the other direction. These conversions are identical in behavior to the from_raw methods. However, using the more idiomatic From trait enables easier interoperability with other crates (e.g., deserialization with serde) Co-authored-by: Keith Koskie <vkkoskie@gmail.com>
2022-05-30Add infallible conversion from uid_t and gid_tKeith Koskie
Implements the following traits: * From<uid_t> for Uid * From<gid_t> for Gid
2022-05-29Clippy cleanup for latest nightlyAlan Somers
2022-05-14add haiku supportAl Hoang
* enabled as much functionality and defines that match updated libc definitions for haiku
2022-04-09Use singular number for all feature namesAlan Somers
features => feature users => user Neither of these features have yet been included in a release, so it's ok to rename them.
2022-03-19[skip ci] spellcheck a comment for sethostnameAlan Somers
2022-01-10Add getresuid/gid and setresuid/gid on BSDsRyan Zoeller
2021-12-26Fix typosRyan Zoeller
2021-12-22Add fdatasync for missing platformsRyan Zoeller
2021-12-21DragonFly 6.0 added fexecve(2)Ryan Zoeller
2021-12-20feature-gate most Nix functionsVincent Dagonneau
Using features reduces build time and size for consumer crates. By default all features are enabled.
2021-11-17Fix documentation formating for pipe2rusty-snake
2021-09-28Fix memory unsafety in unistd::getgrouplistvitalyd
Fixes #1541
2021-09-19Clippy cleanupAlan Somers
And this time, start running Clippy in CI
2021-09-12Prevent buffer over-read in getgroups()Jan Verbeek
2021-08-25Fix build for DragonFlyBSDRyan Zoeller
2021-07-29Merge #1473 #1474 #1476bors[bot]
1473: sys/stat: add a safe wrapper for mknodat(2) r=asomers a=lucab This introduces a new `mknodat` helper. Ref: https://pubs.opengroup.org/onlinepubs/9699919799/functions/mknod.html 1474: Mark most C-derived enums as non_exhaustive r=asomers a=asomers Since libc may add new variants at any time, Nix's consumers should not use exhaustive match patterns. Fixes #1182 1476: Constify many functions r=asomers a=asomers Constify most functions that can be constified. The exceptions are mostly accessors for structs that have no const constructor. Co-authored-by: Luca BRUNO <luca.bruno@coreos.com> Co-authored-by: Alan Somers <asomers@gmail.com>