Allow docker to free container labels when containers are removed.

Currently we do not remove reservations on MCS labels when a container
is removed.  Not a big problem, since on reboot it would be freed.
But we should be cleaning this up.  Currently we support ~500,000
labels.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Use --privileged in Makefile

We need --privileged for apparmor based systems until we have an
apparmor specific flag to set the profile to unconfined.

Signed-off-by: Michael Crosby <michael@docker.com>
Merge pull request #162 from rhatdan/unreserve

Allow docker to free container labels when containers are removed.
Merge pull request #164 from crosbymichael/use-privilged

Use --privileged in Makefile
user: refactor GetUser... and expose private functions

This patch refactors most of GetUserGroupSupplementaryHome and its
signature, to make using it much simpler. The private parsing functions
have also been exposed (parsePasswdFile, parseGroupFile) to allow custom
data source to be used (increasing the versatility of the user/ tools).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
user: use struct values instead of pointers

This patch fixes the incorrect practice of using pointers to struct
values rather than using the struct values themselves when the struct
value memory is not intended to be shared.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
user: add unit tests for GetRunUser

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
user: added a os/user-like API for quickly finding user and group entries

This patch adds an 'os/user'-like API to 'user/', allowing callers to
easily search for user and group entries in the operating system's
'/etc/passwd' and '/etc/group' files without needing to open file handles
and creating filter function closures. Some of this functionality is
lacking in the Go standard library (mainly group entry lookups).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
user: user: added path wrappers

This patch adds wrappers to the ParsePasswd, ParsePasswdFilter,
ParseGroup, ParseGroupFilter and GetRunUser functions, allowing for
simpler invocation of the user/ library routines.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>