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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 24 Apr 2012 05:54:44 -0700
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Michal Marek <mmarek@...e.cz>
Cc:	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>,
	Arnaud Lacombe <lacombar@...il.com>,
	linux-kbuild@...r.kernel.org
Subject: Re: [PATCH] kbuild: Add error handling to KCONFIG_ALL_CONFIG

Michal Marek <mmarek@...e.cz> writes:

> On Tue, Apr 24, 2012 at 04:57:39AM -0700, Eric W. Biederman wrote:
>>  		name = getenv("KCONFIG_ALLCONFIG");
>> -		if (name && !stat(name, &tmpstat)) {
>> -			conf_read_simple(name, S_DEF_USER);
>> +		if (name && name[0] != '\0') {
>> +			if (conf_read_simple(name, S_DEF_USER)) {
>> +				fprintf(stderr,
>> +					_("*** Can't read seed configuration \"%s\"!\n"),
>> +					name);
>> +				exit(1);
>> +			}
>>  			break;
>>  		}
>>  		switch (input_mode) {
>
>
> Before this patch, the code would fall back to a file named
> all{no,yes,mod,def,random}.config and then to all.config. Now you require
> $KCONFIG_ALLCONFIG to always be a file. I suggest we keep the fallback at
> least for KCONFIG_ALLCONFIG=1, like this:

I don't require KCONFIG_ALLCONFIG to always be a file if it is an
empty string we continue to fallback to the predefined file names.
Which is the currently documented behavior.

As for KCONFIG_ALLCONFIG=1 if people are a actually doing that the
complexity seems worth it (to not break muscle memory and/or scripts).
I was just aiming for an absolutely trivial and simple implementation.

Why do you think people have been specifying KCONFIG_ALLCONFIG=1?
instead of simply exporting KCONFIG_ALLCONFIG with an empty string?

Eric


> diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
> index f208f90..36efc8f 100644
> --- a/scripts/kconfig/conf.c
> +++ b/scripts/kconfig/conf.c
> @@ -574,9 +574,17 @@ int main(int ac, char **av)
>  	case alldefconfig:
>  	case randconfig:
>  		name = getenv("KCONFIG_ALLCONFIG");
> -		if (name && !stat(name, &tmpstat)) {
> -			conf_read_simple(name, S_DEF_USER);
> -			break;
> +		if (name && name[0] != '\0') {
> +			if (conf_read_simple(name, S_DEF_USER)) {
> +				if (strcmp(name, "1") != 0) {
> +					fprintf(stderr,
> +						_("*** Can't read seed configuration \"%s\"!\n"),
> +						name);
> +					exit(1);
> +				}
> +			} else {
> +				break;
> +			}
>  		}
>  		switch (input_mode) {
>  		case allnoconfig:	name = "allno.config"; break;
> @@ -586,10 +594,13 @@ int main(int ac, char **av)
>  		case randconfig:	name = "allrandom.config"; break;
>  		default: break;
>  		}
> -		if (!stat(name, &tmpstat))
> -			conf_read_simple(name, S_DEF_USER);
> -		else if (!stat("all.config", &tmpstat))
> -			conf_read_simple("all.config", S_DEF_USER);
> +		if (conf_read_simple(name, S_DEF_USER) &&
> +				conf_read_simple("all.config", S_DEF_USER)) {
> +			fprintf(stderr,
> +				_("*** KCONFIG_ALLCONFIG=1 set, but no \"%s\" or \"all.config\" file found\n"),
> +				name);
> +			exit(1);
> +		}
>  		break;
>  	default:
>  		break;
>
>
> And update Documentation/kbuild/kconfig.txt.
>
> Michal
--
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