tempfile
OpenDoas
tempfile | OpenDoas | |
---|---|---|
8 | 29 | |
1,074 | 595 | |
- | - | |
6.9 | 0.0 | |
16 days ago | about 2 months ago | |
Rust | C | |
Apache License 2.0 | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
tempfile
-
Hey Rustaceans! Got a question? Ask here (27/2023)!
I need to do some tests with files operations, what's the best practice in regards to creating temporary files in tests ? I heard about tempfile but is there a more idiomatic way to do that ?
-
Testing the memory safe Rust implementation of Sudo/Su
The sudo-rs Cargo.toml [1] file seems very reasonable. This is the curse of being cross platform. The inclusion of https://github.com/Stebalien/tempfile as a dependency is responsible for the overwhelming majority of lines due to including *-sys crates for multiple OSs.
~/Code/tempfile !! tokei vendor
-
Adding automated tests to rost_gen
Eventually, I had to test reading of input file and generation of the html file. To do this, I would need to create test files for input and output for this scenario. However, this could cause problems unless I named all the test files differently as tests usually run in parallel. So, I decided to use the tempfile crate to create a temporary test directory for each test (where needed):
-
Is this safe? Keeping and opening temporary file.
Create a NamedTempFile with the tempfile crate.
-
How can I test this get_type_filepaths function?
Even better would be to create a tempdir and populate it during the test run. Try the tempfile crate.
-
How to open a PDF with default PDF viewer?
Not the same commenter but you could use a tempfile
-
Blog post: Async Cancellation
That said though; there are a few solutions for the problem you're describing. One would be to have a "temp file" type which knows how to delete itself when dropped, but can manually be converted into a permanent file in the case of success. Crates like tempfile provide abstractions for this.
-
temp-dir: Simple temporary directory with cleanup
tempdir was merged into tempfile.
OpenDoas
-
A simple guide for configuring sudo and doas
Aditionally,because doas was developed for OpenBSD,it also retains some of its quirks,like how user-installed executables are stored in /usr/local/bin,in contrast to /usr/bin where Linux stores them. As a result,doas can have problems on Linux so the following workaround can be used:
-
The First Stable Release of a Rust-Rewrite Sudo Implementation
https://github.com/Duncaen/OpenDoas/issues/106
That's a pretty severe unsolved security issue.
-
Doas – dedicated OpenBSD application subexecutor
2. https://github.com/Duncaen/OpenDoas/blob/master/timestamp.c
-
Testing the memory safe Rust implementation of Sudo/Su
If you want to move away from Sudo, but don't want to try this rust implementation just yet, I have had great success with OpenBSD's doas. It has been ported to every Linux distro I know of as well:
https://github.com/Duncaen/OpenDoas
-
Doas Mastery (2019)
There are, at both ends. Both the "script kiddies" who cannot deviate from scripts because they lack almost any knowledge at all; and the knowledgeable ones who know that there are subtle differences between sudo and doas which require doing things slightly differently to achieve the same effect.
* https://github.com/Duncaen/OpenDoas/issues/116#issuecomment-...
-
Help me on gentoo
Doas makes more in openbsd world In linux there are many api that need to be changed for porting, i'm no expert but the port might be flawed as not many developers has checked the codebase And how can you explain this vulnerability https://github.com/Duncaen/OpenDoas/issues/106
-
Linux users who are paranoid about security.... what's your opinion about OpenBSD?
Personally I'd prefer running Qubes OS, if only my device would have been more powerful. Currently I'm on Fedora Silverblue as I believe it provides a decent middle-ground in which I'm more secure than almost any other Linux distro while not losing any (meaningful) functionality. I do make use of doas and other technologies inspired from OpenBSD to further enhance the security.
-
Sudo and Su Being Rewritten in Rust for Memory Safety
Why not port https://github.com/Duncaen/OpenDoas to rust instead?
If the goal is security, then there is more to it than just using a memory safe language. Otherwise the result of this, possibly unwittingly, seems performative.
- Bringing Memory Safety to sudo and su
- Using doas instead of sudo on Debian 11
What are some alternatives?
tempdir - Temporary directory management for Rust
doas - A port of OpenBSD's doas which runs on FreeBSD, Linux, NetBSD, and illumos
zbox - Zero-details, privacy-focused in-app file system.
runas - An alternative to sudo and doas written in Rust
xattr - Extended attribute library for rust.
nixpkgs - Nix Packages collection & NixOS
rust-9p - Tokio-based asynchronous filesystems library using 9P2000.L protocol, an extended variant of 9P from Plan 9.
bedrocklinux-userland - This tracks development for the things such as scripts and (defaults for) config files for Bedrock Linux
rust - Empowering everyone to build reliable and efficient software.
tako - Run commands as another user
fs_extra - Expanding opportunities standard library std::fs and std::io
koyo - Run commands as another user