summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmb_file.c
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@dworkin.(none)>2009-03-27 18:02:46 -0400
committerDerrell Lipman <derrell@dworkin.(none)>2009-03-27 18:02:46 -0400
commitc33f3d5cba21c8cf267daab5450bc95ea7e68967 (patch)
treef7e1ec8119dfa99e012aa587a1e68a5e2222298c /source3/libsmb/libsmb_file.c
parent4b88f2c17e18f87d8ba0e35e057d7bb8a27614dd (diff)
downloadsamba-c33f3d5cba21c8cf267daab5450bc95ea7e68967.tar.gz
samba-c33f3d5cba21c8cf267daab5450bc95ea7e68967.tar.bz2
samba-c33f3d5cba21c8cf267daab5450bc95ea7e68967.zip
[Bug 6228] SMBC_open_ctx failure due to path resolve failure doesn't set errno
Fixed. It turns out there were a number of places where cli_resolve_path() was called and the error path upon that function failing did not set errno. There were a couple of places the failure handling code did set errno to ENOENT, so I made them all consistent, although I think better errno choices for this condition exist, e.g. EHOSTUNREACH. Derrell
Diffstat (limited to 'source3/libsmb/libsmb_file.c')
-rw-r--r--source3/libsmb/libsmb_file.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c
index 06e41ad21e..aa02807092 100644
--- a/source3/libsmb/libsmb_file.c
+++ b/source3/libsmb/libsmb_file.c
@@ -119,6 +119,7 @@ SMBC_open_ctx(SMBCCTX *context,
srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
SAFE_FREE(file);
TALLOC_FREE(frame);
return NULL;
@@ -300,6 +301,7 @@ SMBC_read_ctx(SMBCCTX *context,
file->srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -390,6 +392,7 @@ SMBC_write_ctx(SMBCCTX *context,
file->srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -466,6 +469,7 @@ SMBC_close_ctx(SMBCCTX *context,
file->srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -549,6 +553,7 @@ SMBC_getatr(SMBCCTX * context,
srv->cli, fixedpath,
&targetcli, &targetpath)) {
d_printf("Couldn't resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return False;
}
@@ -762,6 +767,7 @@ SMBC_lseek_ctx(SMBCCTX *context,
file->srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -854,6 +860,7 @@ SMBC_ftruncate_ctx(SMBCCTX *context,
file->srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}