New answers tagged

3

Once the script is in the path, the line in the script which is supposed to call the original program instead calls the script, which creates infinite non terminating recursion until some system limit is reached. The correct approach is to do which myapplication before putting the script in PATH to find the absolute path to the myapplication original ...


0

I/O redirection is most easily implemented after fork and before exec. The child, being aware it's the child, can close file descriptors, open new ones, dup() or dup2() them to get them onto the right fd number, etc, all without affecting the parent. After doing that, and perhaps any desired environment variable changes (also not affecting the parent), it ...


1

If nothing else suits, consider the Linux Key Retention service (kernel keyrings). Start at: security/keys.txt. One of the default keyrings can be cloned between parent and child processes. It's not the simplest solution, but it's there and appears to be maintained & used (it was also implicated in an Android bug last year.) I don't know about its "...


18

Process arguments are visible to all users, but the environment is only visible to the same user (at least on Linux, and I think on every modern unix variant). So passing a password through an environment variable is safe. If someone can read your environment variables, they can execute processes as you, so it's game over already. The contents of the ...


10

Instead of passing the password directly through an argument or an environment variable #!/bin/bash #filename: passwd_receiver echo "The password is: $1" use the same argument or environment variable to pass a filename: #!/bin/bash #filename: passwd_receiver echo "The password is: $(< "$1")" Then you can pass either a permission-protected regular ...


7

No, environment variables are easily read too, and leak to child processes. pass it using a pipe.


1

fork: Resource temporarily unavailable The error means that the current shell resource is limited (check the limits by ulimit -a). So you can either try in another shell, or increase the resources by using ulimit command which controls over the resources available to the shell and processes it creates on operating system. To increase the limits, try ...



Top 50 recent answers are included