Skip to content

Remove whoami check in "as" #167

Closed
Closed

Description

@smw1218

For a restricted user (ie. a user that doesn't have full root access via sudo), this requires that "whoami" is explicitly enabled in the sudoers file which is silly when I'm just trying to run something else that is enabled for the user:
if ! sudo -u #{@user} whoami > /dev/null
then echo "You cannot switch to user '#{@user}' using sudo, please check the sudoers file" 1>&2
false
fi

Activity

  1. leehambley commented on Nov 13, 2014

    @leehambley
    Member

    We'll take a PR, but I still think the error message is better this way.

  2. abhishiv commented on Jul 30, 2019

    @abhishiv

    Yes, please this check is indeed very silly. If someone can send a PR to fix this it would be great!

  3. leehambley commented on Jul 30, 2019

    @leehambley
    Member

    I was clear five years ago when I advised that we're open to taking a patch, but that we designed it this way for a reason. Times change, and good error messages on ops tooling is important.

    The other maintainers and I would be glad to assist with getting a patch to the required standard to be merged if we can maintain our standards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions