[CentOS] Can an ISO be specified allow mount "setsebool -P allow_mount_iso=1" insted of "setsebool -P allow_mount_anyfile=1" SE context samba share

Sun Jul 13 15:49:22 UTC 2008
Filipe Brandenburger <filbranden at gmail.com>

Hi,

Please try to be more specific about what you are trying to do, how
you are trying to do it, what you expected, what is going wrong, and
what you tried to do to repair it. Your previous mail looks like the
output of a tool, I don't even know which. Knowing that would help
solve your issue.

>From what I see, you are trying to mount an .iso file in a target
directory inside Samba's tree, and SELinux is denying that (with the
AVC you showed on your original message).

SELinux complains because the target directory is not marked with the
"mnt_t" type and, for security, it restricts mounting filesystems only
to directories with that type.

To change that, you could use "chcon" to set the type to the directory
where you want to mount your iso.

# chcon -t mnt_t /path/to/mountpoint
# mount -o loop,ro /path/to/iso/Fedora.iso /path/to/mountpoint

You can use ls -Z (or if it's a directory ls -dZ) to verify the
SELinux user:role:type of the file.

Please let us know how that works for you.

HTH,
Filipe