View | Details | Raw Unified | Return to bug 64183
Collapse All | Expand All

(-)wget-LFS-20040909/src/http.c (+1 lines)
Lines 1719-1724 Link Here
1719
  /* Open the local file.  */
1719
  /* Open the local file.  */
1720
  if (!output_stream)
1720
  if (!output_stream)
1721
    {
1721
    {
1722
      sanitize_path(*hs->local_file);
1722
      mkalldirs (*hs->local_file);
1723
      mkalldirs (*hs->local_file);
1723
      if (opt.backups)
1724
      if (opt.backups)
1724
	rotate_backups (*hs->local_file);
1725
	rotate_backups (*hs->local_file);
(-)wget-LFS-20040909/src/utils.c (+19 lines)
Lines 368-373 Link Here
368
#endif
368
#endif
369
}
369
}
370
370
371
372
char *
373
sanitize_path(char *path)
374
{
375
	char *str = NULL;
376
377
	/* evilhost/../ */
378
	while ((str = strstr(path,  "/..")) != NULL)
379
		memcpy(&str[1], "__", 2);
380
	/* evilhost/.bashrc */
381
	while ((str = strstr(path, "/.")) != NULL)
382
		str[1] = '_';
383
	/* .bashrc */
384
	if (*path == '.')
385
		*path = '_';
386
	return path;
387
}
388
389
371
/* Returns 0 if PATH is a directory, 1 otherwise (any kind of file).
390
/* Returns 0 if PATH is a directory, 1 otherwise (any kind of file).
372
   Returns 0 on error.  */
391
   Returns 0 on error.  */
373
int
392
int
(-)wget-LFS-20040909/src/utils.h (+1 lines)
Lines 83-88 Link Here
83
int make_directory PARAMS ((const char *));
83
int make_directory PARAMS ((const char *));
84
char *unique_name PARAMS ((const char *, int));
84
char *unique_name PARAMS ((const char *, int));
85
char *file_merge PARAMS ((const char *, const char *));
85
char *file_merge PARAMS ((const char *, const char *));
86
char *sanitize_path PARAMS ((char *));
86
87
87
int acceptable PARAMS ((const char *));
88
int acceptable PARAMS ((const char *));
88
int accdir PARAMS ((const char *s, enum accd));
89
int accdir PARAMS ((const char *s, enum accd));

Return to bug 64183