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:
NT_STATUS_HAVE_NO_MEMORY(*tempdir);
if (mkdtemp(*tempdir) == NULL) {
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);
if (local_deltree(tctx->outputdir) == -1) {
if (errno != 0) {
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;
}
}
return NT_STATUS_UNSUCCESSFUL;
}
s, &n);
if (!ret) {
va_end(ap);
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;
}
pointers[i].length = n;
pointers[i].length -= 2;
s, &n);
if (!ret) {
va_end(ap);
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;
}
pointers[i].length = n;
pointers[i].length -= 1;
s, &n);
if (!ret) {
va_end(ap);
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;
}
pointers[i].length = n;
pointers[i].length -= 2;
nomem:
in->recv_errno = ENOMEM;
error:
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) {
nterror:
/* in connected mode the first pending search gets the error */
if (!c->connected) {
NULL, 0,
&any);
if (ret != 0) {
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;
goto nterror;
}
local_addr = any;
ret = tdgram_inet_udp_socket(local_addr, remote_addr,
c, &c->sock);
if (ret != 0) {
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);
goto nterror;
}
talloc_free(any);
talloc_free(subreq);
if (ret == -1) {
NTSTATUS status;
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);
DLIST_REMOVE(state->caller.cldap->searches.list, state);
ZERO_STRUCT(state->caller.cldap);
tevent_req_nterror(req, status);
ret = tsocket_address_inet_from_strings(state, "ip", NULL, 0,
&local_addr);
if (ret != 0) {
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) {
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) {
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);
}
return tevent_req_post(req, ev);
}
TALLOC_FREE(subreq);
if (len == -1 && err != 0) {
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));
TALLOC_FREE(subreq);
if (len == -1 && err != 0) {
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));
}
if (!tevent_req_poll(subreq, ev)) {
}
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;
}
talloc_free(frame);
return status;
}
}
if (!tevent_req_poll(subreq, ev)) {
}
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;
}
talloc_free(frame);
return status;
}
}
if (!tevent_req_poll(subreq, ev)) {
}
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;
}
talloc_free(frame);
return status;
}
/*********************************************************************
Map an NT error code from a Unix error code.
*********************************************************************/
/*********************************************************************
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)
/*********************************************************************
Map an NT error code from a Unix error code.
*********************************************************************/
/*********************************************************************
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);
NTSTATUS nt_status_squash(NTSTATUS nt_status);
ret = tstream_readv_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret == -1) {
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;
}
tevent_req_nterror(req, status);
return;
}
dir = sys_opendir(modules_path(talloc_tos(),
SAMBA_SUBSYSTEM_GPEXT));
if (!dir) {
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))) {
}
while ((dirent = sys_readdir(dir))) {
}
if (write(tmp_fd, data_out, converted_size) != converted_size) {
}
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);
}
if (!tevent_req_poll(subreq, ev)) {
}
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;
}
talloc_free(frame);
return status;
}
}
if (!tevent_req_poll(subreq, ev)) {
}
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;
}
talloc_free(frame);
return status;
}
ret = tstream_readv_pdu_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret == -1) {
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;
}
tevent_req_nterror(req, status);
return;
}
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/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 \
lib/tallocmsg.o lib/dmallocmsg.o \
libsmb/clisigning.o libsmb/smb_signing.o \
../lib/util/charset/iconv.o intl/lang_tdb.o \
pac_blob.data, pac_blob.length,
&pac);
if (ret) {
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) {
}
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);
lpcfg_cldap_port(lp_ctx),
&socket_address);
if (ret != 0) {
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)));
DEBUG(0,("invalid address %s:%d - %s:%s\n",
address, lpcfg_cldap_port(lp_ctx),
gai_strerror(ret), nt_errstr(status)));
address, port,
&dns_socket->local_address);
if (ret != 0) {
address, port,
&dns_socket->local_address);
if (ret != 0) {
- status = map_nt_error_from_unix(errno);
+ status = map_nt_error_from_unix_common(errno);
dns_udp_socket,
&dns_udp_socket->dgram);
if (ret != 0) {
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;
DEBUG(0,("Failed to bind to %s:%u UDP - %s\n",
address, port, nt_errstr(status)));
return status;
ret = samba_runcmd_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret != 0) {
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;
}
} else {
service->confupdate.status = NT_STATUS_OK;
}
ret = samba_runcmd_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret != 0) {
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;
}
} else {
service->nameupdate.status = NT_STATUS_OK;
}
ret = samba_runcmd_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret != 0) {
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;
}
} else {
service->nameupdate.status = NT_STATUS_OK;
}
ret = samba_runcmd_recv(req, &sys_errno);
talloc_free(req);
if (ret != 0) {
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;
DEBUG(2,(__location__ ": RODC DNS Update failed: %s\n", nt_errstr(st->r->out.result)));
} else {
st->r->out.result = NT_STATUS_OK;
address, port,
&echo_socket->local_address);
if (ret != 0) {
address, port,
&echo_socket->local_address);
if (ret != 0) {
- status = map_nt_error_from_unix(errno);
+ status = map_nt_error_from_unix_common(errno);
echo_udp_socket,
&echo_udp_socket->dgram);
if (ret != 0) {
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;
DEBUG(0, ("Failed to bind to %s:%u UDP - %s\n",
address, port, nt_errstr(status)));
return status;
address, port,
&kdc_socket->local_address);
if (ret != 0) {
address, port,
&kdc_socket->local_address);
if (ret != 0) {
- status = map_nt_error_from_unix(errno);
+ status = map_nt_error_from_unix_common(errno);
kdc_udp_socket,
&kdc_udp_socket->dgram);
if (ret != 0) {
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;
DEBUG(0,("Failed to bind to %s:%u UDP - %s\n",
address, port, nt_errstr(status)));
return status;
conn, &conn->sockets.tls);
TALLOC_FREE(subreq);
if (ret == -1) {
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",
DEBUG(1,("ldapsrv_starttls_postprocess_done: accept_tls_loop: "
"tstream_tls_accept_recv() - %d:%s => %s",
}
fd = dup(sock->fd);
if (fd == -1) {
}
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;
}
close(sock->fd);
sock->fd = fd;
sock->fd = socket(PF_INET, type, 0);
if (sock->fd == -1) {
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";
}
sock->backend_name = "ipv4";
for non-blocking connect */
ret = getsockopt(sock->fd, SOL_SOCKET, SO_ERROR, &error, &len);
if (ret == -1) {
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);
- 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) {
}
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);
if (my_address && my_address->sockaddr) {
ret = bind(sock->fd, my_address->sockaddr, my_address->sockaddrlen);
if (ret == -1) {
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);
}
} else if (my_address) {
my_ip = interpret_addr2(my_address->addr);
ret = bind(sock->fd, (struct sockaddr *)&my_addr, sizeof(my_addr));
if (ret == -1) {
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);
if (srv_address->sockaddr) {
ret = connect(sock->fd, srv_address->sockaddr, srv_address->sockaddrlen);
if (ret == -1) {
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);
}
} else {
srv_ip = interpret_addr2(srv_address->addr);
ret = connect(sock->fd, (const struct sockaddr *)&srv_addr, sizeof(srv_addr));
if (ret == -1) {
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 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) {
}
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) {
}
}
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);
new_fd = accept(sock->fd, (struct sockaddr *)&cli_addr, &cli_addr_len);
if (new_fd == -1) {
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);
}
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);
if (gotlen == 0) {
return NT_STATUS_END_OF_FILE;
} else if (gotlen == -1) {
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);
return NT_STATUS_END_OF_FILE;
} else if (gotlen == -1) {
talloc_free(src);
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;
}
src->sockaddrlen = from_len;
len = send(sock->fd, blob->data, blob->length, 0);
if (len == -1) {
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);
(struct sockaddr *)&srv_addr, sizeof(srv_addr));
}
if (len == -1) {
(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);
*npending = value;
return NT_STATUS_OK;
}
*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 = {
}
static const struct socket_ops ipv4_ops = {
sock->fd = socket(PF_INET6, type, 0);
if (sock->fd == -1) {
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";
}
sock->backend_name = "ipv6";
if (my_address && my_address->sockaddr) {
ret = bind(sock->fd, my_address->sockaddr, my_address->sockaddrlen);
if (ret == -1) {
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;
}
} else if (my_address) {
struct in6_addr my_ip;
ret = bind(sock->fd, (struct sockaddr *)&my_addr, sizeof(my_addr));
if (ret == -1) {
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);
ret = connect(sock->fd, (const struct sockaddr *)&srv_addr, sizeof(srv_addr));
}
if (ret == -1) {
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);
}
return ip_connect_complete(sock, flags);
- 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) {
}
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) {
}
}
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);
new_fd = accept(sock->fd, (struct sockaddr *)&cli_addr, &cli_addr_len);
if (new_fd == -1) {
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);
}
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);
return NT_STATUS_END_OF_FILE;
} else if (gotlen == -1) {
talloc_free(src);
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;
}
src->sockaddrlen = from_len;
(struct sockaddr *)&srv_addr, sizeof(srv_addr));
}
if (len == -1) {
(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);
*/
static NTSTATUS unixdom_error(int ernum)
{
*/
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)
}
static NTSTATUS unixdom_init(struct socket_context *sock)
sock->fd = socket(PF_UNIX, type, 0);
if (sock->fd == -1) {
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;
}
sock->private_data = NULL;
for non-blocking connect */
ret = getsockopt(sock->fd, SOL_SOCKET, SO_ERROR, &error, &len);
if (ret == -1) {
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);
- 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) {
}
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);
int ret = set_blocking(new_fd, false);
if (ret == -1) {
close(new_fd);
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);
(struct sockaddr *)&srv_addr, sizeof(srv_addr));
}
if (len == -1) {
(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);
*npending = value;
return NT_STATUS_OK;
}
*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 = {
}
static const struct socket_ops unixdom_ops = {
/* setup a pipe to chat to our child */
ret = pipe(fd);
if (ret == -1) {
/* 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));
state->child = fork();
if (state->child == (pid_t)-1) {
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));
ok = tevent_req_poll(subreq, ev);
if (!ok) {
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;
}
TALLOC_FREE(frame);
return status;
}
ok = tevent_req_poll(subreq, ev);
if (!ok) {
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;
}
TALLOC_FREE(frame);
return status;
}
ok = tevent_req_poll(subreq, ev);
if (!ok) {
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;
}
TALLOC_FREE(frame);
return status;
}
our_ip, 0,
&state->local_address);
if (ret != 0) {
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);
}
tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
peer_ip, WINS_REPLICATION_PORT,
&state->remote_address);
if (ret != 0) {
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);
}
tevent_req_nterror(req, status);
return tevent_req_post(req, ev);
}
ret = tstream_inet_tcp_connect_recv(subreq, &sys_errno,
state, &state->stream, NULL);
if (ret != 0) {
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;
}
tevent_req_nterror(req, status);
return;
}
ret = tstream_writev_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret == -1) {
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;
TALLOC_FREE(state->caller.wrepl_socket->stream);
tevent_req_nterror(req, status);
return;
ret = tstream_disconnect_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret == -1) {
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;
TALLOC_FREE(state->caller.wrepl_socket->stream);
tevent_req_nterror(req, status);
return;
lpcfg_cldap_port(s->libnet->lp_ctx),
&dest_address);
if (ret != 0) {
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;
}
if (!composite_is_ok(c)) return;
}
&dest_address);
if (ret != 0) {
r->out.error_string = NULL;
&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);
lpcfg_cldap_port(s->libnet->lp_ctx),
&dest_address);
if (ret != 0) {
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;
}
if (!composite_is_ok(c)) return;
}
/* ignoring wildcards ... */
if (unlink(unix_path) == -1) {
/* ignoring wildcards ... */
if (unlink(unix_path) == -1) {
- return map_nt_error_from_unix(errno);
+ return map_nt_error_from_unix_common(errno);
unix_path = cifspsx_unix_path(ntvfs, req, cp->chkpath.in.path);
if (stat(unix_path, &st) == -1) {
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)) {
}
if (!S_ISDIR(st.st_mode)) {
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));
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);
}
DEBUG(19,("cifspsx_qpathinfo: file %s, stat done\n", unix_path));
return cifspsx_map_fileinfo(ntvfs, req, info, &st, unix_path);
}
if (fstat(f->fd, &st) == -1) {
}
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);
}
return cifspsx_map_fileinfo(ntvfs, req,info, &st, f->name);
case NTCREATEX_DISP_CREATE:
if (mkdir(unix_path, 0755) == -1) {
DEBUG(9,("cifspsx_open: mkdir %s errno=%d\n", unix_path, errno));
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));
}
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);
do_open:
fd = open(unix_path, flags, 0644);
if (fd == -1) {
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);
}
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);
}
status = ntvfs_handle_new(ntvfs, req, &handle);
unix_path = cifspsx_unix_path(ntvfs, req, md->mkdir.in.path);
if (mkdir(unix_path, 0777) == -1) {
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);
unix_path = cifspsx_unix_path(ntvfs, req, rd->in.path);
if (rmdir(unix_path) == -1) {
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);
unix_path2 = cifspsx_unix_path(ntvfs, req, ren->rename.in.pattern2);
if (rename(unix_path1, unix_path2) == -1) {
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);
rd->readx.in.maxcnt,
rd->readx.in.offset);
if (ret == -1) {
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;
}
rd->readx.out.nread = ret;
wr->writex.in.count,
wr->writex.in.offset);
if (ret == -1) {
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;
}
wr->writex.out.nwritten = ret;
}
if (close(f->fd) == -1) {
}
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);
}
DLIST_REMOVE(p->open_files, f);
case RAW_SFILEINFO_END_OF_FILE_INFORMATION:
if (ftruncate(f->fd,
info->end_of_file_info.in.size) == -1) {
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:
}
break;
case RAW_SFILEINFO_SETATTRE:
if (sys_fsusage(p->connectpath,
&fs->generic.out.blocks_free,
&fs->generic.out.blocks_total) == -1) {
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;
}
fs->generic.out.block_size = 512;
}
if (stat(p->connectpath, &st) == -1) {
}
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);
}
unix_to_nt_time(&fs->generic.out.create_time, st.st_ctime);
&p->allocation_size);
TALLOC_FREE(subreq);
if (ret == -1) {
&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);
ret = tstream_readv_pdu_queue_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret == -1) {
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);
ret = tstream_writev_queue_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret == -1) {
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);
status = NT_STATUS_PIPE_DISCONNECTED;
goto reply;
} else if (ret == -1) {
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);
ret = tstream_readv_pdu_queue_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret == -1) {
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);
ret = tstream_writev_queue_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret == -1) {
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);
ret = tstream_readv_pdu_queue_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret == -1) {
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);
NTSTATUS pvfs_map_errno(struct pvfs_state *pvfs, int unix_errno)
{
NTSTATUS status;
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;
}
DEBUG(10,(__location__ " mapped unix errno %d -> %s\n", unix_errno, nt_errstr(status)));
return status;
}
/* ignoring wildcards ... */
if (unlink(unix_path) == -1) {
/* ignoring wildcards ... */
if (unlink(unix_path) == -1) {
- return map_nt_error_from_unix(errno);
+ return map_nt_error_from_unix_common(errno);
unix_path = svfs_unix_path(ntvfs, req, cp->chkpath.in.path);
if (stat(unix_path, &st) == -1) {
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)) {
}
if (!S_ISDIR(st.st_mode)) {
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));
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);
}
DEBUG(19,("svfs_qpathinfo: file %s, stat done\n", unix_path));
return svfs_map_fileinfo(ntvfs, req, info, &st, unix_path);
}
if (fstat(f->fd, &st) == -1) {
}
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);
}
return svfs_map_fileinfo(ntvfs, req,info, &st, f->name);
case NTCREATEX_DISP_CREATE:
if (mkdir(unix_path, 0755) == -1) {
DEBUG(9,("svfs_open: mkdir %s errno=%d\n", unix_path, errno));
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));
}
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);
do_open:
fd = open(unix_path, flags, 0644);
if (fd == -1) {
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);
}
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);
}
status = ntvfs_handle_new(ntvfs, req, &handle);
unix_path = svfs_unix_path(ntvfs, req, md->mkdir.in.path);
if (mkdir(unix_path, 0777) == -1) {
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);
unix_path = svfs_unix_path(ntvfs, req, rd->in.path);
if (rmdir(unix_path) == -1) {
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);
unix_path2 = svfs_unix_path(ntvfs, req, ren->rename.in.pattern2);
if (rename(unix_path1, unix_path2) == -1) {
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);
rd->readx.in.maxcnt,
rd->readx.in.offset);
if (ret == -1) {
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;
}
rd->readx.out.nread = ret;
wr->writex.in.count,
wr->writex.in.offset);
if (ret == -1) {
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;
}
wr->writex.out.nwritten = ret;
}
if (close(f->fd) == -1) {
}
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);
}
DLIST_REMOVE(p->open_files, f);
case RAW_SFILEINFO_END_OF_FILE_INFORMATION:
if (ftruncate(f->fd,
info->end_of_file_info.in.size) == -1) {
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:
}
break;
case RAW_SFILEINFO_SETATTRE:
if (sys_fsusage(p->connectpath,
&fs->generic.out.blocks_free,
&fs->generic.out.blocks_total) == -1) {
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;
}
fs->generic.out.block_size = 512;
}
if (stat(p->connectpath, &st) == -1) {
}
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);
}
unix_to_nt_time(&fs->generic.out.create_time, st.st_ctime);
if (in->fd == -1) {
DEBUG(0,("Failed to init inotify - %s\n", strerror(errno)));
talloc_free(in);
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;
}
in->ctx = ctx;
in->watches = NULL;
}
DEBUG(0,("Failed to tevent_add_fd() - %s\n", strerror(errno)));
talloc_free(in);
}
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);
}
tevent_fd_set_auto_close(fde);
wd = inotify_add_watch(in->fd, e->path, mask);
if (wd == -1) {
e->filter = filter;
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);
}
w = talloc(in, struct inotify_watch_context);
ret = fcntl(*fd, F_SETSIG, LINUX_LEASE_RT_SIGNAL);
if (ret == -1) {
talloc_free(p);
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);
}
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);
ret = tstream_writev_queue_recv(subreq, &sys_errno);
TALLOC_FREE(subreq);
if (ret == -1) {
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;
}
dcesrv_terminate_connection(substate->dce_conn, nt_errstr(status));
return;
}
socket_get_fd(srv_conn->socket),
&dcesrv_conn->stream);
if (ret == -1) {
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)));
DEBUG(0, ("dcesrv_sock_accept: "
"failed to setup tstream: %s\n",
nt_errstr(status)));
}
if (!directory_create_or_exist(lpcfg_ncalrpc_dir(lp_ctx), geteuid(), 0755)) {
}
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;
DEBUG(0,(__location__ ": Failed to create ncalrpc pipe directory '%s' - %s\n",
lpcfg_ncalrpc_dir(lp_ctx), nt_errstr(status)));
goto fail;
}
if (!directory_create_or_exist(dirname, geteuid(), 0700)) {
}
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;
DEBUG(0,(__location__ ": Failed to create stream pipe directory '%s' - %s\n",
dirname, nt_errstr(status)));
goto fail;