From 84ae3d6482ac9e1b2108d1decd6b5160541f1065 Mon Sep 17 00:00:00 2001 From: Tom Mortensen Date: Fri, 29 Aug 2025 17:13:05 -0700 Subject: [PATCH] * fix: correct handling of case-insensitve share names --- emhttp/plugins/dynamix/SecurityNFS.page | 2 +- emhttp/plugins/dynamix/SecuritySMB.page | 4 +- emhttp/plugins/dynamix/ShareEdit.page | 52 +++++++++++++++++++------ 3 files changed, 44 insertions(+), 14 deletions(-) diff --git a/emhttp/plugins/dynamix/SecurityNFS.page b/emhttp/plugins/dynamix/SecurityNFS.page index d146ffe97..a625b9462 100644 --- a/emhttp/plugins/dynamix/SecurityNFS.page +++ b/emhttp/plugins/dynamix/SecurityNFS.page @@ -1,7 +1,7 @@ Menu="Disk Share" Title="NFS Security Settings" Tag="linux" -Cond="(($var['shareNFSEnabled']!='no') && (isset($name)?array_key_exists($name,$sec_nfs):0))" +Cond="(($var['shareNFSEnabled']!='no') && (isset($name)?array_key_exists($name,$sec_nfs)&&$shares[$name]['hasCfg']!='similar':0))" --- :smb_security_help: +
_(Read settings from)_ : @@ -61,6 +62,7 @@ _(Write settings to)_
+
diff --git a/emhttp/plugins/dynamix/ShareEdit.page b/emhttp/plugins/dynamix/ShareEdit.page index 7bbd69252..b82da1cfd 100644 --- a/emhttp/plugins/dynamix/ShareEdit.page +++ b/emhttp/plugins/dynamix/ShareEdit.page @@ -335,15 +335,7 @@ $filteredShares = array_filter($shares, function($list) use ($name) { :share_edit_global2_help: -":">"?> - - - - - - - - +
_(Read settings from)_ @@ -374,13 +366,23 @@ _(Write settings to)_ - +
- + + + +":">"?> + + + + + + +
_(Share name)_: -: _(Share name contains unallowed character(s))_ +: _(Share name contains restricted character(s))_ :share_edit_name_help: @@ -591,6 +593,9 @@ _(Mover action)_: : + + _(Case-insensitve Share name is not unique)_ +
@@ -1088,6 +1093,18 @@ function prepareEdit() { }); return false; } + // Must not be same name as existing share + shares = ; + if (shares.some(name => name.toLowerCase() === share.toLowerCase())) { + swal({ + title: "_(Invalid share name)_", + text: "_(Share already exists)_", + type: 'error', + html: true, + confirmButtonText: "_(Ok)_" + }); + return false; + } } /* Update settings. */ @@ -1421,5 +1438,16 @@ $(function() { updateScreen(form.shareUseCache.value); if ($.cookie('autosize-' + $('#shareName').val())) $('#autosize').show(); checkName($('#shareName').val()); + + form.shareComment.disabled = true; + form.shareFloor.disabled = true; + form.shareCachePool.disabled = true; + form.shareCOW.disabled = true; + form.shareAllocator1.disabled = true; + form.shareSplitLevel1.disabled = true; + form.shareInclude1.disabled = true; + form.shareExclude1.disabled = true; + form.secondary.disabled = true; + });