-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User should can run su-exec as self #10
Comments
Can this behaviour achieved by su-exec ?
|
@hason Did you find any workaround for this type of case ? |
What is it you're hoping "su-exec" will do in this condition? You seem to
want to switch from the user you are to ... the user you are (which is kind
of a strange ask).
|
Not the OP but my use case is this: I would like to use a docker image (provided by a third party) that uses su-exec to switch to a user dynamically specified in an environment variable. This works nicely - unless you happen to want to not change user at all. It seems to me that by detecting this case and permitting it (by doing nothing), su-exec would be eliminating an edge case and allowing itself to be used in more situations. |
@tianon Exactly this is the case. I am trying to su-exec from the user deploy to user deploy Here is my case. |
so basically, check if you are trying to switch to current user, and do nothing in that case? Something like: #!/bin/sh
# su-exec-wrapper.sh
user=$1
shift
if [ "$user" != "$(whoami)" ]; then
su-exec "$@"
else
"$@"
fi |
Indeed, a pattern similar to that is very common in the official images, although we typically check for See also docker-library/rabbitmq#60, docker-library/cassandra#48, docker-library/mongo#81, redis/docker-library-redis#48, docker-library/mysql#161, MariaDB/mariadb-docker#59, docker-library/percona#21, docker-library/ghost#54, docker-library/postgres#253, docker-library/redmine#136. |
Confused behaviour:
The text was updated successfully, but these errors were encountered: