Bugfix: mkraid

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

--- raidtools-1.00.3/mkraid.c_orig      2003-07-11 16:49:23.000000000 +0200
+++ raidtools-1.00.3/mkraid.c   2003-07-11 17:15:24.000000000 +0200
@@ -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_)

--- raidtools-1.00.3/raid_io.c_orig     2003-07-11 16:09:43.000000000 +0200
+++ raidtools-1.00.3/raid_io.c  2003-07-11 17:15:25.000000000 +0200
@@ -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

-- 
+++ 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux