[SCM] Samba Shared Repository - branch v3-3-test updated -
release-3-2-0pre2-5177-gb24583e
Derrell Lipman
derrell at samba.org
Fri Mar 27 22:04:21 GMT 2009
The branch, v3-3-test has been updated
via b24583e17ac845d327e1f20f4c6f30215bb3815e (commit)
via d72271908e0d67eb31fbc1d818d6f2c720bd7fbb (commit)
from 58d3ec1cb81d6086d65cd12acd16cd591cf0c71f (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test
- Log -----------------------------------------------------------------
commit b24583e17ac845d327e1f20f4c6f30215bb3815e
Merge: d72271908e0d67eb31fbc1d818d6f2c720bd7fbb 58d3ec1cb81d6086d65cd12acd16cd591cf0c71f
Author: Derrell Lipman <derrell at dworkin.(none)>
Date: Fri Mar 27 18:03:36 2009 -0400
Merge branch 'v3-3-test' of ssh://git.samba.org/data/git/samba into v3-3-test
commit d72271908e0d67eb31fbc1d818d6f2c720bd7fbb
Author: Derrell Lipman <derrell at dworkin.(none)>
Date: Fri Mar 27 16:56:33 2009 -0400
[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
-----------------------------------------------------------------------
Summary of changes:
source/libsmb/libsmb_dir.c | 8 +++++++-
source/libsmb/libsmb_file.c | 7 +++++++
source/libsmb/libsmb_stat.c | 1 +
3 files changed, 15 insertions(+), 1 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/libsmb/libsmb_dir.c b/source/libsmb/libsmb_dir.c
index 89782ce..8846abb 100644
--- a/source/libsmb/libsmb_dir.c
+++ b/source/libsmb/libsmb_dir.c
@@ -1169,7 +1169,8 @@ SMBC_mkdir_ctx(SMBCCTX *context,
if (!cli_resolve_path(frame, "", srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
- TALLOC_FREE(frame);
+ errno = ENOENT;
+ TALLOC_FREE(frame);
return -1;
}
/*d_printf(">>>mkdir: resolved path as %s\n", targetpath);*/
@@ -1276,6 +1277,7 @@ SMBC_rmdir_ctx(SMBCCTX *context,
if (!cli_resolve_path(frame, "", srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -1558,6 +1560,7 @@ SMBC_chmod_ctx(SMBCCTX *context,
if (!cli_resolve_path(frame, "", srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -1749,6 +1752,7 @@ SMBC_unlink_ctx(SMBCCTX *context,
if (!cli_resolve_path(frame, "", srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -1921,6 +1925,7 @@ SMBC_rename_ctx(SMBCCTX *ocontext,
if (!cli_resolve_path(frame, "", srv->cli, path1,
&targetcli1, &targetpath1)) {
d_printf("Could not resolve %s\n", path1);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -1936,6 +1941,7 @@ SMBC_rename_ctx(SMBCCTX *ocontext,
if (!cli_resolve_path(frame, "", srv->cli, path2,
&targetcli2, &targetpath2)) {
d_printf("Could not resolve %s\n", path2);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
diff --git a/source/libsmb/libsmb_file.c b/source/libsmb/libsmb_file.c
index 1bbb47d..8741ed6 100644
--- a/source/libsmb/libsmb_file.c
+++ b/source/libsmb/libsmb_file.c
@@ -118,6 +118,7 @@ SMBC_open_ctx(SMBCCTX *context,
if (!cli_resolve_path(frame, "", srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
SAFE_FREE(file);
TALLOC_FREE(frame);
return NULL;
@@ -298,6 +299,7 @@ SMBC_read_ctx(SMBCCTX *context,
if (!cli_resolve_path(frame, "", file->srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -387,6 +389,7 @@ SMBC_write_ctx(SMBCCTX *context,
if (!cli_resolve_path(frame, "", file->srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -462,6 +465,7 @@ SMBC_close_ctx(SMBCCTX *context,
if (!cli_resolve_path(frame, "", file->srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -544,6 +548,7 @@ SMBC_getatr(SMBCCTX * context,
if (!cli_resolve_path(frame, "", srv->cli, fixedpath,
&targetcli, &targetpath)) {
d_printf("Couldn't resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return False;
}
@@ -756,6 +761,7 @@ SMBC_lseek_ctx(SMBCCTX *context,
if (!cli_resolve_path(frame, "", file->srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
@@ -847,6 +853,7 @@ SMBC_ftruncate_ctx(SMBCCTX *context,
if (!cli_resolve_path(frame, "", file->srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
diff --git a/source/libsmb/libsmb_stat.c b/source/libsmb/libsmb_stat.c
index 64ddc78..9e081af 100644
--- a/source/libsmb/libsmb_stat.c
+++ b/source/libsmb/libsmb_stat.c
@@ -260,6 +260,7 @@ SMBC_fstat_ctx(SMBCCTX *context,
if (!cli_resolve_path(frame, "", file->srv->cli, path,
&targetcli, &targetpath)) {
d_printf("Could not resolve %s\n", path);
+ errno = ENOENT;
TALLOC_FREE(frame);
return -1;
}
--
Samba Shared Repository
More information about the samba-cvs
mailing list