File: convert_smbpasswd

package info (click to toggle)
samba 2.2.3a-15
  • links: PTS
  • area: main
  • in suites: woody
  • size: 24,336 kB
  • ctags: 19,246
  • sloc: ansic: 179,555; sh: 6,888; perl: 2,091; makefile: 1,491; awk: 1,143; exp: 1,143; csh: 161
file content (17 lines) | stat: -rwxr-xr-x 446 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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);
	}
}'