Source-Changes-HG archive

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

[src/trunk]: src/share/examples/verifiedexec_load Added verifiedexec_load sig...



details:   https://anonhg.NetBSD.org/src/rev/0a28864c2810
branches:  trunk
changeset: 538765:0a28864c2810
user:      blymn <blymn%NetBSD.org@localhost>
date:      Tue Oct 29 14:05:33 2002 +0000

description:
Added verifiedexec_load signature generator scripts.

diffstat:

 share/examples/verifiedexec_load/Makefile |  12 ++++++++++++
 share/examples/verifiedexec_load/gen_md5  |  23 +++++++++++++++++++++++
 share/examples/verifiedexec_load/gen_sha1 |  23 +++++++++++++++++++++++
 3 files changed, 58 insertions(+), 0 deletions(-)

diffs (70 lines):

diff -r cdea710d2a65 -r 0a28864c2810 share/examples/verifiedexec_load/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/examples/verifiedexec_load/Makefile Tue Oct 29 14:05:33 2002 +0000
@@ -0,0 +1,12 @@
+#      $NetBSD: Makefile,v 1.1 2002/10/29 14:05:33 blymn Exp $
+
+NOOBJ= # defined
+
+.include <bsd.own.mk>
+
+.if ${MKSHARE} != "no"
+FILES= gen_md5 gen_sha1
+FILESDIR=/usr/share/examples/verifiedexec_load
+.endif
+
+.include <bsd.prog.mk>
diff -r cdea710d2a65 -r 0a28864c2810 share/examples/verifiedexec_load/gen_md5
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/examples/verifiedexec_load/gen_md5  Tue Oct 29 14:05:33 2002 +0000
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+#      $NetBSD: gen_md5,v 1.1 2002/10/29 14:05:33 blymn Exp $
+#
+# This is a helper script that scans all the file systems for
+# executables and generates an entry in the signatures file for
+# each one found.  The script is probably best run by root and
+# will move the old signatures file prior to starting the real work.
+#
+mv signatures signatures.old
+echo "Fingerprinting the system, this may take a while...."
+#
+find / \( \( -type f -a \( -perm -0100 -o -perm -0010 -o -perm -0001 \) \) -o -name 'lib*so*' \) -print | while read line
+do
+       echo "Fingerprinting $line"
+       hash=`md5 $line | cut -d'=' -f2 | tr -d ' '`
+       flag=""
+       if [ ! -x $line ]
+       then
+           flag="      FILE"
+       fi
+       echo "$line     md5     ${hash}${flag}" >> signatures
+done
diff -r cdea710d2a65 -r 0a28864c2810 share/examples/verifiedexec_load/gen_sha1
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/share/examples/verifiedexec_load/gen_sha1 Tue Oct 29 14:05:33 2002 +0000
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# $NetBSD: gen_sha1,v 1.1 2002/10/29 14:05:33 blymn Exp $
+#
+# This is a helper script that scans all the file systems for
+# executables and generates an entry in the signatures file for
+# each one found.  The script is probably best run by root and
+# will move the old signatures file prior to starting the real work.
+#
+mv signatures signatures.old
+echo "Fingerprinting the system, this may take a while...."
+#
+find / \( \( -type f -a \( -perm -0100 -o -perm -0010 -o -perm -0001 \) \) -o -name 'lib*so*' \) -print | while read line
+do
+       echo "Fingerprinting $line"
+       hash=`sha1 $line | cut -d'=' -f2 | tr -d ' '`
+       flag=""
+       if [ ! -x $line ]
+       then
+           flag="      FILE"
+       fi
+       echo "$line     sha1    ${hash}${flag}" >> signatures
+done



Home | Main Index | Thread Index | Old Index