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:	Mon, 25 Jul 2011 15:53:53 +0200
From:	Michal Marek <mmarek@...e.cz>
To:	Arnaud Lacombe <lacombar@...il.com>
Cc:	linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
	Hiromu Yakura <hiromu1996@...il.com>
Subject: Re: [PATCH] xconfig: merge code path to conf_write()

On 25.5.2011 15:18, Michal Marek wrote:
> The following patch avoids the data loss if the configuration cannot be
> saved.
>
> Michal
>
> Subject: [PATCH] xconfig: Abort close if configuration cannot be saved
>
> Give the user an opportunity to fix the error or save the configuration
> under a different path.
>
> Reported-by: Hiromu Yakura<hiromu1996@...il.com>
> Signed-off-by: Michal Marek<mmarek@...e.cz>

I completely forgot about this patch. It's applied now and will be in 3.1.

Michal
>
> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> index c2796b8..92bf576 100644
> --- a/scripts/kconfig/qconf.cc
> +++ b/scripts/kconfig/qconf.cc
> @@ -1478,10 +1478,13 @@ void ConfigMainWindow::loadConfig(void)
>   	ConfigView::updateListAll();
>   }
>
> -void ConfigMainWindow::saveConfig(void)
> +bool ConfigMainWindow::saveConfig(void)
>   {
> -	if (conf_write(NULL))
> +	if (conf_write(NULL)) {
>   		QMessageBox::information(this, "qconf", _("Unable to save configuration!"));
> +		return false;
> +	}
> +	return true;
>   }
>
>   void ConfigMainWindow::saveConfigAs(void)
> @@ -1642,7 +1645,11 @@ void ConfigMainWindow::closeEvent(QCloseEvent* e)
>   	mb.setButtonText(QMessageBox::Cancel, _("Cancel Exit"));
>   	switch (mb.exec()) {
>   	case QMessageBox::Yes:
> -		saveConfig();
> +		if (saveConfig())
> +			e->accept();
> +		else
> +			e->ignore();
> +		break;
>   	case QMessageBox::No:
>   		e->accept();
>   		break;
> diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
> index 91677d9..3715b3e 100644
> --- a/scripts/kconfig/qconf.h
> +++ b/scripts/kconfig/qconf.h
> @@ -311,7 +311,7 @@ public slots:
>   	void listFocusChanged(void);
>   	void goBack(void);
>   	void loadConfig(void);
> -	void saveConfig(void);
> +	bool saveConfig(void);
>   	void saveConfigAs(void);
>   	void searchConfig(void);
>   	void showSingleView(void);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
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