Skip to contentSkip to conversation

Bugfix: mkraid

PATCH [email protected] 1 participant 1 message Jul 11, 2003 MD RAID

lore
Share & tools
lore
#0 lore raw

Hello,

the following patch is a bugfix for mkraid (from raidtools-1.00.3).

It fixes that a call 'mkraid /dev/md5' will check if /dev/md5 is active and not
if the last entry from the config file is active.

mkraid.c 2003-07-11 17:15:24.000000000 +0200 renamed from mkraid.c_orig 2003-07-11 16:49:23.000000000 +0200 +1 -1
@@ -219,7 +219,7 @@
     while (*args) {
        for (p = cfg_head; p; p = p->next) {
            if (strcmp(p->md_name, *args)) continue;
-           if (check_active(cfg)) 
+           if (check_active(p)) 
                goto abort;
            if (force_flag) {
                fprintf(stderr, "DESTROYING the contents of %s in 5 seconds,

Ctrl-C if unsure!\n", *args);

And another little patch for against SEGV when called with a very long cmdline (e.g. /dev/md_this_is_very_long_md_device_and_longer_than_MAX_LINE_LENGTH_)

raid_io.c 2003-07-11 17:15:25.000000000 +0200 renamed from raid_io.c_orig 2003-07-11 16:09:43.000000000 +0200 +1 -1
@@ -522,7 +522,7 @@
 
        if ((ch = strstr(p->md_name, "/md")) == NULL)
                return 0;
-       strcpy(buffer, ch+1);
+       strncpy(buffer, MAX_LINE_LENGTH, ch+1);
        if ((fp = fopen("/proc/mdstat", "r")) == NULL)
                return 0;
        while (1) {

Peter

Signature · 8 lines
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++

Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!

-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html