diff -ruN module-init-tools-3.1-pre5.orig/modprobe.c module-init-tools-3.1-pre5/modprobe.c
--- module-init-tools-3.1-pre5.orig/modprobe.c	2004-07-21 01:21:36.000000000 +0200
+++ module-init-tools-3.1-pre5/modprobe.c	2004-07-21 01:21:32.000000000 +0200
@@ -38,6 +38,7 @@
 #include <asm/unistd.h>
 #include <sys/wait.h>
 #include <syslog.h>
+#include <regex.h>
 
 #define streq(a,b) (strcmp((a),(b)) == 0)
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
@@ -1052,6 +1053,20 @@
 	return 1;
 }
 
+/* Is the name of this file or directory acceptable to us? */
+static int valid_file_name(const char *filename)
+{
+    static regex_t *re = NULL;
+
+    if (!re) {
+	re = NOFAIL(malloc(sizeof(regex_t)));
+	if (regcomp(re, "(^\\.|^CVS|(\\.dpkg-(old|dist|new)|~|,v)$)",
+		    REG_EXTENDED|REG_NOSUB) != 0)
+	    fatal("regcomp failed: %s\n", strerror(errno));
+    }
+    return regexec(re, filename, 0, NULL, 0);
+}
+
 /* Simple format, ignore lines starting with #, one command per line.
    Returns NULL or resolved alias. */
 static int read_config(const char *filename,
@@ -1074,7 +1089,7 @@
 		struct dirent *i;
 
 		while ((i = readdir(dir)) != NULL) {
-			if (!streq(i->d_name,".") && !streq(i->d_name,"..")) {
+			if (valid_file_name(i->d_name)) {
 				char sub[strlen(filename) + 1
 					 + strlen(i->d_name) + 1];
 
