Very simple awk script to convert a 1.9.18 password file into Samba 2.0
authorJeremy Allison <jra@samba.org>
Thu, 5 Nov 1998 02:47:50 +0000 (02:47 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 5 Nov 1998 02:47:50 +0000 (02:47 +0000)
password file format.
Jeremy.

source/script/convert_smbpasswd.sh [new file with mode: 0755]

diff --git a/source/script/convert_smbpasswd.sh b/source/script/convert_smbpasswd.sh
new file mode 100755 (executable)
index 0000000..edb775d
--- /dev/null
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Convert a Samba 1.9.18 smbpasswd file format into
+# a Samba 2.0 smbpasswd file format.
+# Read from stdin and write to stdout for simplicity.
+# Set the last change time to 0x363F96AD to avoid problems
+# with trying to work out how to get the seconds since 1970
+# in awk or the shell. JRA.
+#
+nawk 'BEGIN {FS=":"} 
+{
+       if( $0 ~ "^#" ) {
+               print $0
+       } else {
+               printf( "%s:%s:%s:%s:[U          ]:LCT-363F96AD:\n", $1, $2, $3, $4);
+       }
+}'