Skip to content

Commit

Permalink
Merge pull request #1031 from trapexit/root-parent
Browse files Browse the repository at this point in the history
Return ENOENT when dotdot for root node requested
  • Loading branch information
trapexit authored Apr 13, 2022
2 parents 77e6f40 + 14c2ff9 commit d9ab182
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libfuse/lib/fuse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2037,11 +2037,11 @@ fuse_lib_lookup(fuse_req_t req,
uint64_t parent,
const char *name)
{
struct fuse *f = req_fuse_prepare(req);
struct fuse_entry_param e;
char *path;
int err;
char *path;
struct node *dot = NULL;
struct fuse *f = req_fuse_prepare(req);
struct fuse_entry_param e = {0};

if(name[0] == '.')
{
Expand All @@ -2061,6 +2061,12 @@ fuse_lib_lookup(fuse_req_t req,
}
else if((name[1] == '.') && (name[2] == '\0'))
{
if(parent == 1)
{
reply_entry(req,&e,-ENOENT);
return;
}

name = NULL;
pthread_mutex_lock(&f->lock);
parent = get_node(f,parent)->parent->nodeid;
Expand Down

0 comments on commit d9ab182

Please sign in to comment.