diff --git a/clientside/tmcc/freenas8/libvnode_blockstore.pm b/clientside/tmcc/freenas8/libvnode_blockstore.pm index 106ea6a45bd89dba630f319c0b2b1323f01ed240..bb7e32f47d93b230cd63c2e7699db099c952457c 100644 --- a/clientside/tmcc/freenas8/libvnode_blockstore.pm +++ b/clientside/tmcc/freenas8/libvnode_blockstore.pm @@ -741,11 +741,16 @@ sub exportSlice($$$$) { return -1; } + my $perm = "rw"; + if (exists($sconf->{'PERMS'}) && $sconf->{'PERMS'} eq "RO") { + $perm = "ro"; + } + # Create iSCSI target my $serial = genSerial(); eval { freenasRunCmd($FREENAS_CLI_VERB_IST_TARGET, "add $iqn $serial $ISCSI_GLOBAL_PORTAL ". - "$tag Auto -1") }; + "$tag Auto -1 flags=$perm") }; if ($@) { warn("*** ERROR: blockstore_exportSlice: $volname: ". "Failed to create iSCSI target: $@");