Skip to content
Snippets Groups Projects
Commit 3d71a4b8 authored by deuce's avatar deuce
Browse files

Skip errored path components and return a root error... LIST really needs

to handle this somehow (but currently doesn't).
Also, remove some debug output.
parent 49af63f3
No related branches found
No related tags found
No related merge requests found
......@@ -2246,7 +2246,6 @@ static int parsepath(char** pp, user_t* user, client_t* client, int* curlib, int
}
while (*p) {
lprintf(LOG_DEBUG, "Parsing '%s'", p);
/* Relative path stuff */
if (strcmp(p, "..") == 0) {
if (dir >= 0)
......@@ -2272,7 +2271,6 @@ lprintf(LOG_DEBUG, "Parsing '%s'", p);
p += 2;
/* Path component */
else if (lib < 0) {
lprintf(LOG_DEBUG, "Finding a lib");
for(lib=0;lib<scfg.total_libs;lib++) {
if(!chk_ar(&scfg,scfg.lib[lib]->ar,user,client))
continue;
......@@ -2291,10 +2289,15 @@ lprintf(LOG_DEBUG, "Finding a lib");
if (lib == scfg.total_libs) {
ret = -1;
lib = -1;
if (strchr(p, '/') != NULL) {
p = strchr(p, '/');
p++;
}
else
p = strchr(p, 0);
}
}
else if (dir < 0) {
lprintf(LOG_DEBUG, "Finding a dir");
for(dir=0;dir<scfg.total_dirs;dir++) {
if(scfg.dir[dir]->lib!=lib)
continue;
......@@ -2315,10 +2318,15 @@ lprintf(LOG_DEBUG, "Finding a dir");
if (dir == scfg.total_dirs) {
ret = -1;
dir = -1;
if (strchr(p, '/') != NULL) {
p = strchr(p, '/');
p++;
}
else
p = strchr(p, 0);
}
}
else { // Filename
lprintf(LOG_DEBUG, "Thats a filename");
if (strchr(p, '/') != NULL) {
ret = -1;
p = strchr(p, '/');
......@@ -2330,7 +2338,6 @@ lprintf(LOG_DEBUG, "Thats a filename");
}
}
}
lprintf(LOG_DEBUG, "ret=%d lib=%d dir=%d fname='%s'\n", ret, lib, dir, fname);
*curdir = dir;
*curlib = lib;
*pp = fname;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment