Parent Directory | Revision Log | Revision Graph
Don't re-use uids when adding users. Bug 5659.
1 | --- e-smith-lib-2.0.0/root/usr/lib/perl5/site_perl/esmith/AccountsDB.pm.bak 2009-01-28 16:13:40.000000000 +0100 |
2 | +++ e-smith-lib-2.0.0/root/usr/lib/perl5/site_perl/esmith/AccountsDB.pm 2009-01-28 16:18:14.000000000 +0100 |
3 | @@ -435,14 +435,17 @@ |
4 | use esmith::ConfigDB; |
5 | |
6 | my $id; |
7 | - if (my $db = esmith::ConfigDB->open_ro) |
8 | + my $db = esmith::ConfigDB->open || die "Couldn't open config db"; |
9 | + |
10 | + if ($id = $db->get('MinUid')) |
11 | + { |
12 | + $id = $id->value(); |
13 | + } |
14 | + else |
15 | { |
16 | - if ($id = $db->get('MinUid')) |
17 | - { |
18 | - $id = $id->value(); |
19 | - } |
20 | + $db->new_record('MinUid'); |
21 | + $id = 5000; |
22 | } |
23 | - $id ||= 5000; |
24 | |
25 | my $maxid = 1 << 31; |
26 | setpwent(); |
27 | @@ -454,6 +457,9 @@ |
28 | } |
29 | endpwent(); |
30 | endgrent(); |
31 | + |
32 | + $db->set_value('MinUid', $id + 1); |
33 | + |
34 | return $id; |
35 | } |
36 |
admin@koozali.org | ViewVC Help |
Powered by ViewVC 1.2.1 |