lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Sun, 19 Apr 2015 12:34:48 +0900
From:	Namhyung Kim <namhyung@...nel.org>
To:	Taewoong Song <treeze.taeung@...il.com>
Cc:	Arnaldo Carvalho de Melo <acme@...nel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	jolsa@...hat.com
Subject: Re: [PATCH 1/2] perf tools: Add 'perf-config' command

On Sat, Apr 18, 2015 at 07:14:06PM +0900, Taewoong Song wrote:
> > On Apr 13, 2015, at 3:16 PM, Namhyung Kim <namhyung@...nel.org> wrote:
> > On Sun, Apr 12, 2015 at 11:44:48PM +0900, Taeung Song wrote:
> >> +static void check_argc(int argc, int limit)
> >> +{
> >> +	if (argc >= limit && argc <= limit)
> >> +		return;
> >> +	error("wrong number of arguments");
> >> +	usage_with_options(config_usage, config_options);
> >> +}
> > 
> > I don't know why this is needed.  The -a option won't need this and we
> > can support to get/set any number of config items IMHO.
> > 
> 
> I also think we can support to get/set any number of config items.
> But I think that ‘—list’ or  ‘—all’ can need to be checked to validate argument.
> If work ‘git —list’ with other argument, error message can be printed like this.
> 
> :> git config --list 134 
> error: wrong number of arguments 
> usage: git config [options] 
> 
> Config file location 
> 	--global use global config file
> 	--system use system config file
> 	--local use repository config file 
> 	-f, --file <file> use given config file
> 	--blob <blob-id> read config from given blob object
> 
> …(omitted)…
> 
> If don’t checking number of argument, we allow users to work a optio
> ‘-a’ or ‘-l’ with other arguments which can be weor meaningless.
> Did I misunderstand what you say?
> Or is there other way to avoid this problem ?

Then just check 'argc != 0' for -l or -a cases.  The get/set won't
need it IMHO.

Thanks,
Namhyung
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ