1 |
vip-ire |
1.1 |
--- e-smith-samba-2.2.0/root/etc/e-smith/db/accounts/migrate/40MachineUid.migrate_machine_uid 2010-11-30 19:53:06.000000000 +0100 |
2 |
|
|
+++ e-smith-samba-2.2.0/root/etc/e-smith/db/accounts/migrate/40MachineUid 2010-11-30 19:53:13.000000000 +0100 |
3 |
|
|
@@ -0,0 +1,14 @@ |
4 |
|
|
+{ |
5 |
|
|
+ foreach my $machine ($DB->get_all_by_prop(type => 'machine')) |
6 |
|
|
+ { |
7 |
|
|
+ next if defined $machine->prop('Uid'); |
8 |
|
|
+ |
9 |
|
|
+ my ($uid, $gid) = (getpwnam($machine->key))[2,3]; |
10 |
|
|
+ |
11 |
|
|
+ next unless defined $uid; |
12 |
|
|
+ $machine->set_prop('Uid', $uid); |
13 |
|
|
+ |
14 |
|
|
+ next unless $gid != $uid; |
15 |
|
|
+ $machine->set_prop('Gid', $gid); |
16 |
|
|
+ } |
17 |
|
|
+} |