wget: fix for code 302; mount: support -o union
authorVladimir Dronnikov <dronnikov@gmail.com>
Mon, 5 Oct 2009 00:18:01 +0000 (02:18 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Mon, 5 Oct 2009 00:18:01 +0000 (02:18 +0200)
Signed-off-by: Vladimir Dronnikov <dronnikov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
networking/wget.c
util-linux/mount.c

index b8cd54964e1de165b6aab76a022a192f7852a739..0f99e8d1341e8facc3afdf478d406c95d6ed47b9 100644 (file)
@@ -370,8 +370,10 @@ static void parse_url(char *src_url, struct host_info *h)
                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, '@');
-       h->user = NULL;
        if (sp != NULL) {
                h->user = h->host;
                *sp = '\0';
@@ -692,6 +694,7 @@ int wget_main(int argc UNUSED_PARAM, char **argv)
 
        /* TODO: compat issue: should handle "wget URL1 URL2..." */
 
+       target.user = NULL;
        parse_url(argv[optind], &target);
 
        /* Use the proxy if necessary */
index 9f465f131d107363417f99706231020d6c1fb23c..1c513737642aaf99476194c0565de6f44fa1e594 100644 (file)
@@ -19,6 +19,9 @@
 #include <mntent.h>
 #include <syslog.h>
 #include <sys/mount.h>
+#ifndef MS_UNION
+# define MS_UNION       (1 << 8)
+#endif
 #ifndef MS_BIND
 # define MS_BIND        (1 << 12)
 #endif
@@ -177,6 +180,7 @@ static const int32_t mount_options[] = {
                /* "loud"        */ ~MS_SILENT,
 
                // action flags
+               /* "union"       */ MS_UNION,
                /* "bind"        */ MS_BIND,
                /* "move"        */ MS_MOVE,
                /* "shared"      */ MS_SHARED,
@@ -231,6 +235,7 @@ static const char mount_option_str[] =
                "loud\0"
 
                // action flags
+               "union\0"
                "bind\0"
                "move\0"
                "shared\0"