wget: fix for code 302; mount: support -o union

Signed-off-by: Vladimir Dronnikov <dronnikov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Vladimir Dronnikov 2009-10-05 02:18:01 +02:00 committed by Denys Vlasenko
parent 301f5ecb8d
commit be168b1197
2 changed files with 9 additions and 1 deletions

View File

@ -370,8 +370,10 @@ static void parse_url(char *src_url, struct host_info *h)
h->path = sp; h->path = sp;
} }
// We used to set h->user to NULL here, but this interferes
// with handling of code 302 ("object was moved")
sp = strrchr(h->host, '@'); sp = strrchr(h->host, '@');
h->user = NULL;
if (sp != NULL) { if (sp != NULL) {
h->user = h->host; h->user = h->host;
*sp = '\0'; *sp = '\0';
@ -692,6 +694,7 @@ int wget_main(int argc UNUSED_PARAM, char **argv)
/* TODO: compat issue: should handle "wget URL1 URL2..." */ /* TODO: compat issue: should handle "wget URL1 URL2..." */
target.user = NULL;
parse_url(argv[optind], &target); parse_url(argv[optind], &target);
/* Use the proxy if necessary */ /* Use the proxy if necessary */

View File

@ -19,6 +19,9 @@
#include <mntent.h> #include <mntent.h>
#include <syslog.h> #include <syslog.h>
#include <sys/mount.h> #include <sys/mount.h>
#ifndef MS_UNION
# define MS_UNION (1 << 8)
#endif
#ifndef MS_BIND #ifndef MS_BIND
# define MS_BIND (1 << 12) # define MS_BIND (1 << 12)
#endif #endif
@ -177,6 +180,7 @@ static const int32_t mount_options[] = {
/* "loud" */ ~MS_SILENT, /* "loud" */ ~MS_SILENT,
// action flags // action flags
/* "union" */ MS_UNION,
/* "bind" */ MS_BIND, /* "bind" */ MS_BIND,
/* "move" */ MS_MOVE, /* "move" */ MS_MOVE,
/* "shared" */ MS_SHARED, /* "shared" */ MS_SHARED,
@ -231,6 +235,7 @@ static const char mount_option_str[] =
"loud\0" "loud\0"
// action flags // action flags
"union\0"
"bind\0" "bind\0"
"move\0" "move\0"
"shared\0" "shared\0"