mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Romain Lievin <romain@rlievin.dyndns.org>
To: Ozan Eren Bilgen <oebilgen@uekae.tubitak.gov.tr>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Roman Zippel <zippel@linux-m68k.org>
Subject: [PATCH] "gconfig" removed root folder...
Date: Thu, 15 Jan 2004 22:44:16 +0100	[thread overview]
Message-ID: <20040115214416.GA25409@rlievin.dyndns.org> (raw)
In-Reply-To: <1074177405.3131.10.camel@oebilgen>

Hi,

> Today I downloaded 2.6.1 kernel and tried to configure it with "make
> gconfig". After all changes I selected "Save As" and clicked "/root"
> folder to save in. Then I clicked "OK", without giving a file name. I
> expected that it opens root folder and lists contents. But this magic
> configurator removed (rm -Rf) my root folder and created a file named
> "root". It was a terrible experience!..

A patch against 2.6.1 which fix this problem. Please apply...

Thanks, 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-15 22:36:55.000000000 +0100
@@ -23,6 +23,9 @@
 #include <unistd.h>
 #include <time.h>
 #include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
 
 //#define DEBUG
 
@@ -643,9 +646,18 @@
 store_filename(GtkFileSelection * file_selector, gpointer user_data)
 {
 	const gchar *fn;
+	gchar trailing;
+	struct stat sb;
 
 	fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION
 					     (user_data));
+	
+	/* protect against 'root directory' bug */
+	trailing = fn[strlen(fn)-1];
+	if(stat(fn, &sb) == -1) return;	
+	if(S_ISDIR(sb.st_mode))
+		if(trailing != '/')
+			strcat((char *)fn, "/");
 
 	if (conf_write(fn))
 		text_insert_msg("Error", "Unable to save configuration !");

-- 
Romain Liévin (roms):         <roms@tilp.info>
Web site:                     http://tilp.info
"Linux, y'a moins bien mais c'est plus cher !"







  parent reply	other threads:[~2004-01-15 21:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-15 14:36 True story: " Ozan Eren Bilgen
2004-01-15 15:05 ` Roman Zippel
2004-01-15 15:20   ` Doug McNaught
2004-01-15 15:37     ` Erik Hensema
2004-01-15 16:07       ` Tim Cambrant
2004-01-15 16:17         ` Valdis.Kletnieks
2004-01-15 18:31           ` Tim Cambrant
2004-01-15 18:49             ` Valdis.Kletnieks
2004-01-15 19:00             ` Richard B. Johnson
2004-01-15 19:30               ` Valdis.Kletnieks
2004-01-15 19:48               ` Erik Hensema
2004-01-17 16:47       ` Alban Browaeys
2004-01-16 17:20     ` Max Valdez
2004-01-15 21:23   ` Romain Lievin
2004-01-15 21:46     ` Roman Zippel
2004-01-15 22:00       ` Andreas Tolfsen
2004-01-15 22:56         ` Roman Zippel
2004-01-16  6:39           ` Andreas Tolfsen
2004-01-16  7:43       ` Romain Lievin
2004-01-16 21:18         ` Doug McNaught
2004-01-16 21:44         ` Roman Zippel
2004-01-18 12:59           ` Romain Lievin
2004-01-15 15:40 ` viro
2004-01-15 16:01   ` Jan-Benedict Glaw
2004-01-15 21:05 ` Romain Lievin
2004-01-15 21:44 ` Romain Lievin [this message]
2004-01-16 20:17   ` [PATCH] Bug in patch of Romain: " oebilgen
2004-01-16 20:32     ` [PATCH] Bug in patch of Romain: "gconfig" remo ved r=?iso-8859-9?Q?Romain: "gconfig" removed=A0root=A0folder..._?= (part 2) oebilgen
2004-01-16 21:56   ` [PATCH] "gconfig" removed root folder Roman Zippel
     [not found]   ` <20040116161440.GC30349@louise.pinerecords.com>
2004-01-17 21:47     ` Romain Lievin
2004-01-18  7:24       ` Tomas Szepe
2004-01-18 14:21 ` True story: " Romain Lievin
2004-01-18 14:32   ` Muli Ben-Yehuda
2004-01-21 19:54 ` [PATCH] " Romain Lievin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040115214416.GA25409@rlievin.dyndns.org \
    --to=romain@rlievin.dyndns.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oebilgen@uekae.tubitak.gov.tr \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®