From a1f04e8abc761ef1ba211420ff1dbda50fcf527d Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 20 Jun 2011 14:55:32 +1000 Subject: 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 Autobuild-Date: Mon Jun 20 08:12:03 CEST 2011 on sn-devel-104 --- source4/auth/kerberos/kerberos_pac.c | 4 +- source4/cldap_server/cldap_server.c | 2 +- source4/dns_server/dns_server.c | 4 +- source4/dsdb/dns/dns_update.c | 8 ++-- source4/echo_server/echo_server.c | 4 +- source4/kdc/kdc.c | 4 +- source4/ldap_server/ldap_extended.c | 2 +- source4/lib/socket/socket.c | 2 +- source4/lib/socket/socket_ip.c | 58 +++++++++++++-------------- source4/lib/socket/socket_unix.c | 16 ++++---- source4/libcli/resolve/dns_ex.c | 4 +- source4/libcli/smb2/connect.c | 2 +- source4/libcli/smb2/session.c | 2 +- source4/libcli/smb_composite/smb2.c | 2 +- source4/libcli/wrepl/winsrepl.c | 10 ++--- source4/libnet/libnet_become_dc.c | 2 +- source4/libnet/libnet_site.c | 2 +- source4/libnet/libnet_unbecome_dc.c | 2 +- source4/ntvfs/cifs_posix_cli/vfs_cifs_posix.c | 34 ++++++++-------- source4/ntvfs/ipc/vfs_ipc.c | 14 +++---- source4/ntvfs/posix/pvfs_util.c | 2 +- source4/ntvfs/simple/vfs_simple.c | 34 ++++++++-------- source4/ntvfs/sysdep/inotify.c | 6 +-- source4/ntvfs/sysdep/sys_lease_linux.c | 4 +- source4/rpc_server/dcerpc_server.c | 4 +- source4/smbd/service_named_pipe.c | 4 +- 26 files changed, 116 insertions(+), 116 deletions(-) (limited to 'source4') diff --git a/source4/auth/kerberos/kerberos_pac.c b/source4/auth/kerberos/kerberos_pac.c index 5bc80c9a58..8ce970e486 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 9370c59df2..d3e8b7fffa 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 de8bc12542..0c36c20773 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 603a218ef9..6650534d13 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 9393a972e2..60729d8535 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 7f7782ca9b..0723408043 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 f70b8084d7..5cfa2d3b16 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 b16e38c372..2dbdaad11d 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 bf0aff74ec..80f7d333f3 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 f1fa0a3a30..d492f01268 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 1d56a4b4d5..5921212579 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 c5cacc3e0b..0e3bf1512b 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 0f285ecd87..d46cdefc69 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 1f8ec834ca..5c93869b5c 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 0dee2c56cf..72c040d3a1 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 a68f4c5ea0..4d845ca1f0 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 f49108b28a..a74dd59a22 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 4bffc5079e..85d47a91f9 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 2a8c69e220..949b6dbbb7 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 185e72cfb0..fc9ff4fb12 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 8dedf13a63..c6c6eaa13c 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 03bf76634d..7ae41db521 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 42aac0b097..28ea32e8a0 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 c0fb4335d9..3b0605b73b 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 b738c9d585..cbba5e2408 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 bcfd5effe4..b000083eec 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; -- cgit