aboutsummaryrefslogtreecommitdiffstats
path: root/meta-application-manager/recipes-application-framework/pkgmgr/files/0002-pkgmgr-initdb.patch
blob: 6dfa9e6b26bd24c451502f7cd34ad3bd8612f21c (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
--- a/tool/pkg_createdb.c
+++ b/tool/pkg_createdb.c
@@ -261,15 +261,21 @@
 	for (i = 0; files[i]; i++) {
 		ret = chown(files[i], GLOBAL_USER, OWNER_ROOT);
 		if (ret == -1) {
+			if (files[i] == journal_file && errno == ENOENT)
+				continue;
 			strerror_r(errno, buf, sizeof(buf));
-			_E("FAIL : chown %s %d.%d, because %s", db_file, GLOBAL_USER, OWNER_ROOT, buf);
+			//_E("FAIL : chown %s %d.%d, because %s", db_file, GLOBAL_USER, OWNER_ROOT, buf);
+			_E("FAIL : chown %s %d.%d, because %s", files[i], GLOBAL_USER, OWNER_ROOT, buf);
 			return -1;
 		}
 
 		ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
 		if (ret == -1) {
+			if (files[i] == journal_file && errno == ENOENT)
+				continue;
 			strerror_r(errno, buf, sizeof(buf));
-			_E("FAIL : chmod %s 0664, because %s", db_file, buf);
+			//_E("FAIL : chmod %s 0664, because %s", db_file, buf);
+			_E("FAIL : chmod %s 0664, because %s", files[i], buf);
 			return -1;
 		}
 	}
@@ -357,7 +363,10 @@
 		return -1;
 	}
 
-	setuid(OWNER_ROOT);
+	ret=setuid(OWNER_ROOT);
+	if(ret!=0){
+		printf("@%d__setuid err = %d\n",__LINE__,errno);
+	}
 	ret = createdb_change_perm(PACKAGE_INFO_DB_FILE);
 	if (ret == -1) {
 		_E("cannot chown.");

--- a/tool/pkg_initdb.c
+++ b/tool/pkg_initdb.c
@@ -208,15 +208,21 @@
 	for (i = 0; files[i]; i++) {
 		ret = chown(files[i], GLOBAL_USER, OWNER_ROOT);
 		if (ret == -1) {
+			if (files[i] == journal_file && errno == ENOENT)
+				continue;
 			strerror_r(errno, buf, sizeof(buf));
-			_E("FAIL : chown %s %d.%d, because %s", db_file, GLOBAL_USER, OWNER_ROOT, buf);
+			//_E("FAIL : chown %s %d.%d, because %s", db_file, GLOBAL_USER, OWNER_ROOT, buf);
+			_E("FAIL : chown %s %d.%d, because %s", files[i], GLOBAL_USER, OWNER_ROOT, buf);
 			return -1;
 		}
 
 		ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
 		if (ret == -1) {
+			if (files[i] == journal_file && errno == ENOENT)
+				continue;
 			strerror_r(errno, buf, sizeof(buf));
-			_E("FAIL : chmod %s 0664, because %s", db_file, buf);
+			//_E("FAIL : chmod %s 0664, because %s", db_file, buf);
+			_E("FAIL : chmod %s 0664, because %s", files[i], buf);
 			return -1;
 		}
 	}