Bug 967952

Summary: tgt-admin assumes that ACL consists only of IPs, while these can actually be just names
Product: Red Hat Enterprise Linux 6 Reporter: Jaroslav Kortus <jkortus>
Component: scsi-target-utilsAssignee: Andy Grover <agrover>
Status: CLOSED CURRENTRELEASE QA Contact: Bruno Goncalves <bgoncalv>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: bgoncalv, jkortus
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-10-09 13:41:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jaroslav Kortus 2013-05-28 16:12:51 UTC
Description of problem:
tgt-admin assumes that ACL consists only of IPs, while these can actually be just names (IQNs).

Version-Release number of selected component (if applicable):
scsi-target-utils-1.0.24-2.el6.x86_64

How reproducible:
always

Steps to Reproduce:
1. define a target in tgtd.conf with initiator-name
2. observe that with tgt-admin -s there is the name listed in ACL for the target
3. tgt-admin --update ALL -f -c /etc/tgt/targets.conf
4. command 3 exits with 22

Actual results:
exit code 22
error:
tgtadm: this access control rule does not exist
Command:
	tgtadm -C 0 --op unbind --mode target --tid 13 -I CLUSTER2
exited with code: 22.


Expected results:
ACL removed with -Q

Additional info:

example target:
<target iqn.2008-09.com.example:beaker-disk-2-d1-path1>
direct-store /dev/vg_virts/beaker-disk-2-1
initiator-name CLUSTER2
scsi_id beaker-disk-2-1
scsi_sn beaker-disk-2-1
write-cache off
</target>


The affected line in my case is line 1070 of tgt-admin:
execute("tgtadm -C $control_port --op unbind --mode target --tid $tgtadm_output_tid{$current_     target} -I $acl");

where -I should be (in my case) replaced with -Q (as it's a name and not an address). For general case probably both should be tried and exit code > 0 returned only when both fail.

Comment 2 Andy Grover 2013-05-29 17:54:08 UTC
patch? :-)

Comment 3 Jaroslav Kortus 2013-10-05 18:48:01 UTC
why is this set for me and needinfo? I put all info I had to the description already.

Comment 4 RHEL Program Management 2013-10-14 03:29:32 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 5 Jaroslav Kortus 2015-10-09 13:40:26 UTC
I'm not able to reproduce the buggy behaviour with scsi-target-utils-1.0.24-16.el6.x86_64. I think we can close this for now.