lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1345461010-63183-1-git-send-email-tuxillo@quantumachine.net>
Date:	Mon, 20 Aug 2012 13:10:10 +0200
From:	Antonio Huete Jimenez <tuxillo@...il.com>
To:	linux-ext4@...r.kernel.org
Cc:	Antonio Huete Jimenez <tuxillo@...ntumachine.net>,
	Antonio Huete Jimenez <tuxillo@...gonflybsd.org>
Subject: [PATCH] Common BSD tag for FreeBSD, NetBSD, OpenBSD and DragonFly BSD.

- All BSD will appear now as "BSD" under the OS creator field.
- Minor adjustments to multiple #if's

Signed-off-by: Antonio Huete Jimenez <tuxillo@...gonflybsd.org>
---
 lib/e2p/ostype.c        |    2 +-
 lib/ext2fs/ext2_fs.h    |    2 +-
 lib/ext2fs/initialize.c |   19 ++++++-------------
 misc/mke2fs.c           |    8 +++++++-
 4 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/lib/e2p/ostype.c b/lib/e2p/ostype.c
index d002e75..f9105fd 100644
--- a/lib/e2p/ostype.c
+++ b/lib/e2p/ostype.c
@@ -18,7 +18,7 @@ static const char *os_tab[] =
 	{ "Linux",
 	  "Hurd",
 	  "Masix",
-	  "FreeBSD",
+	  "BSD",
 	  "Lites",
 	  0 };
 
diff --git a/lib/ext2fs/ext2_fs.h b/lib/ext2fs/ext2_fs.h
index 5b6e315..3f510f9 100644
--- a/lib/ext2fs/ext2_fs.h
+++ b/lib/ext2fs/ext2_fs.h
@@ -680,7 +680,7 @@ struct ext2_super_block {
 #define EXT2_OS_LINUX		0
 #define EXT2_OS_HURD		1
 #define EXT2_OBSO_OS_MASIX	2
-#define EXT2_OS_FREEBSD		3
+#define EXT2_OS_BSD		3
 #define EXT2_OS_LITES		4
 
 /*
diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
index 80bff0e..79047d9 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -28,23 +28,16 @@
 #include "ext2_fs.h"
 #include "ext2fs.h"
 
-#if defined(__linux__)    &&	defined(EXT2_OS_LINUX)
-#define CREATOR_OS EXT2_OS_LINUX
-#else
-#if defined(__GNU__)     &&	defined(EXT2_OS_HURD)
+#if defined(__GNU__)     &&     defined(EXT2_OS_HURD)
 #define CREATOR_OS EXT2_OS_HURD
-#else
-#if defined(__FreeBSD__) &&	defined(EXT2_OS_FREEBSD)
-#define CREATOR_OS EXT2_OS_FREEBSD
-#else
-#if defined(LITES) 	   &&	defined(EXT2_OS_LITES)
+#elif (defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) \
+    || defined(__DragonFly__)) && defined(EXT2_OS_BSD)
+#define CREATOR_OS EXT2_OS_BSD
+#elif defined(LITES)         &&   defined(EXT2_OS_LITES)
 #define CREATOR_OS EXT2_OS_LITES
 #else
 #define CREATOR_OS EXT2_OS_LINUX /* by default */
-#endif /* defined(LITES) && defined(EXT2_OS_LITES) */
-#endif /* defined(__FreeBSD__) && defined(EXT2_OS_FREEBSD) */
-#endif /* defined(__GNU__)     && defined(EXT2_OS_HURD) */
-#endif /* defined(__linux__)   && defined(EXT2_OS_LINUX) */
+#endif
 
 /*
  * Calculate the number of GDT blocks to reserve for online filesystem growth.
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 072e656..3c03a8d 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -665,7 +665,13 @@ static int set_os(struct ext2_super_block *sb, char *os)
 	else if (strcasecmp(os, "GNU") == 0 || strcasecmp(os, "hurd") == 0)
 		sb->s_creator_os = EXT2_OS_HURD;
 	else if (strcasecmp(os, "freebsd") == 0)
-		sb->s_creator_os = EXT2_OS_FREEBSD;
+		sb->s_creator_os = EXT2_OS_BSD;
+	else if (strcasecmp(os, "netbsd") == 0)
+		sb->s_creator_os = EXT2_OS_BSD;
+	else if (strcasecmp(os, "openbsd") == 0)
+		sb->s_creator_os = EXT2_OS_BSD;
+	else if (strcasecmp(os, "dragonfly") == 0)
+		sb->s_creator_os = EXT2_OS_BSD;
 	else if (strcasecmp(os, "lites") == 0)
 		sb->s_creator_os = EXT2_OS_LITES;
 	else
-- 
1.7.7.2

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ