Fix various build warnings
authorZach Loafman <zachary.loafman@isilon.com>
Fri, 4 Jul 2008 05:53:42 +0000 (22:53 -0700)
committerVolker Lendecke <vl@samba.org>
Tue, 22 Jul 2008 13:00:48 +0000 (15:00 +0200)
This fixes various build warnings on our platform. I'm sure I haven't
caught them all, but it's a start.
(This used to be commit 6b73f259cb67d9dda9127907d706f9244a871fa3)

source3/auth/auth_server.c
source3/lib/iconv.c
source3/lib/sendfile.c
source3/lib/util_sock.c
source3/nsswitch/libwbclient/wbc_sid.c
source3/smbd/utmp.c
source3/winbindd/winbindd_pam.c

index 31d1d37fbf717ab8f2d4c8d81244f64d881f7c89..696b42621e6f1e35463e1e6d951f4bd388a20ddc 100644 (file)
@@ -37,7 +37,7 @@ static struct cli_state *server_cryptkey(TALLOC_CTX *mem_ctx)
        const char *p;
        char *pserver = NULL;
        bool connected_ok = False;
-       struct named_mutex *mutex;
+       struct named_mutex *mutex = NULL;
 
        if (!(cli = cli_initialise()))
                return NULL;
index 6575dba5a93eefc9cea9ca56bd0003c0709bf89d..3ceb637b8e4744920967d3127efe8aec4744e029 100644 (file)
@@ -136,7 +136,7 @@ static size_t sys_iconv(void *cd,
                        char **outbuf, size_t *outbytesleft)
 {
        size_t ret = iconv((iconv_t)cd, 
-                          (char **)inbuf, inbytesleft, 
+                          (void *)inbuf, inbytesleft,
                           outbuf, outbytesleft);
        if (ret == (size_t)-1) {
                int saved_errno = errno;
index 20b23712733d93c377d05a57c8ae22eaddf18f9e..d1b178577c2e9da807f203bb92d1f9439b1b46be 100644 (file)
@@ -383,7 +383,8 @@ ssize_t sys_sendfile(int tofd, int fromfd, const DATA_BLOB *header, SMB_OFF_T of
                                hdtrl.iov_base = NULL;
                                hdtrl.iov_len = 0;
                        } else {
-                               hdtrl.iov_base += nwritten;
+                               hdtrl.iov_base =
+                                   (caddr_t)hdtrl.iov_base + nwritten;
                                hdtrl.iov_len -= nwritten;
                                nwritten = 0;
                        }
index 822ff263315e09a3f8ad117f44fe474ec05701ce..7356b3ec357f4857ac8e144fce1fadfc0b746168 100644 (file)
@@ -43,9 +43,9 @@ bool is_ipaddress_v4(const char *str)
 
 bool is_ipaddress(const char *str)
 {
+#if defined(HAVE_IPV6)
        int ret = -1;
 
-#if defined(HAVE_IPV6)
        if (strchr_m(str, ':')) {
                char addr[INET6_ADDRSTRLEN];
                struct in6_addr dest6;
@@ -212,9 +212,9 @@ bool interpret_string_addr(struct sockaddr_storage *pss,
                const char *str,
                int flags)
 {
-       char addr[INET6_ADDRSTRLEN];
        struct addrinfo *res = NULL;
 #if defined(HAVE_IPV6)
+       char addr[INET6_ADDRSTRLEN];
        unsigned int scope_id = 0;
 
        if (strchr_m(str, ':')) {
index 475c9947e0000368fed2a602644958d7ad69061f..09bfc3e8404ab2f2eebd81b85d8559a924c5c1fa 100644 (file)
@@ -242,7 +242,7 @@ wbcErr wbcLookupSid(const struct wbcDomainSid *sid,
        char *sid_string = NULL;
        char *domain = NULL;
        char *name = NULL;
-       enum wbcSidType name_type;
+       enum wbcSidType name_type = WBC_SID_NAME_USE_NONE;
 
        if (!sid) {
                wbc_status = WBC_ERR_INVALID_PARAM;
index de6d707eafdc0f403424ff634247486d8c47654b..af947ef4620fd29cf460e82fcec0deadf01248de 100644 (file)
@@ -189,7 +189,7 @@ static const char *wt_pathname =
 # endif
 
 /* BSD-like systems might want "lastlog" support. */
-/* *** Not yet implemented */
+#if 0 /* *** Not yet implemented */
 #ifndef HAVE_PUTUTLINE         /* see "pututline_my()" */
 static const char *ll_pathname =
 # if defined (_PATH_LASTLOG)   /* what other names (if any?) */
@@ -198,6 +198,7 @@ static const char *ll_pathname =
        "" ;
 # endif        /* _PATH_LASTLOG */
 #endif /* HAVE_PUTUTLINE */
+#endif
 
 /*
  * Get name of {u,w}tmp{,x} file.
index c26f552d31ab6044a34c33b4b31f1fc383ca711b..0f9f1e1621009cecce5f4810186a07dab37b4f37 100644 (file)
@@ -1179,6 +1179,18 @@ done:
        return result;
 }
 
+typedef        NTSTATUS (*netlogon_fn_t)(struct rpc_pipe_client *cli,
+                                 TALLOC_CTX *mem_ctx,
+                                 uint32 logon_parameters,
+                                 const char *server,
+                                 const char *username,
+                                 const char *domain,
+                                 const char *workstation,
+                                 const uint8 chal[8],
+                                 DATA_BLOB lm_response,
+                                 DATA_BLOB nt_response,
+                                 struct netr_SamInfo3 **info3);
+
 NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain,
                                         struct winbindd_cli_state *state,
                                         struct netr_SamInfo3 **info3)
@@ -1285,17 +1297,7 @@ NTSTATUS winbindd_dual_pam_auth_samlogon(struct winbindd_domain *domain,
        /* check authentication loop */
 
        do {
-               NTSTATUS (*logon_fn)(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    uint32 logon_parameters,
-                                    const char *server,
-                                    const char *username,
-                                    const char *ldomain,
-                                    const char *workstation,
-                                    const uint8 lchal[8],
-                                    DATA_BLOB lm_response,
-                                    DATA_BLOB nt_response,
-                                    struct netr_SamInfo3 **linfo3);
+               netlogon_fn_t logon_fn;
 
                ZERO_STRUCTP(my_info3);
                retry = False;
@@ -1863,17 +1865,7 @@ enum winbindd_result winbindd_dual_pam_auth_crap(struct winbindd_domain *domain,
        }
 
        do {
-               NTSTATUS (*logon_fn)(struct rpc_pipe_client *cli,
-                                    TALLOC_CTX *mem_ctx,
-                                    uint32 logon_parameters,
-                                    const char *server,
-                                    const char *username,
-                                    const char *ldomain,
-                                    const char *lworkstation,
-                                    const uint8 lchal[8],
-                                    DATA_BLOB lm_response,
-                                    DATA_BLOB nt_response,
-                                    struct netr_SamInfo3 **linfo3);
+               netlogon_fn_t logon_fn;
 
                retry = False;