libcli/util Rename common map_nt_error_from_unix to avoid duplicate symbol
authorAndrew Bartlett <abartlet@samba.org>
Mon, 20 Jun 2011 04:55:32 +0000 (14:55 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 20 Jun 2011 06:12:03 +0000 (08:12 +0200)
The two error tables need to be combined, but for now seperate the names.

(As the common parts of the tree now use the _common function,
errmap_unix.c must be included in the s3 autoconf build).

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Jun 20 08:12:03 CEST 2011 on sn-devel-104

40 files changed:
lib/torture/torture.c
libcli/auth/msrpc_parse.c
libcli/cldap/cldap.c
libcli/echo/echo.c
libcli/nbt/namerefresh.c
libcli/nbt/nameregister.c
libcli/util/errmap_unix.c
libcli/util/error.h
libcli/util/tstream.c
libgpo/gpext/gpext.c
libgpo/gpo_ini.c
librpc/rpc/binding_handle.c
librpc/rpc/dcerpc_util.c
source3/Makefile.in
source4/auth/kerberos/kerberos_pac.c
source4/cldap_server/cldap_server.c
source4/dns_server/dns_server.c
source4/dsdb/dns/dns_update.c
source4/echo_server/echo_server.c
source4/kdc/kdc.c
source4/ldap_server/ldap_extended.c
source4/lib/socket/socket.c
source4/lib/socket/socket_ip.c
source4/lib/socket/socket_unix.c
source4/libcli/resolve/dns_ex.c
source4/libcli/smb2/connect.c
source4/libcli/smb2/session.c
source4/libcli/smb_composite/smb2.c
source4/libcli/wrepl/winsrepl.c
source4/libnet/libnet_become_dc.c
source4/libnet/libnet_site.c
source4/libnet/libnet_unbecome_dc.c
source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c
source4/ntvfs/ipc/vfs_ipc.c
source4/ntvfs/posix/pvfs_util.c
source4/ntvfs/simple/vfs_simple.c
source4/ntvfs/sysdep/inotify.c
source4/ntvfs/sysdep/sys_lease_linux.c
source4/rpc_server/dcerpc_server.c
source4/smbd/service_named_pipe.c

index a0b35bfe7ca7baf540841904ab809d7fd33f7099..cee6bdb934d86e3f661044cdfd488c5cb16e6107 100644 (file)
@@ -88,7 +88,7 @@ _PUBLIC_ NTSTATUS torture_temp_dir(struct torture_context *tctx,
        NT_STATUS_HAVE_NO_MEMORY(*tempdir);
 
        if (mkdtemp(*tempdir) == NULL) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        return NT_STATUS_OK;
@@ -154,7 +154,7 @@ _PUBLIC_ NTSTATUS torture_deltree_outputdir(struct torture_context *tctx)
 
        if (local_deltree(tctx->outputdir) == -1) {
                if (errno != 0) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
                return NT_STATUS_UNSUCCESSFUL;
        }
index bdbba3d76ccc6f038f1b1987751266c4e07c1919..8b64e98feb26d67dbb48a4661f97e240662e67a9 100644 (file)
@@ -78,7 +78,7 @@ NTSTATUS msrpc_gen(TALLOC_CTX *mem_ctx,
                                s, &n);
                        if (!ret) {
                                va_end(ap);
-                               return map_nt_error_from_unix(errno);
+                               return map_nt_error_from_unix_common(errno);
                        }
                        pointers[i].length = n;
                        pointers[i].length -= 2;
@@ -92,7 +92,7 @@ NTSTATUS msrpc_gen(TALLOC_CTX *mem_ctx,
                                s, &n);
                        if (!ret) {
                                va_end(ap);
-                               return map_nt_error_from_unix(errno);
+                               return map_nt_error_from_unix_common(errno);
                        }
                        pointers[i].length = n;
                        pointers[i].length -= 1;
@@ -108,7 +108,7 @@ NTSTATUS msrpc_gen(TALLOC_CTX *mem_ctx,
                                s, &n);
                        if (!ret) {
                                va_end(ap);
-                               return map_nt_error_from_unix(errno);
+                               return map_nt_error_from_unix_common(errno);
                        }
                        pointers[i].length = n;
                        pointers[i].length -= 2;
index 37b4f4913dbfc5beb1ccca7da6eb00458526f607..59c54eabea943f02fce72b44e552d2f950ffcb86 100644 (file)
@@ -284,7 +284,7 @@ static bool cldap_socket_recv_dgram(struct cldap_socket *c,
 nomem:
        in->recv_errno = ENOMEM;
 error:
-       status = map_nt_error_from_unix(in->recv_errno);
+       status = map_nt_error_from_unix_common(in->recv_errno);
 nterror:
        /* in connected mode the first pending search gets the error */
        if (!c->connected) {
@@ -337,7 +337,7 @@ NTSTATUS cldap_socket_init(TALLOC_CTX *mem_ctx,
                                                        NULL, 0,
                                                        &any);
                if (ret != 0) {
-                       status = map_nt_error_from_unix(errno);
+                       status = map_nt_error_from_unix_common(errno);
                        goto nterror;
                }
                local_addr = any;
@@ -351,7 +351,7 @@ NTSTATUS cldap_socket_init(TALLOC_CTX *mem_ctx,
        ret = tdgram_inet_udp_socket(local_addr, remote_addr,
                                     c, &c->sock);
        if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                goto nterror;
        }
        talloc_free(any);
@@ -669,7 +669,7 @@ static void cldap_search_state_queue_done(struct tevent_req *subreq)
        talloc_free(subreq);
        if (ret == -1) {
                NTSTATUS status;
-               status = map_nt_error_from_unix(sys_errno);
+               status = map_nt_error_from_unix_common(sys_errno);
                DLIST_REMOVE(state->caller.cldap->searches.list, state);
                ZERO_STRUCT(state->caller.cldap);
                tevent_req_nterror(req, status);
index 271f71b0ae82a937c3a4845dedee824057fc0e21..b6005cb32c07f94f1024d01374a6f6ae0393e177 100644 (file)
@@ -75,20 +75,20 @@ struct tevent_req *echo_request_send(TALLOC_CTX *mem_ctx,
        ret = tsocket_address_inet_from_strings(state, "ip", NULL, 0,
                                                &local_addr);
        if (ret != 0) {
-               tevent_req_nterror(req, map_nt_error_from_unix(ret));
+               tevent_req_nterror(req, map_nt_error_from_unix_common(ret));
                return tevent_req_post(req, ev);
        }
 
        ret = tsocket_address_inet_from_strings(state, "ip", server_addr_string,
                                                ECHO_PORT, &server_addr);
        if (ret != 0) {
-               tevent_req_nterror(req, map_nt_error_from_unix(ret));
+               tevent_req_nterror(req, map_nt_error_from_unix_common(ret));
                return tevent_req_post(req, ev);
        }
 
        ret = tdgram_inet_udp_socket(local_addr, server_addr, state, &dgram);
        if (ret != 0) {
-               tevent_req_nterror(req, map_nt_error_from_unix(ret));
+               tevent_req_nterror(req, map_nt_error_from_unix_common(ret));
                return tevent_req_post(req, ev);
        }
 
@@ -132,7 +132,7 @@ static void echo_request_get_reply(struct tevent_req *subreq)
        TALLOC_FREE(subreq);
 
        if (len == -1 && err != 0) {
-               tevent_req_nterror(req, map_nt_error_from_unix(err));
+               tevent_req_nterror(req, map_nt_error_from_unix_common(err));
                return;
        }
 
@@ -168,7 +168,7 @@ static void echo_request_done(struct tevent_req *subreq)
        TALLOC_FREE(subreq);
 
        if (len == -1 && err != 0) {
-               tevent_req_nterror(req, map_nt_error_from_unix(err));
+               tevent_req_nterror(req, map_nt_error_from_unix_common(err));
                return;
        }
 
index 79c6c1f2ea1a5b45bc8747b387b629431a0fe605..b525356c7470ce05f6ca04d2528796e4f9336065 100644 (file)
@@ -331,7 +331,7 @@ _PUBLIC_ NTSTATUS nbt_name_refresh_wins(struct nbt_name_socket *nbtsock,
        }
 
        if (!tevent_req_poll(subreq, ev)) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                talloc_free(frame);
                return status;
        }
index 204fb6f3284fb032c875956bfa6149157d93a095..ff5418c85e570e57e7812ccf349e394271d2590a 100644 (file)
@@ -283,7 +283,7 @@ NTSTATUS nbt_name_register_bcast(struct nbt_name_socket *nbtsock,
        }
 
        if (!tevent_req_poll(subreq, ev)) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                talloc_free(frame);
                return status;
        }
@@ -498,7 +498,7 @@ _PUBLIC_ NTSTATUS nbt_name_register_wins(struct nbt_name_socket *nbtsock,
        }
 
        if (!tevent_req_poll(subreq, ev)) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                talloc_free(frame);
                return status;
        }
index 75b1e8d2fed113cad0c5a06c71b6caa97c111ec4..8f9f89835edbf7357371ffdddf0fdc9a410b1177 100644 (file)
@@ -140,7 +140,7 @@ static const struct {
 /*********************************************************************
  Map an NT error code from a Unix error code.
 *********************************************************************/
-NTSTATUS map_nt_error_from_unix(int unix_error)
+NTSTATUS map_nt_error_from_unix_common(int unix_error)
 {
        int i;
 
index 771d7a661e924bd64d4fa003f4a3d7a8b4750840..5c4dc10916bf4a0435b2687a902976f16e1ed5ba 100644 (file)
@@ -41,7 +41,7 @@ WERROR ntstatus_to_werror(NTSTATUS error);
 /*********************************************************************
  Map an NT error code from a Unix error code.
 *********************************************************************/
-NTSTATUS map_nt_error_from_unix(int unix_error);
+NTSTATUS map_nt_error_from_unix_common(int unix_error);
 
 NTSTATUS nt_status_squash(NTSTATUS nt_status);
 
index b287597c62c498c2a0d3f6608ff3d0d72cf95cd6..12cef9b6ddd3d1dda87f868bfcfae336da29e123 100644 (file)
@@ -106,7 +106,7 @@ static void tstream_read_pdu_blob_done(struct tevent_req *subreq)
        ret = tstream_readv_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               status = map_nt_error_from_unix(sys_errno);
+               status = map_nt_error_from_unix_common(sys_errno);
                tevent_req_nterror(req, status);
                return;
        }
index 640aae6aaf25edb3de0c9dbc1cf643e1f26bc72c..42ab6223312cddd5d79f82fb88663b3f379afb53 100644 (file)
@@ -495,7 +495,7 @@ static NTSTATUS gp_glob_ext_list(TALLOC_CTX *mem_ctx,
        dir = sys_opendir(modules_path(talloc_tos(), 
                                       SAMBA_SUBSYSTEM_GPEXT));
        if (!dir) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        while ((dirent = sys_readdir(dir))) {
index a4bff0e86b8381412bfc3980163248065c9ba99e..494162466d05ae05f9dc57ae03fa887f6f6805bf 100644 (file)
@@ -108,7 +108,7 @@ static NTSTATUS convert_file_from_ucs2(TALLOC_CTX *mem_ctx,
        }
 
        if (write(tmp_fd, data_out, converted_size) != converted_size) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                goto out;
        }
 
index 6c2d8a8b12bca78708db5bcb14029cf537e112d8..1e90827dbe175507825d1afc9c98488051a25745 100644 (file)
@@ -227,7 +227,7 @@ NTSTATUS dcerpc_binding_handle_raw_call(struct dcerpc_binding_handle *h,
        }
 
        if (!tevent_req_poll(subreq, ev)) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                talloc_free(frame);
                return status;
        }
@@ -540,7 +540,7 @@ NTSTATUS dcerpc_binding_handle_call(struct dcerpc_binding_handle *h,
        }
 
        if (!tevent_req_poll(subreq, ev)) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                talloc_free(frame);
                return status;
        }
index a405ca8966af4752603d5fd8ab1a8c919ef427c1..de292c836692015a4591a4e0b341fcfe9456319a 100644 (file)
@@ -266,7 +266,7 @@ static void dcerpc_read_ncacn_packet_done(struct tevent_req *subreq)
        ret = tstream_readv_pdu_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               status = map_nt_error_from_unix(sys_errno);
+               status = map_nt_error_from_unix_common(sys_errno);
                tevent_req_nterror(req, status);
                return;
        }
index 6c17947f7205e303d465bfaa7cad384c846f2b38..3df9ab47f6ea94155bfefb6ad2e5eb69eb503c65 100644 (file)
@@ -465,7 +465,7 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) \
          lib/util.o lib/util_malloc.o lib/namearray.o lib/util_cmdline.o lib/util_names.o \
          lib/util_sock.o lib/sock_exec.o lib/util_sec.o \
          lib/substitute.o lib/substitute_generic.o ../lib/util/substitute.o lib/dbwrap_util.o \
-         lib/ms_fnmatch.o ../lib/util/ms_fnmatch.o lib/errmap_unix.o \
+         lib/ms_fnmatch.o ../lib/util/ms_fnmatch.o lib/errmap_unix.o ../libcli/util/errmap_unix.o \
          lib/tallocmsg.o lib/dmallocmsg.o \
          libsmb/clisigning.o libsmb/smb_signing.o \
          ../lib/util/charset/iconv.o intl/lang_tdb.o \
index 5bc80c9a583dba5c0419beb2e098414d2aafa2d7..8ce970e48677b2dd16db1df6f8ee75469f2f0632 100644 (file)
@@ -448,14 +448,14 @@ NTSTATUS kerberos_pac_blob_to_user_info_dc(TALLOC_CTX *mem_ctx,
                             pac_blob.data, pac_blob.length,
                             &pac);
        if (ret) {
-               return map_nt_error_from_unix(ret);
+               return map_nt_error_from_unix_common(ret);
        }
 
 
        ret = kerberos_pac_to_user_info_dc(mem_ctx, pac, context, user_info_dc, pac_srv_sig, pac_kdc_sig);
        krb5_pac_free(context, pac);
        if (ret) {
-               return map_nt_error_from_unix(ret);
+               return map_nt_error_from_unix_common(ret);
        }
        return NT_STATUS_OK;
 }
index 9370c59df275fee0c19d04a4e92a69e47bf6e5f7..d3e8b7fffa450c83a653dc31ffefa8c25a832312 100644 (file)
@@ -116,7 +116,7 @@ static NTSTATUS cldapd_add_socket(struct cldapd_server *cldapd, struct loadparm_
                                                lpcfg_cldap_port(lp_ctx),
                                                &socket_address);
        if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                DEBUG(0,("invalid address %s:%d - %s:%s\n",
                         address, lpcfg_cldap_port(lp_ctx),
                         gai_strerror(ret), nt_errstr(status)));
index de8bc125420936cfae7ea9200f0abb6ac0ef4ddc..0c36c20773b1642072730722b5b6f5c121b71e4b 100644 (file)
@@ -490,7 +490,7 @@ static NTSTATUS dns_add_socket(struct dns_server *dns,
                                                address, port,
                                                &dns_socket->local_address);
        if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                return status;
        }
 
@@ -519,7 +519,7 @@ static NTSTATUS dns_add_socket(struct dns_server *dns,
                                     dns_udp_socket,
                                     &dns_udp_socket->dgram);
        if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                DEBUG(0,("Failed to bind to %s:%u UDP - %s\n",
                         address, port, nt_errstr(status)));
                return status;
index 603a218ef994d8dad7b1fbf0a3f1af3a0533cded..6650534d131703a65b1d778f1d92d9765bf94b6d 100644 (file)
@@ -79,7 +79,7 @@ static void dnsupdate_rndc_done(struct tevent_req *subreq)
        ret = samba_runcmd_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret != 0) {
-               service->confupdate.status = map_nt_error_from_unix(sys_errno);
+               service->confupdate.status = map_nt_error_from_unix_common(sys_errno);
        } else {
                service->confupdate.status = NT_STATUS_OK;
        }
@@ -242,7 +242,7 @@ static void dnsupdate_nameupdate_done(struct tevent_req *subreq)
        ret = samba_runcmd_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret != 0) {
-               service->nameupdate.status = map_nt_error_from_unix(sys_errno);
+               service->nameupdate.status = map_nt_error_from_unix_common(sys_errno);
        } else {
                service->nameupdate.status = NT_STATUS_OK;
        }
@@ -271,7 +271,7 @@ static void dnsupdate_spnupdate_done(struct tevent_req *subreq)
        ret = samba_runcmd_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret != 0) {
-               service->nameupdate.status = map_nt_error_from_unix(sys_errno);
+               service->nameupdate.status = map_nt_error_from_unix_common(sys_errno);
        } else {
                service->nameupdate.status = NT_STATUS_OK;
        }
@@ -381,7 +381,7 @@ static void dnsupdate_RODC_callback(struct tevent_req *req)
        ret = samba_runcmd_recv(req, &sys_errno);
        talloc_free(req);
        if (ret != 0) {
-               st->r->out.result = map_nt_error_from_unix(sys_errno);
+               st->r->out.result = map_nt_error_from_unix_common(sys_errno);
                DEBUG(2,(__location__ ": RODC DNS Update failed: %s\n", nt_errstr(st->r->out.result)));
        } else {
                st->r->out.result = NT_STATUS_OK;
index 9393a972e276f486d631d41bcb00ff0566c195d7..60729d8535cc67723071703dd129cb61131be31c 100644 (file)
@@ -197,7 +197,7 @@ static NTSTATUS echo_add_socket(struct echo_server *echo,
                                                address, port,
                                                &echo_socket->local_address);
        if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                return status;
        }
 
@@ -212,7 +212,7 @@ static NTSTATUS echo_add_socket(struct echo_server *echo,
                                     echo_udp_socket,
                                     &echo_udp_socket->dgram);
        if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                DEBUG(0, ("Failed to bind to %s:%u UDP - %s\n",
                          address, port, nt_errstr(status)));
                return status;
index 7f7782ca9b62479ab99217ec9e7f4944cffc82c0..07234080439bb082e4ffa7df1a8556022ba596c6 100644 (file)
@@ -654,7 +654,7 @@ static NTSTATUS kdc_add_socket(struct kdc_server *kdc,
                                                address, port,
                                                &kdc_socket->local_address);
        if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                return status;
        }
 
@@ -685,7 +685,7 @@ static NTSTATUS kdc_add_socket(struct kdc_server *kdc,
                                     kdc_udp_socket,
                                     &kdc_udp_socket->dgram);
        if (ret != 0) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                DEBUG(0,("Failed to bind to %s:%u UDP - %s\n",
                         address, port, nt_errstr(status)));
                return status;
index f70b8084d7fa30dea8370891bfa775f563b700c4..5cfa2d3b16fa68269d15ad0232897c820bc3bfb2 100644 (file)
@@ -82,7 +82,7 @@ static void ldapsrv_starttls_postprocess_done(struct tevent_req *subreq)
                                      conn, &conn->sockets.tls);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               NTSTATUS status = map_nt_error_from_unix(sys_errno);
+               NTSTATUS status = map_nt_error_from_unix_common(sys_errno);
 
                DEBUG(1,("ldapsrv_starttls_postprocess_done: accept_tls_loop: "
                         "tstream_tls_accept_recv() - %d:%s => %s",
index b16e38c372d4788e2950154de76f6a062f76fd89..2dbdaad11dfbd3ac29bb98703441acdd58741e28 100644 (file)
@@ -451,7 +451,7 @@ _PUBLIC_ NTSTATUS socket_dup(struct socket_context *sock)
        }
        fd = dup(sock->fd);
        if (fd == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
        close(sock->fd);
        sock->fd = fd;
index bf0aff74ec97960a3abc6726102360dca8dc706b..80f7d333f38c7f0358d14427baae2ba54cf17e2f 100644 (file)
@@ -47,7 +47,7 @@ static NTSTATUS ipv4_init(struct socket_context *sock)
 
        sock->fd = socket(PF_INET, type, 0);
        if (sock->fd == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        sock->backend_name = "ipv4";
@@ -70,16 +70,16 @@ static NTSTATUS ip_connect_complete(struct socket_context *sock, uint32_t flags)
           for non-blocking connect */
        ret = getsockopt(sock->fd, SOL_SOCKET, SO_ERROR, &error, &len);
        if (ret == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
        if (error != 0) {
-               return map_nt_error_from_unix(error);
+               return map_nt_error_from_unix_common(error);
        }
 
        if (!(flags & SOCKET_FLAG_BLOCK)) {
                ret = set_blocking(sock->fd, false);
                if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        }
 
@@ -102,7 +102,7 @@ static NTSTATUS ipv4_connect(struct socket_context *sock,
        if (my_address && my_address->sockaddr) {
                ret = bind(sock->fd, my_address->sockaddr, my_address->sockaddrlen);
                if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        } else if (my_address) {
                my_ip = interpret_addr2(my_address->addr);
@@ -119,7 +119,7 @@ static NTSTATUS ipv4_connect(struct socket_context *sock,
                        
                        ret = bind(sock->fd, (struct sockaddr *)&my_addr, sizeof(my_addr));
                        if (ret == -1) {
-                               return map_nt_error_from_unix(errno);
+                               return map_nt_error_from_unix_common(errno);
                        }
                }
        }
@@ -127,7 +127,7 @@ static NTSTATUS ipv4_connect(struct socket_context *sock,
        if (srv_address->sockaddr) {
                ret = connect(sock->fd, srv_address->sockaddr, srv_address->sockaddrlen);
                if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        } else {
                srv_ip = interpret_addr2(srv_address->addr);
@@ -147,7 +147,7 @@ static NTSTATUS ipv4_connect(struct socket_context *sock,
 
                ret = connect(sock->fd, (const struct sockaddr *)&srv_addr, sizeof(srv_addr));
                if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        }
 
@@ -186,20 +186,20 @@ static NTSTATUS ipv4_listen(struct socket_context *sock,
        }
 
        if (ret == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        if (sock->type == SOCKET_TYPE_STREAM) {
                ret = listen(sock->fd, queue_size);
                if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        }
 
        if (!(flags & SOCKET_FLAG_BLOCK)) {
                ret = set_blocking(sock->fd, false);
                if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        }
 
@@ -220,14 +220,14 @@ static NTSTATUS ipv4_accept(struct socket_context *sock, struct socket_context *
 
        new_fd = accept(sock->fd, (struct sockaddr *)&cli_addr, &cli_addr_len);
        if (new_fd == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        if (!(sock->flags & SOCKET_FLAG_BLOCK)) {
                int ret = set_blocking(new_fd, false);
                if (ret == -1) {
                        close(new_fd);
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        }
 
@@ -268,7 +268,7 @@ static NTSTATUS ip_recv(struct socket_context *sock, void *buf,
        if (gotlen == 0) {
                return NT_STATUS_END_OF_FILE;
        } else if (gotlen == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        *nread = gotlen;
@@ -311,7 +311,7 @@ static NTSTATUS ipv4_recvfrom(struct socket_context *sock, void *buf,
                return NT_STATUS_END_OF_FILE;
        } else if (gotlen == -1) {
                talloc_free(src);
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        src->sockaddrlen = from_len;
@@ -342,7 +342,7 @@ static NTSTATUS ip_send(struct socket_context *sock,
 
        len = send(sock->fd, blob->data, blob->length, 0);
        if (len == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }       
 
        *sendlen = len;
@@ -383,7 +383,7 @@ static NTSTATUS ipv4_sendto(struct socket_context *sock,
                             (struct sockaddr *)&srv_addr, sizeof(srv_addr));
        }
        if (len == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }       
 
        *sendlen = len;
@@ -518,7 +518,7 @@ static NTSTATUS ip_pending(struct socket_context *sock, size_t *npending)
                *npending = value;
                return NT_STATUS_OK;
        }
-       return map_nt_error_from_unix(errno);
+       return map_nt_error_from_unix_common(errno);
 }
 
 static const struct socket_ops ipv4_ops = {
@@ -604,7 +604,7 @@ static NTSTATUS ipv6_init(struct socket_context *sock)
 
        sock->fd = socket(PF_INET6, type, 0);
        if (sock->fd == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        sock->backend_name = "ipv6";
@@ -623,7 +623,7 @@ static NTSTATUS ipv6_tcp_connect(struct socket_context *sock,
        if (my_address && my_address->sockaddr) {
                ret = bind(sock->fd, my_address->sockaddr, my_address->sockaddrlen);
                if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        } else if (my_address) {
                struct in6_addr my_ip;
@@ -638,7 +638,7 @@ static NTSTATUS ipv6_tcp_connect(struct socket_context *sock,
                        
                        ret = bind(sock->fd, (struct sockaddr *)&my_addr, sizeof(my_addr));
                        if (ret == -1) {
-                               return map_nt_error_from_unix(errno);
+                               return map_nt_error_from_unix_common(errno);
                        }
                }
        }
@@ -661,7 +661,7 @@ static NTSTATUS ipv6_tcp_connect(struct socket_context *sock,
                ret = connect(sock->fd, (const struct sockaddr *)&srv_addr, sizeof(srv_addr));
        }
        if (ret == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        return ip_connect_complete(sock, flags);
@@ -711,20 +711,20 @@ static NTSTATUS ipv6_listen(struct socket_context *sock,
        }
 
        if (ret == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        if (sock->type == SOCKET_TYPE_STREAM) {
                ret = listen(sock->fd, queue_size);
                if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        }
 
        if (!(flags & SOCKET_FLAG_BLOCK)) {
                ret = set_blocking(sock->fd, false);
                if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        }
 
@@ -745,14 +745,14 @@ static NTSTATUS ipv6_tcp_accept(struct socket_context *sock, struct socket_conte
 
        new_fd = accept(sock->fd, (struct sockaddr *)&cli_addr, &cli_addr_len);
        if (new_fd == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        if (!(sock->flags & SOCKET_FLAG_BLOCK)) {
                int ret = set_blocking(new_fd, false);
                if (ret == -1) {
                        close(new_fd);
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        }
 
@@ -816,7 +816,7 @@ static NTSTATUS ipv6_recvfrom(struct socket_context *sock, void *buf,
                return NT_STATUS_END_OF_FILE;
        } else if (gotlen == -1) {
                talloc_free(src);
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        src->sockaddrlen = from_len;
@@ -867,7 +867,7 @@ static NTSTATUS ipv6_sendto(struct socket_context *sock,
                             (struct sockaddr *)&srv_addr, sizeof(srv_addr));
        }
        if (len == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }       
 
        *sendlen = len;
index f1fa0a3a30c42d6c232bf5a206c8541cb08e405d..d492f01268127b5b8879f3f34a31bbc43d6d3f1d 100644 (file)
@@ -33,7 +33,7 @@ _PUBLIC_ const struct socket_ops *socket_unixdom_ops(enum socket_type type);
 */
 static NTSTATUS unixdom_error(int ernum)
 {
-       return map_nt_error_from_unix(ernum);
+       return map_nt_error_from_unix_common(ernum);
 }
 
 static NTSTATUS unixdom_init(struct socket_context *sock)
@@ -53,7 +53,7 @@ static NTSTATUS unixdom_init(struct socket_context *sock)
 
        sock->fd = socket(PF_UNIX, type, 0);
        if (sock->fd == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
        sock->private_data = NULL;
 
@@ -76,16 +76,16 @@ static NTSTATUS unixdom_connect_complete(struct socket_context *sock, uint32_t f
           for non-blocking connect */
        ret = getsockopt(sock->fd, SOL_SOCKET, SO_ERROR, &error, &len);
        if (ret == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
        if (error != 0) {
-               return map_nt_error_from_unix(error);
+               return map_nt_error_from_unix_common(error);
        }
 
        if (!(flags & SOCKET_FLAG_BLOCK)) {
                ret = set_blocking(sock->fd, false);
                if (ret == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        }
 
@@ -194,7 +194,7 @@ static NTSTATUS unixdom_accept(struct socket_context *sock,
                int ret = set_blocking(new_fd, false);
                if (ret == -1) {
                        close(new_fd);
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
        }
 
@@ -280,7 +280,7 @@ static NTSTATUS unixdom_sendto(struct socket_context *sock,
                             (struct sockaddr *)&srv_addr, sizeof(srv_addr));
        }
        if (len == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }       
 
        *sendlen = len;
@@ -390,7 +390,7 @@ static NTSTATUS unixdom_pending(struct socket_context *sock, size_t *npending)
                *npending = value;
                return NT_STATUS_OK;
        }
-       return map_nt_error_from_unix(errno);
+       return map_nt_error_from_unix_common(errno);
 }
 
 static const struct socket_ops unixdom_ops = {
index 1d56a4b4d5cdbbeb5d4b24b376b17781b886be47..592121257937707833fc14d0116d2a31d3e232d2 100644 (file)
@@ -518,7 +518,7 @@ struct composite_context *resolve_name_dns_ex_send(TALLOC_CTX *mem_ctx,
        /* setup a pipe to chat to our child */
        ret = pipe(fd);
        if (ret == -1) {
-               composite_error(c, map_nt_error_from_unix(errno));
+               composite_error(c, map_nt_error_from_unix_common(errno));
                return c;
        }
 
@@ -542,7 +542,7 @@ struct composite_context *resolve_name_dns_ex_send(TALLOC_CTX *mem_ctx,
 
        state->child = fork();
        if (state->child == (pid_t)-1) {
-               composite_error(c, map_nt_error_from_unix(errno));
+               composite_error(c, map_nt_error_from_unix_common(errno));
                return c;
        }
 
index c5cacc3e0b29ead59df6f1e304e693bdb1a88310..0e3bf1512bec505ed3eb3a2bc7aa14455b0098a7 100644 (file)
@@ -381,7 +381,7 @@ NTSTATUS smb2_connect(TALLOC_CTX *mem_ctx,
 
        ok = tevent_req_poll(subreq, ev);
        if (!ok) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                TALLOC_FREE(frame);
                return status;
        }
index 0f285ecd878522434dd27ef06833cfe6c7ec7343..d46cdefc69a2c49a9a8554da41c438cdae8a6a35 100644 (file)
@@ -318,7 +318,7 @@ NTSTATUS smb2_session_setup_spnego(struct smb2_session *session,
 
        ok = tevent_req_poll(subreq, ev);
        if (!ok) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                TALLOC_FREE(frame);
                return status;
        }
index 1f8ec834ca9dd92e705741eb1fd3ba3b2fb6c602..5c93869b5c82dc06c31590087fe44e5ed216b1ea 100644 (file)
@@ -430,7 +430,7 @@ NTSTATUS smb2_composite_setpathinfo(struct smb2_tree *tree, union smb_setfileinf
 
        ok = tevent_req_poll(subreq, ev);
        if (!ok) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                TALLOC_FREE(frame);
                return status;
        }
index 0dee2c56cf32f5fa7c80e92ef732e4d0119d0155..72c040d3a16d64dd9aaeb1a781f2e374d2bfbf34 100644 (file)
@@ -181,7 +181,7 @@ struct tevent_req *wrepl_connect_send(TALLOC_CTX *mem_ctx,
                                                our_ip, 0,
                                                &state->local_address);
        if (ret != 0) {
-               NTSTATUS status = map_nt_error_from_unix(errno);
+               NTSTATUS status = map_nt_error_from_unix_common(errno);
                tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
@@ -190,7 +190,7 @@ struct tevent_req *wrepl_connect_send(TALLOC_CTX *mem_ctx,
                                                peer_ip, WINS_REPLICATION_PORT,
                                                &state->remote_address);
        if (ret != 0) {
-               NTSTATUS status = map_nt_error_from_unix(errno);
+               NTSTATUS status = map_nt_error_from_unix_common(errno);
                tevent_req_nterror(req, status);
                return tevent_req_post(req, ev);
        }
@@ -250,7 +250,7 @@ static void wrepl_connect_done(struct tevent_req *subreq)
        ret = tstream_inet_tcp_connect_recv(subreq, &sys_errno,
                                            state, &state->stream, NULL);
        if (ret != 0) {
-               NTSTATUS status = map_nt_error_from_unix(sys_errno);
+               NTSTATUS status = map_nt_error_from_unix_common(sys_errno);
                tevent_req_nterror(req, status);
                return;
        }
@@ -443,7 +443,7 @@ static void wrepl_request_writev_done(struct tevent_req *subreq)
        ret = tstream_writev_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               NTSTATUS status = map_nt_error_from_unix(sys_errno);
+               NTSTATUS status = map_nt_error_from_unix_common(sys_errno);
                TALLOC_FREE(state->caller.wrepl_socket->stream);
                tevent_req_nterror(req, status);
                return;
@@ -494,7 +494,7 @@ static void wrepl_request_disconnect_done(struct tevent_req *subreq)
        ret = tstream_disconnect_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               NTSTATUS status = map_nt_error_from_unix(sys_errno);
+               NTSTATUS status = map_nt_error_from_unix_common(sys_errno);
                TALLOC_FREE(state->caller.wrepl_socket->stream);
                tevent_req_nterror(req, status);
                return;
index a68f4c5ea05f4dbe645e511bb453174d7dc5e38c..4d845ca1f088a837f5913692a0171178cf195b6d 100644 (file)
@@ -769,7 +769,7 @@ static void becomeDC_send_cldap(struct libnet_BecomeDC_state *s)
                                                lpcfg_cldap_port(s->libnet->lp_ctx),
                                                &dest_address);
        if (ret != 0) {
-               c->status = map_nt_error_from_unix(errno);
+               c->status = map_nt_error_from_unix_common(errno);
                if (!composite_is_ok(c)) return;
        }
 
index f49108b28a96dcf7ac6571cbef254e6bda06bea1..a74dd59a22bddc3d74c1208d31f7a9c46c279571 100644 (file)
@@ -64,7 +64,7 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_context *lctx, struct li
                                                &dest_address);
        if (ret != 0) {
                r->out.error_string = NULL;
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                return status;
        }
 
index 4bffc5079e73f777ed16c9d926662de9c02893a4..85d47a91f926edcbf7f5c78bb22fcb8d25edb58b 100644 (file)
@@ -277,7 +277,7 @@ static void unbecomeDC_send_cldap(struct libnet_UnbecomeDC_state *s)
                                                lpcfg_cldap_port(s->libnet->lp_ctx),
                                                &dest_address);
        if (ret != 0) {
-               c->status = map_nt_error_from_unix(errno);
+               c->status = map_nt_error_from_unix_common(errno);
                if (!composite_is_ok(c)) return;
        }
 
index 2a8c69e2207b129c0e13210986cee23355b4f84c..949b6dbbb76de62ea46d5333ed12793262fd61a4 100644 (file)
@@ -150,7 +150,7 @@ static NTSTATUS cifspsx_unlink(struct ntvfs_module_context *ntvfs,
 
        /* ignoring wildcards ... */
        if (unlink(unix_path) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        return NT_STATUS_OK;
@@ -179,7 +179,7 @@ static NTSTATUS cifspsx_chkpath(struct ntvfs_module_context *ntvfs,
        unix_path = cifspsx_unix_path(ntvfs, req, cp->chkpath.in.path);
 
        if (stat(unix_path, &st) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        if (!S_ISDIR(st.st_mode)) {
@@ -294,7 +294,7 @@ static NTSTATUS cifspsx_qpathinfo(struct ntvfs_module_context *ntvfs,
        DEBUG(19,("cifspsx_qpathinfo: file %s\n", unix_path));
        if (stat(unix_path, &st) == -1) {
                DEBUG(19,("cifspsx_qpathinfo: file %s errno=%d\n", unix_path, errno));
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
        DEBUG(19,("cifspsx_qpathinfo: file %s, stat done\n", unix_path));
        return cifspsx_map_fileinfo(ntvfs, req, info, &st, unix_path);
@@ -320,7 +320,7 @@ static NTSTATUS cifspsx_qfileinfo(struct ntvfs_module_context *ntvfs,
        }
        
        if (fstat(f->fd, &st) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        return cifspsx_map_fileinfo(ntvfs, req,info, &st, f->name);
@@ -389,13 +389,13 @@ static NTSTATUS cifspsx_open(struct ntvfs_module_context *ntvfs,
                case NTCREATEX_DISP_CREATE:
                        if (mkdir(unix_path, 0755) == -1) {
                                DEBUG(9,("cifspsx_open: mkdir %s errno=%d\n", unix_path, errno));
-                               return map_nt_error_from_unix(errno);
+                               return map_nt_error_from_unix_common(errno);
                        }
                        break;
                case NTCREATEX_DISP_OPEN_IF:
                        if (mkdir(unix_path, 0755) == -1 && errno != EEXIST) {
                                DEBUG(9,("cifspsx_open: mkdir %s errno=%d\n", unix_path, errno));
-                               return map_nt_error_from_unix(errno);
+                               return map_nt_error_from_unix_common(errno);
                        }
                        break;
                }
@@ -404,13 +404,13 @@ static NTSTATUS cifspsx_open(struct ntvfs_module_context *ntvfs,
 do_open:
        fd = open(unix_path, flags, 0644);
        if (fd == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        if (fstat(fd, &st) == -1) {
                DEBUG(9,("cifspsx_open: fstat errno=%d\n", errno));
                close(fd);
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        status = ntvfs_handle_new(ntvfs, req, &handle);
@@ -459,7 +459,7 @@ static NTSTATUS cifspsx_mkdir(struct ntvfs_module_context *ntvfs,
        unix_path = cifspsx_unix_path(ntvfs, req, md->mkdir.in.path);
 
        if (mkdir(unix_path, 0777) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        return NT_STATUS_OK;
@@ -478,7 +478,7 @@ static NTSTATUS cifspsx_rmdir(struct ntvfs_module_context *ntvfs,
        unix_path = cifspsx_unix_path(ntvfs, req, rd->in.path);
 
        if (rmdir(unix_path) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        return NT_STATUS_OK;
@@ -502,7 +502,7 @@ static NTSTATUS cifspsx_rename(struct ntvfs_module_context *ntvfs,
        unix_path2 = cifspsx_unix_path(ntvfs, req, ren->rename.in.pattern2);
 
        if (rename(unix_path1, unix_path2) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
        
        return NT_STATUS_OK;
@@ -541,7 +541,7 @@ static NTSTATUS cifspsx_read(struct ntvfs_module_context *ntvfs,
                    rd->readx.in.maxcnt,
                    rd->readx.in.offset);
        if (ret == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        rd->readx.out.nread = ret;
@@ -577,7 +577,7 @@ static NTSTATUS cifspsx_write(struct ntvfs_module_context *ntvfs,
                     wr->writex.in.count,
                     wr->writex.in.offset);
        if (ret == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
                
        wr->writex.out.nwritten = ret;
@@ -648,7 +648,7 @@ static NTSTATUS cifspsx_close(struct ntvfs_module_context *ntvfs,
        }
 
        if (close(f->fd) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        DLIST_REMOVE(p->open_files, f);
@@ -738,7 +738,7 @@ static NTSTATUS cifspsx_setfileinfo(struct ntvfs_module_context *ntvfs,
        case RAW_SFILEINFO_END_OF_FILE_INFORMATION:
                if (ftruncate(f->fd, 
                              info->end_of_file_info.in.size) == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
                break;
        case RAW_SFILEINFO_SETATTRE:
@@ -784,7 +784,7 @@ static NTSTATUS cifspsx_fsinfo(struct ntvfs_module_context *ntvfs,
        if (sys_fsusage(p->connectpath,
                        &fs->generic.out.blocks_free, 
                        &fs->generic.out.blocks_total) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        fs->generic.out.block_size = 512;
@@ -824,7 +824,7 @@ static NTSTATUS cifspsx_fsattr(struct ntvfs_module_context *ntvfs,
        }
 
        if (stat(p->connectpath, &st) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        unix_to_nt_time(&fs->generic.out.create_time, st.st_ctime);
index 185e72cfb0fe6fdd903fdf50ecefee8b15696754..fc9ff4fb12d6bcac7a39570ecb350ce8443e949f 100644 (file)
@@ -353,7 +353,7 @@ static void ipc_open_done(struct tevent_req *subreq)
                                       &p->allocation_size);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               status = map_nt_error_from_unix(sys_errno);
+               status = map_nt_error_from_unix_common(sys_errno);
                goto reply;
        }
 
@@ -602,7 +602,7 @@ static void ipc_read_done(struct tevent_req *subreq)
        ret = tstream_readv_pdu_queue_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               status = map_nt_error_from_unix(sys_errno);
+               status = map_nt_error_from_unix_common(sys_errno);
                goto reply;
        }
 
@@ -687,7 +687,7 @@ static void ipc_write_done(struct tevent_req *subreq)
        ret = tstream_writev_queue_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               status = map_nt_error_from_unix(sys_errno);
+               status = map_nt_error_from_unix_common(sys_errno);
                goto reply;
        }
 
@@ -1009,7 +1009,7 @@ static void ipc_trans_writev_done(struct tevent_req *subreq)
                status = NT_STATUS_PIPE_DISCONNECTED;
                goto reply;
        } else if (ret == -1) {
-               status = map_nt_error_from_unix(sys_errno);
+               status = map_nt_error_from_unix_common(sys_errno);
                goto reply;
        }
 
@@ -1045,7 +1045,7 @@ static void ipc_trans_readv_done(struct tevent_req *subreq)
        ret = tstream_readv_pdu_queue_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               status = map_nt_error_from_unix(sys_errno);
+               status = map_nt_error_from_unix_common(sys_errno);
                goto reply;
        }
 
@@ -1215,7 +1215,7 @@ static void ipc_ioctl_writev_done(struct tevent_req *subreq)
        ret = tstream_writev_queue_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               status = map_nt_error_from_unix(sys_errno);
+               status = map_nt_error_from_unix_common(sys_errno);
                goto reply;
        }
 
@@ -1251,7 +1251,7 @@ static void ipc_ioctl_readv_done(struct tevent_req *subreq)
        ret = tstream_readv_pdu_queue_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               status = map_nt_error_from_unix(sys_errno);
+               status = map_nt_error_from_unix_common(sys_errno);
                goto reply;
        }
 
index 8dedf13a63349d726edb32c7e9f05dd478b474d5..c6c6eaa13c8590c4fec0a31e9720509bb80f1409 100644 (file)
@@ -40,7 +40,7 @@ bool pvfs_has_wildcard(const char *str)
 NTSTATUS pvfs_map_errno(struct pvfs_state *pvfs, int unix_errno)
 {
        NTSTATUS status;
-       status = map_nt_error_from_unix(unix_errno);
+       status = map_nt_error_from_unix_common(unix_errno);
        DEBUG(10,(__location__ " mapped unix errno %d -> %s\n", unix_errno, nt_errstr(status)));
        return status;
 }
index 03bf76634d14412e3d46a0d15f936ab5c0e5e952..7ae41db521bf2a87d8426d1be47a5aab671b6a38 100644 (file)
@@ -147,7 +147,7 @@ static NTSTATUS svfs_unlink(struct ntvfs_module_context *ntvfs,
 
        /* ignoring wildcards ... */
        if (unlink(unix_path) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        return NT_STATUS_OK;
@@ -176,7 +176,7 @@ static NTSTATUS svfs_chkpath(struct ntvfs_module_context *ntvfs,
        unix_path = svfs_unix_path(ntvfs, req, cp->chkpath.in.path);
 
        if (stat(unix_path, &st) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        if (!S_ISDIR(st.st_mode)) {
@@ -291,7 +291,7 @@ static NTSTATUS svfs_qpathinfo(struct ntvfs_module_context *ntvfs,
        DEBUG(19,("svfs_qpathinfo: file %s\n", unix_path));
        if (stat(unix_path, &st) == -1) {
                DEBUG(19,("svfs_qpathinfo: file %s errno=%d\n", unix_path, errno));
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
        DEBUG(19,("svfs_qpathinfo: file %s, stat done\n", unix_path));
        return svfs_map_fileinfo(ntvfs, req, info, &st, unix_path);
@@ -317,7 +317,7 @@ static NTSTATUS svfs_qfileinfo(struct ntvfs_module_context *ntvfs,
        }
        
        if (fstat(f->fd, &st) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        return svfs_map_fileinfo(ntvfs, req,info, &st, f->name);
@@ -386,13 +386,13 @@ static NTSTATUS svfs_open(struct ntvfs_module_context *ntvfs,
                case NTCREATEX_DISP_CREATE:
                        if (mkdir(unix_path, 0755) == -1) {
                                DEBUG(9,("svfs_open: mkdir %s errno=%d\n", unix_path, errno));
-                               return map_nt_error_from_unix(errno);
+                               return map_nt_error_from_unix_common(errno);
                        }
                        break;
                case NTCREATEX_DISP_OPEN_IF:
                        if (mkdir(unix_path, 0755) == -1 && errno != EEXIST) {
                                DEBUG(9,("svfs_open: mkdir %s errno=%d\n", unix_path, errno));
-                               return map_nt_error_from_unix(errno);
+                               return map_nt_error_from_unix_common(errno);
                        }
                        break;
                }
@@ -401,13 +401,13 @@ static NTSTATUS svfs_open(struct ntvfs_module_context *ntvfs,
 do_open:
        fd = open(unix_path, flags, 0644);
        if (fd == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        if (fstat(fd, &st) == -1) {
                DEBUG(9,("svfs_open: fstat errno=%d\n", errno));
                close(fd);
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        status = ntvfs_handle_new(ntvfs, req, &handle);
@@ -456,7 +456,7 @@ static NTSTATUS svfs_mkdir(struct ntvfs_module_context *ntvfs,
        unix_path = svfs_unix_path(ntvfs, req, md->mkdir.in.path);
 
        if (mkdir(unix_path, 0777) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        return NT_STATUS_OK;
@@ -475,7 +475,7 @@ static NTSTATUS svfs_rmdir(struct ntvfs_module_context *ntvfs,
        unix_path = svfs_unix_path(ntvfs, req, rd->in.path);
 
        if (rmdir(unix_path) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        return NT_STATUS_OK;
@@ -499,7 +499,7 @@ static NTSTATUS svfs_rename(struct ntvfs_module_context *ntvfs,
        unix_path2 = svfs_unix_path(ntvfs, req, ren->rename.in.pattern2);
 
        if (rename(unix_path1, unix_path2) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
        
        return NT_STATUS_OK;
@@ -538,7 +538,7 @@ static NTSTATUS svfs_read(struct ntvfs_module_context *ntvfs,
                    rd->readx.in.maxcnt,
                    rd->readx.in.offset);
        if (ret == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        rd->readx.out.nread = ret;
@@ -574,7 +574,7 @@ static NTSTATUS svfs_write(struct ntvfs_module_context *ntvfs,
                     wr->writex.in.count,
                     wr->writex.in.offset);
        if (ret == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
                
        wr->writex.out.nwritten = ret;
@@ -645,7 +645,7 @@ static NTSTATUS svfs_close(struct ntvfs_module_context *ntvfs,
        }
 
        if (close(f->fd) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        DLIST_REMOVE(p->open_files, f);
@@ -735,7 +735,7 @@ static NTSTATUS svfs_setfileinfo(struct ntvfs_module_context *ntvfs,
        case RAW_SFILEINFO_END_OF_FILE_INFORMATION:
                if (ftruncate(f->fd, 
                              info->end_of_file_info.in.size) == -1) {
-                       return map_nt_error_from_unix(errno);
+                       return map_nt_error_from_unix_common(errno);
                }
                break;
        case RAW_SFILEINFO_SETATTRE:
@@ -781,7 +781,7 @@ static NTSTATUS svfs_fsinfo(struct ntvfs_module_context *ntvfs,
        if (sys_fsusage(p->connectpath,
                        &fs->generic.out.blocks_free, 
                        &fs->generic.out.blocks_total) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        fs->generic.out.block_size = 512;
@@ -821,7 +821,7 @@ static NTSTATUS svfs_fsattr(struct ntvfs_module_context *ntvfs,
        }
 
        if (stat(p->connectpath, &st) == -1) {
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        unix_to_nt_time(&fs->generic.out.create_time, st.st_ctime);
index 42aac0b09747ae9665ac20601563cd82afc7d42b..28ea32e8a0004977e1dde0af3d6b47d8f6913af1 100644 (file)
@@ -258,7 +258,7 @@ static NTSTATUS inotify_setup(struct sys_notify_context *ctx)
        if (in->fd == -1) {
                DEBUG(0,("Failed to init inotify - %s\n", strerror(errno)));
                talloc_free(in);
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
        in->ctx = ctx;
        in->watches = NULL;
@@ -274,7 +274,7 @@ static NTSTATUS inotify_setup(struct sys_notify_context *ctx)
                }
                DEBUG(0,("Failed to tevent_add_fd() - %s\n", strerror(errno)));
                talloc_free(in);
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        tevent_fd_set_auto_close(fde);
@@ -373,7 +373,7 @@ static NTSTATUS inotify_watch(struct sys_notify_context *ctx,
        wd = inotify_add_watch(in->fd, e->path, mask);
        if (wd == -1) {
                e->filter = filter;
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        w = talloc(in, struct inotify_watch_context);
index c0fb4335d9661b00fe89bf53e817825c56dddb9f..3b0605b73b9b860b88ccd9f2d181e745c6ffa499 100644 (file)
@@ -131,13 +131,13 @@ static NTSTATUS linux_lease_setup(struct sys_lease_context *ctx,
        ret = fcntl(*fd, F_SETSIG, LINUX_LEASE_RT_SIGNAL);
        if (ret == -1) {
                talloc_free(p);
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        ret = fcntl(*fd, F_SETLEASE, F_WRLCK);
        if (ret == -1) {
                talloc_free(p);
-               return map_nt_error_from_unix(errno);
+               return map_nt_error_from_unix_common(errno);
        }
 
        DLIST_ADD(leases, p);
index b738c9d5856401f3a4e9bb246d65770c7cd2cf18..cbba5e24085958ba42dc8330cc67a1033571815a 100644 (file)
@@ -1353,7 +1353,7 @@ static void dcesrv_sock_reply_done(struct tevent_req *subreq)
        ret = tstream_writev_queue_recv(subreq, &sys_errno);
        TALLOC_FREE(subreq);
        if (ret == -1) {
-               status = map_nt_error_from_unix(sys_errno);
+               status = map_nt_error_from_unix_common(sys_errno);
                dcesrv_terminate_connection(substate->dce_conn, nt_errstr(status));
                return;
        }
@@ -1436,7 +1436,7 @@ static void dcesrv_sock_accept(struct stream_connection *srv_conn)
                                                  socket_get_fd(srv_conn->socket),
                                                  &dcesrv_conn->stream);
                if (ret == -1) {
-                       status = map_nt_error_from_unix(errno);
+                       status = map_nt_error_from_unix_common(errno);
                        DEBUG(0, ("dcesrv_sock_accept: "
                                  "failed to setup tstream: %s\n",
                                  nt_errstr(status)));
index bcfd5effe4dc038db2556b17a881aca661c3fe0c..b000083eecd148c24134cb970822e5ec49366799 100644 (file)
@@ -201,7 +201,7 @@ NTSTATUS tstream_setup_named_pipe(TALLOC_CTX *mem_ctx,
        }
 
        if (!directory_create_or_exist(lpcfg_ncalrpc_dir(lp_ctx), geteuid(), 0755)) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                DEBUG(0,(__location__ ": Failed to create ncalrpc pipe directory '%s' - %s\n",
                         lpcfg_ncalrpc_dir(lp_ctx), nt_errstr(status)));
                goto fail;
@@ -213,7 +213,7 @@ NTSTATUS tstream_setup_named_pipe(TALLOC_CTX *mem_ctx,
        }
 
        if (!directory_create_or_exist(dirname, geteuid(), 0700)) {
-               status = map_nt_error_from_unix(errno);
+               status = map_nt_error_from_unix_common(errno);
                DEBUG(0,(__location__ ": Failed to create stream pipe directory '%s' - %s\n",
                         dirname, nt_errstr(status)));
                goto fail;