Two patches
authorVolker Lendecke <Volker.Lendecke@SerNet.DE>
Sat, 27 Oct 2007 19:15:07 +0000 (21:15 +0200)
committerJeremy Allison <jra@samba.org>
Sat, 27 Oct 2007 19:50:36 +0000 (12:50 -0700)
Hi!

Can you check and push them?

Thanks,

Volker

From b488af5905e2dee12a1a72a3b40801ae5c26f24f Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl@sernet.de>
Date: Sat, 27 Oct 2007 14:20:09 +0200
Subject: [PATCH] Fix some warnings and errors
(This used to be commit e17d3e10e860c96b6d5208e5fe51e43b8e58c174)

source3/Makefile.in
source3/client/smbmount.c
source3/client/smbumount.c
source3/include/interfaces.h
source3/lib/interfaces.c
source3/lib/replace/getpass.c
source3/smbd/server.c
source3/winbindd/idmap_ad.c

index a559d63f3e9a2ca052f8c2170114bee21b10816e..98fd8f8fe4bb57e5bb6728d82fe6e575c7c71d0b 100644 (file)
@@ -269,11 +269,12 @@ TALLOC_OBJ = lib/talloc/talloc.o
 
 LIB_WITHOUT_PROTO_OBJ = $(LIBREPLACE_OBJ) $(SOCKET_WRAPPER_OBJ) $(TALLOC_OBJ) \
        lib/messages.o librpc/gen_ndr/ndr_messaging.o lib/messages_local.o \
-       lib/messages_ctdbd.o lib/packet.o lib/ctdbd_conn.o lib/talloc_stack.o
+       lib/messages_ctdbd.o lib/packet.o lib/ctdbd_conn.o lib/talloc_stack.o \
+       lib/interfaces.o
 
 LIB_WITH_PROTO_OBJ = $(VERSION_OBJ) lib/charcnv.o lib/debug.o lib/fault.o \
          lib/interface.o lib/md4.o \
-         lib/interfaces.o lib/pidfile.o \
+         lib/pidfile.o \
          lib/signal.o lib/system.o lib/sendfile.o lib/time.o \
          lib/ufc.o lib/genrand.o lib/username.o \
          lib/util_pw.o lib/access.o lib/smbrun.o \
index 95adc9a8f233c4b77413621ebbb5e1757a565cca..7636adb2a72bca8fc568d7fc3921d251226e8d8a 100644 (file)
@@ -37,7 +37,7 @@ static pstring mpoint;
 static pstring service;
 static pstring options;
 
-static struct in_addr dest_ip;
+static struct sockaddr_storage dest_ip;
 static bool have_ip;
 static int smb_port = 0;
 static bool got_user;
@@ -122,7 +122,7 @@ static struct cli_state *do_connection(char *the_service)
        struct cli_state *c;
        struct nmb_name called, calling;
        char *server_n;
-       struct in_addr ip;
+       struct sockaddr_storage ip;
        pstring server;
        char *share;
 
@@ -146,7 +146,7 @@ static struct cli_state *do_connection(char *the_service)
        make_nmb_name(&called , server, 0x20);
 
  again:
-        zero_ip_v4(&ip);
+        zero_addr(&ip, INADDR_ANY);
        if (have_ip) ip = dest_ip;
 
        /* have to open a new connection */
@@ -798,8 +798,8 @@ static void parse_mount_smb(int argc, char **argv)
                        } else if(!strcmp(opts, "debug")) {
                                DEBUGLEVEL = val;
                        } else if(!strcmp(opts, "ip")) {
-                               dest_ip = *interpret_addr2(opteq+1);
-                               if (is_zero_ip_v4(dest_ip)) {
+                               if (!interpret_string_addr(&dest_ip, opteq+1,
+                                                          0)) {
                                        fprintf(stderr,"Can't resolve address %s\n", opteq+1);
                                        exit(1);
                                }
index 4be54b679361f0398973e21ee99d520c27c90dfa..1664e4b5559d54631709f6e9b9e3b98f693a8cd5 100644 (file)
@@ -80,7 +80,7 @@ umount_ok(const char *mount_point)
 static char *
 canonicalize (char *path)
 {
-       char *canonical = malloc (PATH_MAX + 1);
+       char *canonical = (char*)malloc (PATH_MAX + 1);
 
        if (!canonical) {
                fprintf(stderr, "Error! Not enough memory!\n");
index 66ea151f02e89dc47fb344a6a1bb888bdeb93576..b9d900053d71d8fe501821070be79dd053de5049 100644 (file)
@@ -1,8 +1,31 @@
+/*
+   Unix SMB/CIFS implementation.
+   Machine customisation and include handling
+   Copyright (C) Jeremy Allison <jra@samba.org> 2007
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
 /*
    This structure is used by lib/interfaces.c to return the list of network
    interfaces on the machine
 */
 
+#ifndef _INTERFACES_H
+#define _INTERFACES_H
+
+#include "lib/replace/replace.h"
+
 #define MAX_INTERFACES 128
 
 struct iface_struct {
@@ -12,3 +35,16 @@ struct iface_struct {
        struct sockaddr_storage netmask;
        struct sockaddr_storage bcast;
 };
+
+bool make_netmask(struct sockaddr_storage *pss_out,
+                 const struct sockaddr_storage *pss_in,
+                 unsigned long masklen);
+void make_bcast(struct sockaddr_storage *pss_out,
+               const struct sockaddr_storage *pss_in,
+               const struct sockaddr_storage *nmask);
+void make_net(struct sockaddr_storage *pss_out,
+             const struct sockaddr_storage *pss_in,
+             const struct sockaddr_storage *nmask);
+int get_interfaces(struct iface_struct *ifaces, int max_interfaces);
+
+#endif
index 48fe2490345ee34315d3d9dbaee6c84db1fca762..38abb9299b789fc0aa95dae58b7a45e8da5a7e19 100644 (file)
@@ -140,7 +140,7 @@ bool make_netmask(struct sockaddr_storage *pss_out,
 static void make_bcast_or_net(struct sockaddr_storage *pss_out,
                        const struct sockaddr_storage *pss_in,
                        const struct sockaddr_storage *nmask,
-                       bool make_bcast)
+                       bool make_bcast_p)
 {
        unsigned int i = 0, len = 0;
        char *pmask = NULL;
@@ -162,7 +162,7 @@ static void make_bcast_or_net(struct sockaddr_storage *pss_out,
        }
 
        for (i = 0; i < len; i++, p++, pmask++) {
-               if (make_bcast) {
+               if (make_bcast_p) {
                        *p = (*p & *pmask) | (*pmask ^ 0xff);
                } else {
                        /* make_net */
index 1d134615738e34a97b1910302d85e94d94769354..d91d029f6a79ced4089af86cb0b4d0a97b77b608 100644 (file)
@@ -21,6 +21,7 @@ not, see <http://www.gnu.org/licenses/>.  */
 #include "system/filesys.h"
 #include "system/wait.h"
 #include "system/terminal.h"
+#include "system/passwd.h"
 
 /*
  * Define additional missing types
index abad0efc3dd756cecef8fe2e5327e9a90e31747d..bcf997f2d242759b825aa2028c3490d8d22377cf 100644 (file)
@@ -369,7 +369,7 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
                                        open_socket_in(SOCK_STREAM, port, 0,
                                                        ifss, True);
                                if(s == -1) {
-                                       return false;
+                                       continue;
                                }
 
                                /* ready to listen */
index 0d190eb4a158c12dc0d683e5edcc125b9b96af89..50f7914f857d18abd3c13d4d56e13198a6759437 100644 (file)
@@ -60,7 +60,7 @@ static ADS_STRUCT *ad_idmap_cached_connection_internal(void)
        ADS_STATUS status;
        bool local = False;
        fstring dc_name;
-       struct in_addr dc_ip;   
+       struct sockaddr_storage dc_ip;
 
        if (ad_idmap_ads != NULL) {