/[smeserver]/rpms/e-smith-lib/sme7/e-smith-lib-2.0.0-UniqueUid.patch
ViewVC logotype

Contents of /rpms/e-smith-lib/sme7/e-smith-lib-2.0.0-UniqueUid.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Sat Feb 20 12:24:56 2010 UTC (14 years, 8 months ago) by snetram
Branch: MAIN
CVS Tags: e-smith-lib-2_0_0-4_el4_sme, HEAD
* Sat Feb 20 2010 Jonathan Martens <smesevrer-bugzilla@snetram.nl> 2.0.0-4.sme
- Add patch (Federico Simoncelli) to prevent re-use of uids. [SME: 4969]

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 RSS 2.0 feed