blob: e2db2342e2a46b483174fde644a31beab373585b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
diff -NuarwbB nss_db-2.2.3pre1.orig/src/db-compat.c nss_db-2.2.3pre1/src/db-compat.c
--- nss_db-2.2.3pre1.orig/src/db-compat.c 2005-06-07 00:08:39.000000000 -0700
+++ nss_db-2.2.3pre1/src/db-compat.c 2005-06-07 00:53:00.000000000 -0700
@@ -20,6 +20,9 @@
#include <assert.h>
#include <db.h>
#include <fcntl.h>
+#include <unistd.h>
+#include <sys/types.h>
+
#if DB_VERSION_MAJOR > 2
@@ -39,8 +42,13 @@
if (err)
return err;
+ uid_t uid = geteuid();
+
+ if(uid == 0) {
/* Make sure we upgrade, in case this is an older database */
+ /* However we need root access to do so */
db->upgrade(db, file, 0);
+ }
err = db->open (db, NULL, file, NULL, type, flags, mode);
if (err)
|