Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Conversation

@bergwolf
Copy link
Member

@bergwolf bergwolf commented Mar 9, 2017

The file volume path also needs to be resolved in a chroot jail.
Also simplify hyper_mkdir_at() and hyper_mkdir_follow_link() a bit.

src/util.c Outdated
if (!strcmp(comp, "..")) {
if (strlen(parent) > strlen(root)) {
/* go back one level */
char *p = strrchr(parent, '/');
Copy link
Contributor

@laijs laijs Mar 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use p - parrent >= strlen(root) rather than strlen(parent) > strlen(root)

When walking .., go back one level of path unless it is root.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
modify hyper_path directly to save one strdup, and move common part of
caller code inside.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
@bergwolf bergwolf force-pushed the symlink_mkdir branch 2 times, most recently from efde2b4 to 7fe201c Compare March 10, 2017 10:45
@bergwolf
Copy link
Member Author

bergwolf commented Apr 6, 2017

hykins failed on network error... retest this please hykins

For both device and fsmap based file volumes, the mountpoints need to
be in chroot jail as well.

Signed-off-by: Peng Tao <bergwolf@gmail.com>
@bergwolf
Copy link
Member Author

bergwolf commented Apr 6, 2017

hykins failed on hyperhq/hyperd#557, retest please, @hykins

@bergwolf
Copy link
Member Author

bergwolf commented Apr 6, 2017

retest this please, @hykins

1 similar comment
@bergwolf
Copy link
Member Author

bergwolf commented Apr 6, 2017

retest this please, @hykins

@laijs laijs merged commit 686708b into hyperhq:master Apr 6, 2017
@bergwolf bergwolf deleted the symlink_mkdir branch May 8, 2017 07:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants