We should not allow a user to mount a container with a different label

We need to get the label from the container and mount with it.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #502
Approved by: mheon
This commit is contained in:
Daniel J Walsh
2018-03-15 14:16:07 -04:00
committed by Atomic Bot
parent 4bc166446d
commit 647fedc2a2
2 changed files with 1 additions and 9 deletions

View File

@ -23,10 +23,6 @@ var (
Name: "notruncate",
Usage: "do not truncate output",
},
cli.StringFlag{
Name: "label",
Usage: "SELinux label for the mount point",
},
cli.StringFlag{
Name: "format",
Usage: "Change the output format to Go template",
@ -83,7 +79,7 @@ func mountCmd(c *cli.Context) error {
if err != nil {
return errors.Wrapf(err, "error looking up container %q", args[0])
}
mountPoint, err := ctr.Mount(c.String("label"))
mountPoint, err := ctr.Mount(ctr.MountLabel())
if err != nil {
return errors.Wrapf(err, "error mounting container %q", ctr.ID())
}

View File

@ -30,10 +30,6 @@ returned.
Do not truncate IDs in output.
**--label**
SELinux label for the mount point
## EXAMPLE
podman mount c831414b10a3