summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-20 14:55:32 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-20 08:12:03 +0200
commita1f04e8abc761ef1ba211420ff1dbda50fcf527d (patch)
tree77f452c87c7e859341728e2835bd7493b6d8c9c7
parent018f4a5889743f742a59e9ad72056b2ea09adfe9 (diff)
downloadsamba-a1f04e8abc761ef1ba211420ff1dbda50fcf527d.tar.gz
libcli/util Rename common map_nt_error_from_unix to avoid duplicate symbol
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
-rw-r--r--lib/torture/torture.c4
-rw-r--r--libcli/auth/msrpc_parse.c6
-rw-r--r--libcli/cldap/cldap.c8
-rw-r--r--libcli/echo/echo.c10
-rw-r--r--libcli/nbt/namerefresh.c2
-rw-r--r--libcli/nbt/nameregister.c4
-rw-r--r--libcli/util/errmap_unix.c2
-rw-r--r--libcli/util/error.h2
-rw-r--r--libcli/util/tstream.c2
-rw-r--r--libgpo/gpext/gpext.c2
-rw-r--r--libgpo/gpo_ini.c2
-rw-r--r--librpc/rpc/binding_handle.c4
-rw-r--r--librpc/rpc/dcerpc_util.c2
-rw-r--r--source3/Makefile.in2
-rw-r--r--source4/auth/kerberos/kerberos_pac.c4
-rw-r--r--source4/cldap_server/cldap_server.c2
-rw-r--r--source4/dns_server/dns_server.c4
-rw-r--r--source4/dsdb/dns/dns_update.c8
-rw-r--r--source4/echo_server/echo_server.c4
-rw-r--r--source4/kdc/kdc.c4
-rw-r--r--source4/ldap_server/ldap_extended.c2
-rw-r--r--source4/lib/socket/socket.c2
-rw-r--r--source4/lib/socket/socket_ip.c58
-rw-r--r--source4/lib/socket/socket_unix.c16
-rw-r--r--source4/libcli/resolve/dns_ex.c4
-rw-r--r--source4/libcli/smb2/connect.c2
-rw-r--r--source4/libcli/smb2/session.c2
-rw-r--r--source4/libcli/smb_composite/smb2.c2
-rw-r--r--source4/libcli/wrepl/winsrepl.c10
-rw-r--r--source4/libnet/libnet_become_dc.c2
-rw-r--r--source4/libnet/libnet_site.c2
-rw-r--r--source4/libnet/libnet_unbecome_dc.c2
-rw-r--r--source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c34
-rw-r--r--source4/ntvfs/ipc/vfs_ipc.c14
-rw-r--r--source4/ntvfs/posix/pvfs_util.c2
-rw-r--r--source4/ntvfs/simple/vfs_simple.c34
-rw-r--r--source4/ntvfs/sysdep/inotify.c6
-rw-r--r--source4/ntvfs/sysdep/sys_lease_linux.c4
-rw-r--r--source4/rpc_server/dcerpc_server.c4
-rw-r--r--source4/smbd/service_named_pipe.c4
40 files changed, 142 insertions, 142 deletions
diff --git a/lib/torture/torture.c b/lib/torture/torture.c
index a0b35bfe7ca..cee6bdb934d 100644
--- a/lib/torture/torture.c
+++ b/lib/torture/torture.c
@@ -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;
}
diff --git a/libcli/auth/msrpc_parse.c b/libcli/auth/msrpc_parse.c
index bdbba3d76cc..8b64e98feb2 100644
--- a/libcli/auth/msrpc_parse.c
+++ b/libcli/auth/msrpc_parse.c
@@ -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;
diff --git a/libcli/cldap/cldap.c b/libcli/cldap/cldap.c
index 37b4f4913db..59c54eabea9 100644
--- a/libcli/cldap/cldap.c
+++ b/libcli/cldap/cldap.c
@@ -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);
diff --git a/libcli/echo/echo.c b/libcli/echo/echo.c
index 271f71b0ae8..b6005cb32c0 100644
--- a/libcli/echo/echo.c
+++ b/libcli/echo/echo.c
@@ -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;
}
diff --git a/libcli/nbt/namerefresh.c b/libcli/nbt/namerefresh.c
index 79c6c1f2ea1..b525356c747 100644
--- a/libcli/nbt/namerefresh.c
+++ b/libcli/nbt/namerefresh.c
@@ -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;
}
diff --git a/libcli/nbt/nameregister.c b/libcli/nbt/nameregister.c
index 204fb6f3284..ff5418c85e5 100644
--- a/libcli/nbt/nameregister.c
+++ b/libcli/nbt/nameregister.c
@@ -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;
}
diff --git a/libcli/util/errmap_unix.c b/libcli/util/errmap_unix.c
index 75b1e8d2fed..8f9f89835ed 100644
--- a/libcli/util/errmap_unix.c
+++ b/libcli/util/errmap_unix.c
@@ -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;
diff --git a/libcli/util/error.h b/libcli/util/error.h
index 771d7a661e9..5c4dc10916b 100644
--- a/libcli/util/error.h
+++ b/libcli/util/error.h
@@ -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);
diff --git a/libcli/util/tstream.c b/libcli/util/tstream.c
index b287597c62c..12cef9b6ddd 100644
--- a/libcli/util/tstream.c
+++ b/libcli/util/tstream.c
@@ -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;
}
diff --git a/libgpo/gpext/gpext.c b/libgpo/gpext/gpext.c
index 640aae6aaf2..42ab6223312 100644
--- a/libgpo/gpext/gpext.c
+++ b/libgpo/gpext/gpext.c
@@ -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))) {
diff --git a/libgpo/gpo_ini.c b/libgpo/gpo_ini.c
index a4bff0e86b8..494162466d0 100644
--- a/libgpo/gpo_ini.c
+++ b/libgpo/gpo_ini.c
@@ -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;
}
diff --git a/librpc/rpc/binding_handle.c b/librpc/rpc/binding_handle.c
index 6c2d8a8b12b..1e90827dbe1 100644
--- a/librpc/rpc/binding_handle.c
+++ b/librpc/rpc/binding_handle.c
@@ -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;
}
diff --git a/librpc/rpc/dcerpc_util.c b/librpc/rpc/dcerpc_util.c
index a405ca8966a..de292c83669 100644
--- a/librpc/rpc/dcerpc_util.c
+++ b/librpc/rpc/dcerpc_util.c
@@ -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;
}
diff --git a/source3/Makefile.in b/source3/Makefile.in
index 6c17947f720..3df9ab47f6e 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -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 \
diff --git a/source4/auth/kerberos/kerberos_pac.c b/source4/auth/kerberos/kerberos_pac.c
index 5bc80c9a583..8ce970e4867 100644
--- a/source4/auth/kerberos/kerberos_pac.c
+++ b/source4/auth/kerberos/kerberos_pac.c
@@ -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;
}
diff --git a/source4/cldap_server/cldap_server.c b/source4/cldap_server/cldap_server.c
index 9370c59df27..d3e8b7fffa4 100644
--- a/source4/cldap_server/cldap_server.c
+++ b/source4/cldap_server/cldap_server.c
@@ -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)));
diff --git a/source4/dns_server/dns_server.c b/source4/dns_server/dns_server.c
index de8bc125420..0c36c20773b 100644
--- a/source4/dns_server/dns_server.c
+++ b/source4/dns_server/dns_server.c
@@ -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;
diff --git a/source4/dsdb/dns/dns_update.c b/source4/dsdb/dns/dns_update.c
index 603a218ef99..6650534d131 100644
--- a/source4/dsdb/dns/dns_update.c
+++ b/source4/dsdb/dns/dns_update.c
@@ -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;
diff --git a/source4/echo_server/echo_server.c b/source4/echo_server/echo_server.c
index 9393a972e27..60729d8535c 100644
--- a/source4/echo_server/echo_server.c
+++ b/source4/echo_server/echo_server.c
@@ -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;
diff --git a/source4/kdc/kdc.c b/source4/kdc/kdc.c
index 7f7782ca9b6..07234080439 100644
--- a/source4/kdc/kdc.c
+++ b/source4/kdc/kdc.c
@@ -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;
diff --git a/source4/ldap_server/ldap_extended.c b/source4/ldap_server/ldap_extended.c
index f70b8084d7f..5cfa2d3b16f 100644
--- a/source4/ldap_server/ldap_extended.c
+++ b/source4/ldap_server/ldap_extended.c
@@ -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",
diff --git a/source4/lib/socket/socket.c b/source4/lib/socket/socket.c
index b16e38c372d..2dbdaad11df 100644
--- a/source4/lib/socket/socket.c
+++ b/source4/lib/socket/socket.c
@@ -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;
diff --git a/source4/lib/socket/socket_ip.c b/source4/lib/socket/socket_ip.c
index bf0aff74ec9..80f7d333f38 100644
--- a/source4/lib/socket/socket_ip.c
+++ b/source4/lib/socket/socket_ip.c
@@ -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;
diff --git a/source4/lib/socket/socket_unix.c b/source4/lib/socket/socket_unix.c
index f1fa0a3a30c..d492f012681 100644
--- a/source4/lib/socket/socket_unix.c
+++ b/source4/lib/socket/socket_unix.c
@@ -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 = {
diff --git a/source4/libcli/resolve/dns_ex.c b/source4/libcli/resolve/dns_ex.c
index 1d56a4b4d5c..59212125793 100644
--- a/source4/libcli/resolve/dns_ex.c
+++ b/source4/libcli/resolve/dns_ex.c
@@ -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;
}
diff --git a/source4/libcli/smb2/connect.c b/source4/libcli/smb2/connect.c
index c5cacc3e0b2..0e3bf1512be 100644
--- a/source4/libcli/smb2/connect.c
+++ b/source4/libcli/smb2/connect.c
@@ -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;
}
diff --git a/source4/libcli/smb2/session.c b/source4/libcli/smb2/session.c
index 0f285ecd878..d46cdefc69a 100644
--- a/source4/libcli/smb2/session.c
+++ b/source4/libcli/smb2/session.c
@@ -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;
}
diff --git a/source4/libcli/smb_composite/smb2.c b/source4/libcli/smb_composite/smb2.c
index 1f8ec834ca9..5c93869b5c8 100644
--- a/source4/libcli/smb_composite/smb2.c
+++ b/source4/libcli/smb_composite/smb2.c
@@ -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;
}
diff --git a/source4/libcli/wrepl/winsrepl.c b/source4/libcli/wrepl/winsrepl.c
index 0dee2c56cf3..72c040d3a16 100644
--- a/source4/libcli/wrepl/winsrepl.c
+++ b/source4/libcli/wrepl/winsrepl.c
@@ -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;
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index a68f4c5ea05..4d845ca1f08 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -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;
}
diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c
index f49108b28a9..a74dd59a22b 100644
--- a/source4/libnet/libnet_site.c
+++ b/source4/libnet/libnet_site.c
@@ -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;
}
diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c
index 4bffc5079e7..85d47a91f92 100644
--- a/source4/libnet/libnet_unbecome_dc.c
+++ b/source4/libnet/libnet_unbecome_dc.c
@@ -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;
}
diff --git a/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c b/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c
index 2a8c69e2207..949b6dbbb76 100644
--- a/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c
+++ b/source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c
@@ -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);
diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c
index 185e72cfb0f..fc9ff4fb12d 100644
--- a/source4/ntvfs/ipc/vfs_ipc.c
+++ b/source4/ntvfs/ipc/vfs_ipc.c
@@ -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;
}
diff --git a/source4/ntvfs/posix/pvfs_util.c b/source4/ntvfs/posix/pvfs_util.c
index 8dedf13a633..c6c6eaa13c8 100644
--- a/source4/ntvfs/posix/pvfs_util.c
+++ b/source4/ntvfs/posix/pvfs_util.c
@@ -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;
}
diff --git a/source4/ntvfs/simple/vfs_simple.c b/source4/ntvfs/simple/vfs_simple.c
index 03bf76634d1..7ae41db521b 100644
--- a/source4/ntvfs/simple/vfs_simple.c
+++ b/source4/ntvfs/simple/vfs_simple.c
@@ -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);
diff --git a/source4/ntvfs/sysdep/inotify.c b/source4/ntvfs/sysdep/inotify.c
index 42aac0b0974..28ea32e8a00 100644
--- a/source4/ntvfs/sysdep/inotify.c
+++ b/source4/ntvfs/sysdep/inotify.c
@@ -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);
diff --git a/source4/ntvfs/sysdep/sys_lease_linux.c b/source4/ntvfs/sysdep/sys_lease_linux.c
index c0fb4335d96..3b0605b73b9 100644
--- a/source4/ntvfs/sysdep/sys_lease_linux.c
+++ b/source4/ntvfs/sysdep/sys_lease_linux.c
@@ -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);
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index b738c9d5856..cbba5e24085 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -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)));
diff --git a/source4/smbd/service_named_pipe.c b/source4/smbd/service_named_pipe.c
index bcfd5effe4d..b000083eecd 100644
--- a/source4/smbd/service_named_pipe.c
+++ b/source4/smbd/service_named_pipe.c
@@ -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;