projects
/
platform
/
core
/
api
/
system-info.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bf97b02
)
update_db : do chdir after chroot
98/125798/1
submit/tizen/20170419.094553
author
Kichan Kwon
<k_c.kwon@samsung.com>
Wed, 19 Apr 2017 02:17:30 +0000
(11:17 +0900)
committer
Kichan Kwon
<k_c.kwon@samsung.com>
Wed, 19 Apr 2017 02:17:30 +0000
(11:17 +0900)
- To prevent from accessing outside of chroot directory
Change-Id: Ia951443f9a0f4da12596640361288519b94a38c6
Signed-off-by: Kichan Kwon <k_c.kwon@samsung.com>
src/update_db/system_info_db_update.c
patch
|
blob
|
history
diff --git
a/src/update_db/system_info_db_update.c
b/src/update_db/system_info_db_update.c
index 98a5764d1906290294c708a6eb47c1c50c4bf2cf..61b7be42a218be4e2821b369bbdfa78542446420 100644
(file)
--- a/
src/update_db/system_info_db_update.c
+++ b/
src/update_db/system_info_db_update.c
@@
-138,6
+138,11
@@
int main(int argc, char *argv[])
printf("Failed to change root dir (%s, errno:%d)\n", root, errno);
return -errno;
}
+ ret = chdir("/");
+ if (ret < 0) {
+ printf("Failed to go to root directory : %s", errno);
+ return -errno;
+ }
pid = fork();
if (pid < 0) {