]> git.pld-linux.org Git - packages/MigrationTools.git/blob - MigrationTools-options.patch
- rel 8
[packages/MigrationTools.git] / MigrationTools-options.patch
1 diff -ur MigrationTools-47/migrate_passwd.pl x/migrate_passwd.pl
2 --- MigrationTools-47/migrate_passwd.pl 2009-06-24 13:47:15.299291875 +0200
3 +++ x/migrate_passwd.pl 2009-06-24 16:26:58.000000000 +0200
4 @@ -46,12 +46,20 @@
5  $NAMINGCONTEXT = &getsuffix($PROGRAM);
6  
7  if ($#ARGV < 0) {
8 -       print STDERR "Usage: $PROGRAM [--minuid N] [--maxuid M] infile [outfile]\n";
9 +       print STDERR "Usage: $PROGRAM [options] infile [outfile]\n";
10 +       print STDERR "  Options:\n";
11 +       print STDERR "  --minuid N      Minimal UID number to migrate\n";
12 +       print STDERR "  --maxuid M      Maximal UIF number to migrate\n";
13 +       print STDERR "  --samba         Migrate smbpasswd\n";
14 +       print STDERR "  -s FILE         Path to shadow file (default: /etc/shadow)\n";
15 +       print STDERR "  -S FILE         Path to smbpasswd file (default: /etc/samba/smbpasswd)\n";
16         exit 1;
17  }
18  
19  $do_samba = 0;
20 -while ($ARGV[0] =~ /^--.*/) {
21 +$shadowf = "/etc/shadow";
22 +$smbpassf = "/etc/samba/smbpasswd";
23 +while ($ARGV[0] =~ /^-.*/) {
24         if ($ARGV[0] eq "--minuid") {
25                 $minuid = $ARGV[1];
26                 shift ; shift;
27 @@ -61,6 +69,12 @@
28         } elsif ($ARGV[0] eq "--samba") {
29                 $do_samba = 1;
30                 shift;
31 +       } elsif ($ARGV[0] eq "-s") {
32 +               $shadowf = $ARGV[1];
33 +               shift ; shift;
34 +       } elsif ($ARGV[0] eq "-S") {
35 +               $smbpassf = $ARGV[1];
36 +               shift ; shift;
37         } else {
38                 shift;
39         }
40 @@ -208,7 +222,7 @@
41  
42  sub read_shadow_file
43  {
44 -       open(SHADOW, "/etc/shadow") || return;
45 +       open(SHADOW, $shadowf) || return;
46         while(<SHADOW>) {
47                 chop;
48                 ($shadowUser) = split(/:/, $_);
49 @@ -250,7 +264,7 @@
50  
51  sub read_samba
52  {
53 -       open(INPUT, "</etc/samba/smbpasswd");
54 +       open(INPUT, "<$smbpassf");
55         while (<INPUT>) {
56                 my ($sambaUser, $id, $lmp, $ntp, $f, $lf, $xxx) = split(':');
57                 $sambaUsers{$sambaUser}->{"sambaLMPassword"} = $lmp;
This page took 0.046798 seconds and 4 git commands to generate.