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 a0b35bf..cee6bdb 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 bdbba3d..8b64e98 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 37b4f49..59c54ea 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 271f71b..b6005cb 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 79c6c1f..b525356 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 204fb6f..ff5418c 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 75b1e8d..8f9f898 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 771d7a6..5c4dc10 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 b287597..12cef9b 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 640aae6..42ab622 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 a4bff0e..4941624 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 6c2d8a8..1e90827 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 a405ca8..de292c8 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 6c17947..3df9ab4 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 5bc80c9..8ce970e 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 9370c59..d3e8b7f 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 de8bc12..0c36c20 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 603a218..6650534 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 9393a97..60729d8 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 7f7782c..0723408 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 f70b808..5cfa2d3 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 b16e38c..2dbdaad 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 bf0aff7..80f7d33 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 f1fa0a3..d492f01 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 1d56a4b..5921212 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 c5cacc3..0e3bf15 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 0f285ec..d46cdef 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 1f8ec83..5c93869 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 0dee2c5..72c040d 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 a68f4c5..4d845ca 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 f49108b..a74dd59 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 4bffc50..85d47a9 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 2a8c69e..949b6db 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 185e72c..fc9ff4f 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 8dedf13..c6c6eaa 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 03bf766..7ae41db 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 42aac0b..28ea32e 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 c0fb433..3b0605b 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 b738c9d..cbba5e2 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 bcfd5ef..b000083 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;