Skip to contentSkip to conversation

"tgtadm --mode system --show" doesn't show global 'outgoing' users if there are no global incoming users

DISCUSSION Phillip Brown 2 participants 3 messages Aug 15, 2014 – Aug 22, 2014

lore
Share & tools
lore
#0 lore raw

Note - I am not subscribed to the mailing list

Noticed that if there are 'outgoing' users but no 'incoming' users bound at system level, then tgtadm --mode system --show does not show the outgoing users. c.f. at target level where targets show outgoing users even if there are no incoming users

[root@filer3 init.d]# tgtadm --op show --mode sys
System:
State: ready
LLDs:
iser: error
iscsi: ready
Backing stores:
rdwr (bsoflags sync:direct)
aio
ssc
null
bsg
sg
Device types:
passthrough
tape
changer
controller
osd
cd/dvd
disk
iSNS:

       iSNS=Off
       iSNSServerIP=
       iSNSServerPort=3205
       iSNSAccessControl=Off

[root@filer3 init.d]# tgtadm --lld iscsi --mode account --op new --user test --password testpass [root@filer3 init.d]# tgtadm --mode account --op bind --user test --outgoing [root@filer3 init.d]# tgtadm --mode sys --op show
System:
State: ready
LLDs:
iser: error
iscsi: ready
Backing stores:
rdwr (bsoflags sync:direct)
aio
ssc
null
bsg
sg
Device types:
passthrough
tape
changer
controller
osd
cd/dvd
disk
iSNS: * Account info for outg**oing user should be here*

       iSNS=Off
       iSNSServerIP=
       iSNSServerPort=3205
       iSNSAccessControl=Off

[root@filer3 init.d]# tgtadm --mode account --op bind --user test [root@filer3 init.d]# tgtadm --mode sys --op show System:
State: ready
LLDs:
iser: error
iscsi: ready
Backing stores:
rdwr (bsoflags sync:direct)
aio
ssc
null
bsg
sg
Device types:
passthrough
tape
changer
controller
osd
cd/dvd
disk
Account information:
test
test (outgoing)
iSNS:

       iSNS=Off
       iSNSServerIP=
       iSNSServerPort=3205
       iSNSAccessControl=Off

[root@filer3 init.d]#

Problem seems to be with this 'if' statement in targets.c:system_show function

--------->> if (global_target.account.nr_inaccount) {
                               int i, aid;
                               concat_printf(b, _TAB1 "%s\n", "Account 
information:\n");
                               for (i = 0; i < 

global_target.account.nr_inaccount; i++) {
aid =
global_target.account.in_aids[i];
concat_printf(b, _TAB1
"%s\n",

           __account_lookup_id(aid)->user);
                               }
                               if (global_target.account.out_aid) {
                                               aid = 
global_target.account.out_aid;
                                               concat_printf(b, _TAB1 
"%s (outgoing)\n",
           __account_lookup_id(aid)->user);
                               }
               }

Does there really need to be that test?

regards

Phillip Brown

#1 lore raw

Hi,

Quoted 18 lines · On Fri, 15 Aug 2014 16:39:18 +1000 Phillip Brown <[email protected]>…

Problem seems to be with this 'if' statement in targets.c:system_show function

--------->> if (global_target.account.nr_inaccount) {
                               int i, aid;
                               concat_printf(b, _TAB1 "%s\n", "Account information:\n");
                               for (i = 0; i < global_target.account.nr_inaccount; i++) {
                                               aid = global_target.account.in_aids[i];
                                               concat_printf(b, _TAB1 "%s\n",
           __account_lookup_id(aid)->user);
                               }
                               if (global_target.account.out_aid) {
                                               aid = global_target.account.out_aid;
                                               concat_printf(b, _TAB1 "%s (outgoing)\n",
           __account_lookup_id(aid)->user);
                               }
               }
Quoted 1 line

Does there really need to be that test?

Probably, I wrote the above code but can't recall why. Looks like we can remove the above 'if'. Can you send a patch?

Thanks!

#2 lore raw
Quoted 23 lines · On Fri, 22 Aug 2014 19:23:17 +0900 (JST) FUJITA Tomonori…

Hi,

Quoted 18 lines · On Fri, 15 Aug 2014 16:39:18 +1000 Phillip Brown <[email protected]>…

Problem seems to be with this 'if' statement in targets.c:system_show function

--------->> if (global_target.account.nr_inaccount) {
                               int i, aid;
                               concat_printf(b, _TAB1 "%s\n", "Account information:\n");
                               for (i = 0; i < global_target.account.nr_inaccount; i++) {
                                               aid = global_target.account.in_aids[i];
                                               concat_printf(b, _TAB1 "%s\n",
           __account_lookup_id(aid)->user);
                               }
                               if (global_target.account.out_aid) {
                                               aid = global_target.account.out_aid;
                                               concat_printf(b, _TAB1 "%s (outgoing)\n",
           __account_lookup_id(aid)->user);
                               }
               }
Quoted 4 lines
Quoted 1 line

Does there really need to be that test?

Probably, I wrote the above code but can't recall why. Looks like we can remove the above 'if'. Can you send a patch?

Now I recalled.

With one-way CHAP authentication, a target authenticate initiators (in account). The opposite is not supported. So if an out account always needs in account(s).