mirror of
https://github.com/containers/podman.git
synced 2025-05-22 01:27:07 +08:00
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:

committed by
Atomic Bot

parent
4bc166446d
commit
647fedc2a2
@ -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())
|
||||
}
|
||||
|
@ -30,10 +30,6 @@ returned.
|
||||
|
||||
Do not truncate IDs in output.
|
||||
|
||||
**--label**
|
||||
|
||||
SELinux label for the mount point
|
||||
|
||||
## EXAMPLE
|
||||
|
||||
podman mount c831414b10a3
|
||||
|
Reference in New Issue
Block a user