summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmb_dir.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-10-29 11:56:51 -0700
committerJeremy Allison <jra@samba.org>2010-10-29 19:40:16 +0000
commit14ff2e8de9bd8d0064762234555260f5eea643fe (patch)
treeabd73a321e4f9855c9fcaf729d7a9ef7f91112ab /source3/libsmb/libsmb_dir.c
parent606a447503defdeddc84ae03e06b392517c840c5 (diff)
downloadsamba-14ff2e8de9bd8d0064762234555260f5eea643fe.tar.gz
samba-14ff2e8de9bd8d0064762234555260f5eea643fe.tar.bz2
samba-14ff2e8de9bd8d0064762234555260f5eea643fe.zip
Fix bug #7700 - Improvement of return code of smbclient
Based on an initial patch from H Hasegawa <hasegawa.hiroyuki@fujixerox.co.jp>. Convert cli_list and associated functions to take calls that return NTSTATUS. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Oct 29 19:40:16 UTC 2010 on sn-devel-104
Diffstat (limited to 'source3/libsmb/libsmb_dir.c')
-rw-r--r--source3/libsmb/libsmb_dir.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index 9398f92612..fdaf949c08 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -147,9 +147,10 @@ list_unique_wg_fn(const char *name,
dirent_type = dir->dir_type;
if (add_dirent(dir, name, comment, dirent_type) < 0) {
-
/* An error occurred, what do we do? */
/* FIXME: Add some code here */
+ /* Change cli_NetServerEnum to take a fn
+ returning NTSTATUS... JRA. */
}
/* Point to the one just added */
@@ -227,14 +228,14 @@ list_fn(const char *name,
}
if (add_dirent(dir, name, comment, dirent_type) < 0) {
-
/* An error occurred, what do we do? */
/* FIXME: Add some code here */
-
+ /* Change cli_NetServerEnum to take a fn
+ returning NTSTATUS... JRA. */
}
}
-static void
+static NTSTATUS
dir_list_fn(const char *mnt,
struct file_info *finfo,
const char *mask,
@@ -243,13 +244,10 @@ dir_list_fn(const char *mnt,
if (add_dirent((SMBCFILE *)state, finfo->name, "",
(finfo->mode&aDIR?SMBC_DIR:SMBC_FILE)) < 0) {
-
- /* Handle an error ... */
-
- /* FIXME: Add some code ... */
-
+ SMBCFILE *dir = (SMBCFILE *)state;
+ return map_nt_error_from_unix(dir->dir_error);
}
-
+ return NT_STATUS_OK;
}
static int
@@ -1211,7 +1209,7 @@ SMBC_mkdir_ctx(SMBCCTX *context,
* Our list function simply checks to see if a directory is not empty
*/
-static void
+static NTSTATUS
rmdir_list_fn(const char *mnt,
struct file_info *finfo,
const char *mask,
@@ -1222,6 +1220,7 @@ rmdir_list_fn(const char *mnt,
bool *smbc_rmdir_dirempty = (bool *)state;
*smbc_rmdir_dirempty = false;
}
+ return NT_STATUS_OK;
}
/*