* Wed Jul 01 2009 Andrew McNab <Andrew.McNab@cern.ch>
- Tidy up debugging messages
+- Fix URL encoding bug in DN lists (' ' vs '+')
* Tue Jun 30 2009 Andrew McNab <Andrew.McNab@cern.ch>
- ==== GridSite version 1.7.2 ====
* Tue Jun 30 2009 Andrew McNab <Andrew.McNab@cern.ch>
return full path to first found version or NULL on failure */
{
int fd, linestart, i;
- char *fullfilename, *mapped, *q, *s;
+ char *fullfilename, *mapped, *q, *s, *dn_decoded;
size_t dn_len;
struct stat statbuf;
DIR *dirDIR;
if (recurse_level >= GRST_RECURS_LIMIT) return;
- dn_len = strlen(dn_cred->auri) - 3;
-
/* search this directory */
dirDIR = opendir(dir);
if (dirDIR == NULL) return;
+ dn_decoded = GRSThttpUrlDecode(&(dn_cred->auri[3]));
+ dn_len = strlen(dn_decoded);
+
while ((file_ent = readdir(dirDIR)) != NULL)
{
if (file_ent->d_name[0] == '.') continue;
for (i=0;
(linestart + i < statbuf.st_size) && (i < dn_len);
++i)
- if (mapped[linestart + i] != dn_cred->auri[3+i]) break;
+ if (mapped[linestart + i] != dn_decoded[i]) break;
GRSTerrorLog(GRST_LOG_DEBUG, "recurse4dnlists at %d %d %d %d",
linestart, i, dn_len, statbuf.st_size);
if (fd < 0) close(fd);
free(fullfilename);
}
-
+
+ free(dn_decoded);
closedir(dirDIR);
}