Latest ipv6 changes broke (deprecated) smbmount, smbmnt and smbctool
authorGünter Kukkukk <linux@kukkukk.com>
Sun, 14 Oct 2007 23:16:01 +0000 (01:16 +0200)
committerVolker Lendecke <vl@sernet.de>
Mon, 15 Oct 2007 10:31:21 +0000 (12:31 +0200)
In addition some cleanup has been done to avoid compiler warnings.

source/client/smbctool.c
source/client/smbmnt.c
source/client/smbmount.c

index 28122d843033a4cbf1b282dae855e47a1989957d..4390ee3fc59d14b923d90f306526455898223451 100644 (file)
@@ -3485,7 +3485,7 @@ static int do_message_op(void)
        snprintf(name_type_hex, sizeof(name_type_hex), "#%X", name_type);
        fstrcat(server_name, name_type_hex);
 
-               zero_ip(&ip);
+               zero_ip_v4(&ip);
        if (have_ip) 
                ip = dest_ip;
 
@@ -3596,7 +3596,7 @@ static int do_message_op(void)
                case 'I':
                        {
                                dest_ip = *interpret_addr2(poptGetOptArg(pc));
-                               if (is_zero_ip(dest_ip))
+                               if (is_zero_ip_v4(dest_ip))
                                        exit(1);
                                have_ip = True;
 
index c9759f4fd1b598da58f1731b971edc2ae0119638..08dcac8bec0b3e7297072c3b9530f5d5bf9e08f2 100644 (file)
@@ -272,10 +272,10 @@ do_mount(char *share_name, unsigned int flags, struct smb_mount_data *data)
                return -1;
        }
 
-        ment.mnt_fsname = share_name ? share_name : "none";
+        ment.mnt_fsname = share_name ? share_name : (char *)"none";
         ment.mnt_dir = mount_point;
-        ment.mnt_type = "smbfs";
-        ment.mnt_opts = "";
+        ment.mnt_type = (char *)"smbfs";
+        ment.mnt_opts = (char *)"";
         ment.mnt_freq = 0;
         ment.mnt_passno= 0;
 
index b68dbfe346299365c0541f4f8432587e90bbc528..d2a4b9a9099b2fabb683f7528c8f1ab58a549101 100644 (file)
@@ -146,7 +146,7 @@ static struct cli_state *do_connection(char *the_service)
        make_nmb_name(&called , server, 0x20);
 
  again:
-        zero_ip(&ip);
+        zero_ip_v4(&ip);
        if (have_ip) ip = dest_ip;
 
        /* have to open a new connection */
@@ -435,7 +435,7 @@ static void init_mount(void)
        pstring tmp;
        pstring svc2;
        struct cli_state *c;
-       char *args[20];
+       const char *args[20];
        int i, status;
 
        if (realpath(mpoint, mount_point) == NULL) {
@@ -503,12 +503,12 @@ static void init_mount(void)
                asprintf(&smbmnt_path, "%s/smbmnt", dyn_BINDIR);
                
                if (file_exist(smbmnt_path, NULL)) {
-                       execv(smbmnt_path, args);
+                       execv(smbmnt_path, (char * const *)args);
                        fprintf(stderr,
                                "smbfs/init_mount: execv of %s failed. Error was %s.",
                                smbmnt_path, strerror(errno));
                } else {
-                       execvp("smbmnt", args);
+                       execvp("smbmnt", (char * const *)args);
                        fprintf(stderr,
                                "smbfs/init_mount: execv of %s failed. Error was %s.",
                                "smbmnt", strerror(errno));
@@ -799,7 +799,7 @@ static void parse_mount_smb(int argc, char **argv)
                                DEBUGLEVEL = val;
                        } else if(!strcmp(opts, "ip")) {
                                dest_ip = *interpret_addr2(opteq+1);
-                               if (is_zero_ip(dest_ip)) {
+                               if (is_zero_ip_v4(dest_ip)) {
                                        fprintf(stderr,"Can't resolve address %s\n", opteq+1);
                                        exit(1);
                                }