properly check if docker is usable for $USER

Bug #1473554 reported by Harm Weites
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla
Fix Released
Low
Unassigned

Bug Description

Introduce a proper check on usability of docker and bail if it's not usable. The current behavior is to 'just read the docs!', which not everybody does, and inflict mayhem if $USER tries to do anything docker. Not good.

Changed in kolla:
assignee: nobody → Swapnil Kulkarni (coolsvap)
Revision history for this message
Jeff Peeler (jpeeler-z) wrote :

Yes, don't just do a group membership test. Perhaps checking the return value of "docker info" may work, but in the case of the docker client not being installed (such as inside an atomic container), checking the permissions of the socket file in the default location I would think is the best approach.

Revision history for this message
Swapnil Kulkarni (coolsvap-deactivatedaccount) wrote :

Even if I check the permission on /var/run/docker.sock, it does not solve the problem. The group ownership can be checked by any user and it does not validate if the user can execute the docker commands.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to kolla (master)

Fix proposed to branch: master
Review: https://review.openstack.org/201022

Changed in kolla:
status: New → In Progress
Revision history for this message
Swapnil Kulkarni (coolsvap-deactivatedaccount) wrote :

I checked docker ps in atomic host as well and it works so I believe we can use it to validate the user. docker info works for user without docker privileges

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kolla (master)

Reviewed: https://review.openstack.org/201022
Committed: https://git.openstack.org/cgit/stackforge/kolla/commit/?id=1f0acbd0cd47c4872fd57189181e06dc2bd7891b
Submitter: Jenkins
Branch: master

commit 1f0acbd0cd47c4872fd57189181e06dc2bd7891b
Author: Swapnil Kulkarni <email address hidden>
Date: Mon Jul 13 07:11:27 2015 +0000

    Update scripts to check if docker is usable for $USER

    Added new script for checking user permissions on
    docker command execution

    Change-Id: I3b727590d9a29f416f5b847912b7250c555c2333
    Closes-Bug: #1473554

Changed in kolla:
status: In Progress → Fix Committed
Changed in kolla:
importance: Undecided → Low
milestone: none → liberty-2
Sam Yaple (s8m)
Changed in kolla:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.