]> git.pld-linux.org Git - packages/MigrationTools.git/blob - MigrationTools-options.patch
- drop obsolete and outdated manual inclusion of rpm macros
[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,11 +46,21 @@
5  $NAMINGCONTEXT = &getsuffix($PROGRAM);
6  
7  if ($#ARGV < 0) {
8 -       print STDERR "Usage: $PROGRAM [--minuid N] [--maxuid M] [--mingid N] [--maxgid 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 UID number to migrate\n";
13 +       print STDERR "  --mingid N      Minimal GID number to migrate\n";
14 +       print STDERR "  --maxgid M      Maximal GID number to migrate\n";
15 +       print STDERR "  --samba         Migrate smbpasswd\n";
16 +       print STDERR "  -s FILE         Path to shadow file (default: /etc/shadow)\n";
17 +       print STDERR "  -S FILE         Path to smbpasswd file (default: /etc/samba/smbpasswd)\n";
18         exit 1;
19  }
20  
21  $do_samba = 0;
22 +$shadowf = "/etc/shadow";
23 +$smbpassf = "/etc/samba/smbpasswd";
24  if ( defined($IGNORE_UID_BELOW) ) {
25         $minuid = $IGNORE_UID_BELOW;
26  }
27 @@ -55,7 +56,7 @@
28  if ( defined($IGNORE_GID_ABOVE) ) {
29         $maxgid = $IGNORE_GID_ABOVE;
30  }
31 -while ($ARGV[0] =~ /^--.*/) {
32 +while ($ARGV[0] =~ /^-.*/) {
33         if ($ARGV[0] eq "--minuid") {
34                 $minuid = $ARGV[1];
35                 shift ; shift;
36 @@ -61,6 +69,12 @@
37         } elsif ($ARGV[0] eq "--samba") {
38                 $do_samba = 1;
39                 shift;
40 +       } elsif ($ARGV[0] eq "-s") {
41 +               $shadowf = $ARGV[1];
42 +               shift ; shift;
43 +       } elsif ($ARGV[0] eq "-S") {
44 +               $smbpassf = $ARGV[1];
45 +               shift ; shift;
46         } else {
47                 shift;
48         }
49 @@ -208,7 +222,7 @@
50  
51  sub read_shadow_file
52  {
53 -       open(SHADOW, "/etc/shadow") || return;
54 +       open(SHADOW, $shadowf) || return;
55         while(<SHADOW>) {
56                 chop;
57                 ($shadowUser) = split(/:/, $_);
58 @@ -250,7 +264,7 @@
59  
60  sub read_samba
61  {
62 -       open(INPUT, "</etc/samba/smbpasswd");
63 +       open(INPUT, "<$smbpassf");
64         while (<INPUT>) {
65                 my ($sambaUser, $id, $lmp, $ntp, $f, $lf, $xxx) = split(':');
66                 $sambaUsers{$sambaUser}->{"sambaLMPassword"} = $lmp;
This page took 0.08459 seconds and 3 git commands to generate.