Skip to content

Commit a052683

Browse files
authored
Merge pull request ceph#53859 from rhcs-dashboard/add-pseudo-validation
mgr/dashboard: add absolute path validation for pseudo path of nfs export Reviewed-by: Aashish Sharma <[email protected]> Reviewed-by: afreen23 <NOT@FOUND> Reviewed-by: Ankush Behl <[email protected]> Reviewed-by: Nizamudeen A <[email protected]>
2 parents 9aede08 + adeea09 commit a052683

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,8 @@
259259
class="form-control"
260260
name="pseudo"
261261
id="pseudo"
262-
formControlName="pseudo">
262+
formControlName="pseudo"
263+
minlength="2">
263264
<span class="invalid-feedback"
264265
*ngIf="nfsForm.showError('pseudo', formDir, 'required')"
265266
i18n>This field is required.</span>
@@ -269,6 +270,9 @@
269270
<span class="invalid-feedback"
270271
*ngIf="nfsForm.showError('pseudo', formDir, 'pattern')"
271272
i18n>Pseudo needs to start with a '/' and can't contain any of the following: &gt;, &lt;, |, &, ( or ).</span>
273+
<span class="invalid-feedback"
274+
*ngIf="nfsForm.showError('pseudo', formDir, 'minlength') && nfsForm.getValue('pseudo') === '/'"
275+
i18n>Pseudo path should be an absolute path and it cannot be just '/'</span>
272276
</div>
273277
</div>
274278

0 commit comments

Comments
 (0)