summaryrefslogtreecommitdiff
path: root/packaging/Caldera/OpenLinux/convertsmbpasswd.perl
blob: 6b83886cd4da16606aba06f8523732ed3fe4d6db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/perl -w
#
# 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 the time of conversion.
while ( <> ) {
  @V = split(/:/);
  if ( ! /^\#/ ) {
    $V[6] = $V[4] . "\n";
    $V[5] = sprintf( "LCT-%X", time());
    $V[4] = "[U          ]";
  }
  print( join( ':', @V));
}