Project

General

Profile

Feature #6032

stmfadm should sanitize user-provided group names

Added by Yuri Pankov over 5 years ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
comstar - iSCSI/FC/SAS target
Start date:
2015-06-24
Due date:
% Done:

50%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

stmfadm does not provide proper validation for host/target group names.

At least it allows to create names with:
1. leading spaces.

root@fakenode-1:~# stmfadm create-hg '  name1'
root@fakenode-1:~# stmfadm list-hg
Host Group:   name1

2. trailing spaces.

root@fakenode-1:~# stmfadm create-hg 'name1  '
root@fakenode-1:~# stmfadm list-hg
Host Group: name1 
root@fakenode-1:~# stmfadm delete-hg 'name1'
stmfadm: name1: not found
root@fakenode-1:~# stmfadm delete-hg 'name1  '
root@fakenode-1:~# stmfadm list-hg
root@fakenode-1:~#

3. names that consists entirely of spaces.

root@fakenode-1:~# stmfadm list-hg
root@fakenode-1:~# stmfadm create-hg '   '
root@fakenode-1:~# stmfadm list-hg
Host Group:    

4. empty names

root@fakenode-1:~# stmfadm create-hg ''
root@fakenode-1:~# stmfadm list-hg
Host Group:

No data to display

Also available in: Atom PDF