Warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Input is not proper UTF-8, indicate encoding !
Bytes: 0xA0 0x5C 0x26 0x71 in Entity, line: 46 in /srv/lkml.org/scripts/getmail.php on line 206
Warning: XSLTProcessor::transformToXml() expects parameter 1 to be object, boolean given in /srv/lkml.org/scripts/getmail.php on line 209
This message generated a parse failure. Raw output follows here. Please use 'back' to navigate.
From devnull@lkml.org Thu Aug 21 09:20:48 2008
Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261606AbUAROVx (ORCPT ); Sun, 18 Jan 2004 09:21:53 -0500
Received: from smtp1.wanadoo.fr ([193.252.22.30]:34232 "EHLO mwinf0102.wanadoo.fr") by vger.kernel.org with ESMTP id S261605AbUAROVv (ORCPT ); Sun, 18 Jan 2004 09:21:51 -0500
Received: from hardy.romsnet (AGrenoble-203-1-6-167.w81-49.abo.wanadoo.fr [81.49.8.167]) by mwinf0102.wanadoo.fr (SMTP Server) with ESMTP id 1ED331BFFFBA; Sun, 18 Jan 2004 15:21:50 +0100 (CET)
Received: from romain by hardy.romsnet with local (Exim 3.36 #1 (Debian)) id 1AiDoD-0000az-00; Sun, 18 Jan 2004 15:21:49 +0100
Date: Sun, 18 Jan 2004 15:21:48 +0100
From: Romain Lievin
To: Ozan Eren Bilgen
Cc: Linux Kernel Mailing List
Subject: True story: "gconfig" removed root folder...
Message-Id: <20040118142148.GB2273@rlievin.dyndns.org>
References: <1074177405.3131.10.camel@oebilgen>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <1074177405.3131.10.camel@oebilgen>
User-Agent: Mutt/1.5.5.1+cvs20040105i
Sender: linux-kernel-owner@vger.kernel.org
Precedence: bulk
X-Mailing-List: linux-kernel@vger.kernel.org
Hi,
a patch for gconfig against kernel2.6.1.
Thanks to Tomas and Ozan.
Romain.
================ [ cut here ] ===========
diff -Naur linux-2.6.1/scripts/kconfig/gconf.c linux/scripts/kconfig/gconf.c
--- linux-2.6.1/scripts/kconfig/gconf.c 2004-01-15 21:45:22.000000000 +0100
+++ linux/scripts/kconfig/gconf.c 2004-01-18 15:15:23.000000000 +0100
@@ -23,6 +23,9 @@
#include
#include
#include
+#include
+#include
+
//#define DEBUG
@@ -643,14 +646,29 @@
store_filename(GtkFileSelection * file_selector, gpointer user_data)
{
const gchar *fn;
+ gchar trailing;
+ gchar *safe_fn;
+ struct stat sb;
- fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION
+ fn = gtk_file_selection_get_filename (GTK_FILE_SELECTION
(user_data));
- if (conf_write(fn))
- text_insert_msg("Error", "Unable to save configuration !");
+ /* protect against 'root directory' bug */
+ trailing = fn[strlen (fn)-1];
+ stat (fn, &sb);
+ safe_fn = g_strdup (fn);
+
+ if (S_ISDIR(sb.st_mode))
+ if (trailing != '/')
+ {
+ g_free (safe_fn);
+ safe_fn = g_strconcat (fn, "/", NULL);
+ }
- gtk_widget_destroy(GTK_WIDGET(user_data));
+ if (conf_write (safe_fn))
+ text_insert_msg("Error", "Unable to save configuration !");
+ g_free (safe_fn);
+ gtk_widget_destroy (GTK_WIDGET(user_data));
}
void on_save_as1_activate(GtkMenuItem * menuitem, gpointer user_data)
--
Romain Li�vin (roms):
Web site: http://tilp.info
"Linux, y'a moins bien mais c'est plus cher !"
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/