5 ms·
This should be a small, easy to read bash script. Not a plethora of rust files that compile to a binary. I would never trust this thing to not cause more issu
by TekMol 4y ago
This should be a small, easy to read bash script.
Not a plethora of rust files that compile to a binary.
I would never trust this thing to not cause more issues, unless it is so small and elegant, that I can audit it very easily and be very very sure it is safe.
- creatonez 4y agoWhy nitpick the programming language of a project clearly intended to be used by the author?
- TekMol 4y agoBecause of the indirection and complexity it causes. The user is in a shell. The simplest way to add something to their system is a shellscript. No moving parts. You get what you see in the script. The way the project is set up, there are multiple moving parts. The interaction between the shell, some compiler and a bunch of rust files. Imagine during the moon landing, Neil Armstrong could not have communicated directly with Buzz Aldrin. But they would had to go through a translator who translates English to German. Who passes the message on to a translator who translates it from German to French. Who then passes it on to Buzz. BOOM! + /\ + .' '. * * /======\ + ;:. _ ; |:. (_) | |:. _ | + |:. (_) | * ;:. ; .' \:. / `. / .-'':._.'`-. \ |/ /||\ \|
- pca006132 4y agoI don't think this tool changes the shell command for you? Your analogy doesn't fit here. But I do agree that it is probably easier to implement as a shell script.
- eladkaplan 4y agoshellfirm not changes the shell command, only get the the command and check the pattern. the shell is execute the command. You really think shell script will be easier? can you elaborate?
- Thiez 4y agoBy that reasoning all command line tools must be shell scripts.
- eladkaplan 4y agoHey this project is very small, and not execution command! only prompt you a verification when detect a risky pattern from a yaml pre-define (default or by you) You can see the yaml files. it wrote in rust to make is faster
- NavinF 4y agoFunny you say that when the sketchiest part of this submission is the shell script dependency it uses to intercept every command you run: https://github.com/rcaloras/bash-preexec/blob/master/bash-preexec.sh https://github.com/rcaloras/bash-preexec/blob/master/bash-pr... I don’t know rust, but the rust files in the submission look very straightforward. (Why wouldn’t it? It’s just matching a few hardcoded commands. It’d be easy in any language)
- eladkaplan 4y agoIn base you need a hook that get the command before your shell execute the command. when the shell get the command interrupt this project execute shellfirm before summation in your shell
- NavinF 4y agoYeah I get it. Your code is fine. I just find it hilarious how that guy wanted you to implement this as a shell script so he could “audit it very easily”. I mean, bash-preexec.sh isn’t the worst shell script I’ve seen (It even has a Bats test!), but anyone that thinks shell scripts are easy to audit is full of shit.
- eladkaplan 4y agoIn zshrc is much more easier based on the hooks that you get
- IshKebab 4y agoThe idea that this would be easier to read and more reliable in Bash is downright hilarious.
- eladkaplan 4y agowhat is your point? do implement the risky command in bash script?
- glitchcrab 4y agoThey're saying that writing the whole thing in bash (no rust) would be even harder to read. Programming in bash is hideous.
- eladkaplan 4y agoagree, this is the reason that i wrote it in rust faster easy to maintain unitesting and small binary