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

View File

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