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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
diff --git a/src/ail_db.c b/src/ail_db.c
index 462c545..5c6bb5e 100755
--- a/src/ail_db.c
+++ b/src/ail_db.c
@@ -134,15 +134,19 @@ static int ail_db_change_perm(const char *db_file, uid_t uid)
ret = chown(files[i], uid, userinfo->pw_gid);
SET_SMACK_LABEL(files[i], uid);
if (ret == -1) {
+ if (files[i] == journal_file && errno == ENOENT)
+ continue;
- _E("FAIL : chown %s %d.%d, because %d", db_file, uid, userinfo->pw_gid, errno);
+ _E("FAIL : chown %s %d.%d, because %s", files[i], uid, userinfo->pw_gid, errno);
free(pwd_buf);
return AIL_ERROR_FAIL;
}
ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (ret == -1) {
+ if (files[i] == journal_file && errno == ENOENT)
+ continue;
- _E("FAIL : chmod %s 0664, because %d", db_file, errno);
+ _E("FAIL : chmod %s 0664, because %s", files[i], errno);
free(pwd_buf);
return AIL_ERROR_FAIL;
}
}
diff --git a/tool/src/ail_fota.c b/tool/src/ail_fota.c
index 20d17c5..c523588 100644
--- a/tool/src/ail_fota.c
+++ b/tool/src/ail_fota.c
@@ -179,15 +179,19 @@ static int initdb_change_perm(const char *db_file)
for (i = 0; files[i]; i++) {
ret = chown(files[i], OWNER_ROOT, 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, OWNER_ROOT, OWNER_ROOT, buf);
+ _E("FAIL : chown %s %d.%d, because %s", files[i], OWNER_ROOT, OWNER_ROOT, buf);
return AIL_ERROR_FAIL;
}
ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | 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", files[i], buf);
return AIL_ERROR_FAIL;
}
}
diff --git a/tool/src/createdb.c b/tool/src/createdb.c
index f203c74..05d101d 100644
--- a/tool/src/createdb.c
+++ b/tool/src/createdb.c
@@ -73,13 +73,17 @@ static int createdb_change_perm(const char *db_file)
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;
- _E("FAIL : chown %s %d.%d, because %d", db_file, OWNER_ROOT, OWNER_ROOT, errno);
+ _E("FAIL : chown %s %d.%d, because %s", files[i], OWNER_ROOT, OWNER_ROOT, errno);
return AIL_ERROR_FAIL;
}
ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (ret == -1) {
+ if (files[i] == journal_file && errno == ENOENT)
+ continue;
- _E("FAIL : chmod %s 0664, because %d", db_file, errno);
+ _E("FAIL : chmod %s 0664, because %s", files[i], errno);
return AIL_ERROR_FAIL;
}
}
diff --git a/tool/src/initdb.c b/tool/src/initdb.c
index 75d5788..79df936 100755
--- a/tool/src/initdb.c
+++ b/tool/src/initdb.c
@@ -143,13 +143,17 @@ static int initdb_change_perm(const char *db_file)
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;
- _E("FAIL : chown %s %d.%d, because %d", db_file, OWNER_ROOT, OWNER_ROOT, errno);
+ _E("FAIL : chown %s %d.%d, because %s", files[i], OWNER_ROOT, OWNER_ROOT, errno);
return AIL_ERROR_FAIL;
}
ret = chmod(files[i], S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
if (ret == -1) {
+ if (files[i] == journal_file && errno == ENOENT)
+ continue;
- _E("FAIL : chmod %s 0664, because %d", db_file, errno);
+ _E("FAIL : chmod %s 0664, because %s", files[i], errno);
return AIL_ERROR_FAIL;
}
}
|