mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-15 08:05:20 +00:00
open_without_symlink: Account when prefix is empty string
In the current implementation, the open_without_symlink function will default to opening the root mount only if the passed rootfs prefix is null. It doesn't account for the case where this prefix is passed as an empty string. Properly handle this second case as well. Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
This commit is contained in:
parent
020104c3ad
commit
01074e5b34
@ -1575,7 +1575,7 @@ static int open_without_symlink(const char *target, const char *prefix_skip)
|
|||||||
fulllen = strlen(target);
|
fulllen = strlen(target);
|
||||||
|
|
||||||
/* make sure prefix-skip makes sense */
|
/* make sure prefix-skip makes sense */
|
||||||
if (prefix_skip) {
|
if (prefix_skip && strlen(prefix_skip) > 0) {
|
||||||
curlen = strlen(prefix_skip);
|
curlen = strlen(prefix_skip);
|
||||||
if (!is_subdir(target, prefix_skip, curlen)) {
|
if (!is_subdir(target, prefix_skip, curlen)) {
|
||||||
ERROR("WHOA there - target '%s' didn't start with prefix '%s'",
|
ERROR("WHOA there - target '%s' didn't start with prefix '%s'",
|
||||||
|
Loading…
Reference in New Issue
Block a user