[freenos] [freenos commit] r196 - LinnDump now checks for LINN_SUPER_MAGIC{0|1} bytes.

  • From: codesite-noreply@xxxxxxxxxx
  • To: freenos@xxxxxxxxxxxxx
  • Date: Sat, 04 Jul 2009 21:36:43 +0000

Author: nieklinnenbank
Date: Sat Jul  4 14:36:01 2009
New Revision: 196

Modified:
   trunk/srv/filesystem/linn/LinnDump.cpp

Log:
LinnDump now checks for LINN_SUPER_MAGIC{0|1} bytes.


Modified: trunk/srv/filesystem/linn/LinnDump.cpp
==============================================================================
--- trunk/srv/filesystem/linn/LinnDump.cpp      (original)
+++ trunk/srv/filesystem/linn/LinnDump.cpp      Sat Jul  4 14:36:01 2009
@@ -103,6 +103,14 @@
                argv[0], argv[1], strerror(errno));
        return EXIT_FAILURE;
     }
+    /* Verify magic. */
+    if (super.magic0 != LINN_SUPER_MAGIC0 ||
+        super.magic1 != LINN_SUPER_MAGIC1)
+    {
+       printf("%s: `%s' is not a LinnFS filesystem (magic mismatch)\n",
+               argv[0], argv[1]);
+       return EXIT_FAILURE;
+    }
     /* Dump filesystem information. */
     printf( "LinnSuperBlock\n"
            "[\n"

Other related posts:

  • » [freenos] [freenos commit] r196 - LinnDump now checks for LINN_SUPER_MAGIC{0|1} bytes. - codesite-noreply