Re: tgt-admin utility not working anymore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 12 Jan 2014 06:32:19 +0900, FUJITA Tomonori wrote:
> On Sat, 11 Jan 2014 16:16:49 -0500
> nia dev <niadev67@xxxxxxxxx> wrote:
> 
>> This used to work ... Any idea ?
>> 
>> # tgt-admin --dump
>> -C argument value '0' out of range
>> Try `tgtadm --help' for more information.
>> 
>> All other options produce an error also.
> 
> How about the following?
> 
> diff --git a/usr/tgtadm.c b/usr/tgtadm.c
> index a46f1a4..7771119 100644
> --- a/usr/tgtadm.c
> +++ b/usr/tgtadm.c
> @@ -600,7 +600,7 @@ int main(int argc, char **argv)
>  			ac_dir = ACCOUNT_TYPE_OUTGOING;
>  			break;
>  		case 'C':
> -			rc = str_to_int_gt(optarg, control_port, 0);
> +			rc = str_to_int_ge(optarg, control_port, 0);
>  			if (rc)
>  				bad_optarg(rc, ch, optarg);
>  			break;
> --

Sorry about that.

My commit #befd471ef7dcf46b "util.h: correct range check of
str_to_int_gt() and str_to_int_lt()" seems to break the range check.

The same regression seems to be on tgtd side.

Ryusuke Konishi

diff --git a/usr/tgtd.c b/usr/tgtd.c
index 64eff32..50e1c83 100644
--- a/usr/tgtd.c
+++ b/usr/tgtd.c
@@ -537,7 +537,7 @@ int main(int argc, char **argv)
 			is_daemon = 0;
 			break;
 		case 'C':
-			ret = str_to_int_gt(optarg, control_port, 0);
+			ret = str_to_int_ge(optarg, control_port, 0);
 			if (ret)
 				bad_optarg(ret, ch, optarg);
 			break;
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux