From ef2e26c91b80556af033d3335e55f5dfa6fff31d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Aug 2003 01:53:07 +0000 Subject: first public release of samba4 code (This used to be commit b0510b5428b3461aeb9bbe3cc95f62fc73e2b97f) --- source4/libcli/clideltree.c | 117 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 source4/libcli/clideltree.c (limited to 'source4/libcli/clideltree.c') diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c new file mode 100644 index 0000000000..8769b8dfa7 --- /dev/null +++ b/source4/libcli/clideltree.c @@ -0,0 +1,117 @@ +/* + Unix SMB/CIFS implementation. + useful function for deleting a whole directory tree + Copyright (C) Andrew Tridgell 2003 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" + +struct delete_state { + struct cli_state *cli; + int total_deleted; + BOOL failed; +}; + +/* + callback function for torture_deltree() +*/ +static void delete_fn(file_info *finfo, const char *name, void *state) +{ + struct delete_state *dstate = state; + char *s, *n; + if (strcmp(finfo->name, ".") == 0 || + strcmp(finfo->name, "..") == 0) return; + + n = strdup(name); + n[strlen(n)-1] = 0; + asprintf(&s, "%s%s", n, finfo->name); + + if (finfo->mode & FILE_ATTRIBUTE_READONLY) { + if (!cli_setatr(dstate->cli, s, 0, 0)) { + DEBUG(2,("Failed to remove READONLY on %s - %s\n", + s, cli_errstr(dstate->cli))); + } + } + + if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) { + char *s2; + asprintf(&s2, "%s\\*", s); + cli_unlink(dstate->cli, s2); + cli_list(dstate->cli, s2, + FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM, + delete_fn, state); + free(s2); + if (!cli_rmdir(dstate->cli, s)) { + DEBUG(2,("Failed to delete %s - %s\n", + s, cli_errstr(dstate->cli))); + dstate->failed = True; + } + dstate->total_deleted++; + } else { + if (!cli_unlink(dstate->cli, s)) { + DEBUG(2,("Failed to delete %s - %s\n", + s, cli_errstr(dstate->cli))); + dstate->failed = True; + } + dstate->total_deleted++; + } + free(s); + free(n); +} + +/* + recursively descend a tree deleting all files + returns the number of files deleted, or -1 on error +*/ +int cli_deltree(struct cli_state *cli, const char *dname) +{ + char *mask; + struct delete_state dstate; + + dstate.cli = cli; + dstate.total_deleted = 0; + dstate.failed = False; + + /* it might be a file */ + if (cli_unlink(cli, dname)) { + return 1; + } + if (NT_STATUS_EQUAL(cli_nt_error(cli), NT_STATUS_OBJECT_NAME_NOT_FOUND) || + NT_STATUS_EQUAL(cli_nt_error(cli), NT_STATUS_OBJECT_PATH_NOT_FOUND) || + NT_STATUS_EQUAL(cli_nt_error(cli), NT_STATUS_NO_SUCH_FILE)) { + return 0; + } + + asprintf(&mask, "%s\\*", dname); + cli_unlink(cli, mask); + cli_list(dstate.cli, mask, + FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM, + delete_fn, &dstate); + free(mask); + if (!cli_rmdir(dstate.cli, dname)) { + DEBUG(2,("Failed to delete %s - %s\n", + dname, cli_errstr(dstate.cli))); + return -1; + } + dstate.total_deleted++; + + if (dstate.failed) { + return -1; + } + + return dstate.total_deleted; +} -- cgit From 4639eb5a58f8c0906afdc8e8f8f67f82e9547f75 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 8 Feb 2004 00:51:07 +0000 Subject: Convert libcli routines to use cli_tree instead of cli_state. Port smbtorture to use the new interface. Part 2 will be to eliminate cli_state from smbtorture as this is now the only place where it is used. (This used to be commit db1cc96af62ea42837d60592877fc3f93cef143b) --- source4/libcli/clideltree.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'source4/libcli/clideltree.c') diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c index 8769b8dfa7..d28950f136 100644 --- a/source4/libcli/clideltree.c +++ b/source4/libcli/clideltree.c @@ -21,7 +21,7 @@ #include "includes.h" struct delete_state { - struct cli_state *cli; + struct cli_tree *tree; int total_deleted; BOOL failed; }; @@ -41,30 +41,30 @@ static void delete_fn(file_info *finfo, const char *name, void *state) asprintf(&s, "%s%s", n, finfo->name); if (finfo->mode & FILE_ATTRIBUTE_READONLY) { - if (!cli_setatr(dstate->cli, s, 0, 0)) { + if (!cli_setatr(dstate->tree, s, 0, 0)) { DEBUG(2,("Failed to remove READONLY on %s - %s\n", - s, cli_errstr(dstate->cli))); + s, cli_errstr(dstate->tree))); } } if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) { char *s2; asprintf(&s2, "%s\\*", s); - cli_unlink(dstate->cli, s2); - cli_list(dstate->cli, s2, + cli_unlink(dstate->tree, s2); + cli_list(dstate->tree, s2, FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM, delete_fn, state); free(s2); - if (!cli_rmdir(dstate->cli, s)) { + if (!cli_rmdir(dstate->tree, s)) { DEBUG(2,("Failed to delete %s - %s\n", - s, cli_errstr(dstate->cli))); + s, cli_errstr(dstate->tree))); dstate->failed = True; } dstate->total_deleted++; } else { - if (!cli_unlink(dstate->cli, s)) { + if (!cli_unlink(dstate->tree, s)) { DEBUG(2,("Failed to delete %s - %s\n", - s, cli_errstr(dstate->cli))); + s, cli_errstr(dstate->tree))); dstate->failed = True; } dstate->total_deleted++; @@ -77,34 +77,34 @@ static void delete_fn(file_info *finfo, const char *name, void *state) recursively descend a tree deleting all files returns the number of files deleted, or -1 on error */ -int cli_deltree(struct cli_state *cli, const char *dname) +int cli_deltree(struct cli_tree *tree, const char *dname) { char *mask; struct delete_state dstate; - dstate.cli = cli; + dstate.tree = tree; dstate.total_deleted = 0; dstate.failed = False; /* it might be a file */ - if (cli_unlink(cli, dname)) { + if (cli_unlink(tree, dname)) { return 1; } - if (NT_STATUS_EQUAL(cli_nt_error(cli), NT_STATUS_OBJECT_NAME_NOT_FOUND) || - NT_STATUS_EQUAL(cli_nt_error(cli), NT_STATUS_OBJECT_PATH_NOT_FOUND) || - NT_STATUS_EQUAL(cli_nt_error(cli), NT_STATUS_NO_SUCH_FILE)) { + if (NT_STATUS_EQUAL(cli_nt_error(tree), NT_STATUS_OBJECT_NAME_NOT_FOUND) || + NT_STATUS_EQUAL(cli_nt_error(tree), NT_STATUS_OBJECT_PATH_NOT_FOUND) || + NT_STATUS_EQUAL(cli_nt_error(tree), NT_STATUS_NO_SUCH_FILE)) { return 0; } asprintf(&mask, "%s\\*", dname); - cli_unlink(cli, mask); - cli_list(dstate.cli, mask, + cli_unlink(dstate.tree, mask); + cli_list(dstate.tree, mask, FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM, delete_fn, &dstate); free(mask); - if (!cli_rmdir(dstate.cli, dname)) { + if (!cli_rmdir(dstate.tree, dname)) { DEBUG(2,("Failed to delete %s - %s\n", - dname, cli_errstr(dstate.cli))); + dname, cli_errstr(dstate.tree))); return -1; } dstate.total_deleted++; -- cgit From 9a6388179b9c4e13238ed91aebaca9b15e02408f Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 10 Feb 2004 11:33:35 +0000 Subject: Convert libcli routines to return NTSTATUS instead of BOOL. Again, the only users are smbclient and smbtorture. (This used to be commit 54cb508c78e5c1faa3ade46b46b165983c880d10) --- source4/libcli/clideltree.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4/libcli/clideltree.c') diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c index d28950f136..2bbfd9bd22 100644 --- a/source4/libcli/clideltree.c +++ b/source4/libcli/clideltree.c @@ -41,7 +41,7 @@ static void delete_fn(file_info *finfo, const char *name, void *state) asprintf(&s, "%s%s", n, finfo->name); if (finfo->mode & FILE_ATTRIBUTE_READONLY) { - if (!cli_setatr(dstate->tree, s, 0, 0)) { + if (NT_STATUS_IS_ERR(cli_setatr(dstate->tree, s, 0, 0))) { DEBUG(2,("Failed to remove READONLY on %s - %s\n", s, cli_errstr(dstate->tree))); } @@ -55,14 +55,14 @@ static void delete_fn(file_info *finfo, const char *name, void *state) FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM, delete_fn, state); free(s2); - if (!cli_rmdir(dstate->tree, s)) { + if (NT_STATUS_IS_ERR(cli_rmdir(dstate->tree, s))) { DEBUG(2,("Failed to delete %s - %s\n", s, cli_errstr(dstate->tree))); dstate->failed = True; } dstate->total_deleted++; } else { - if (!cli_unlink(dstate->tree, s)) { + if (NT_STATUS_IS_ERR(cli_unlink(dstate->tree, s))) { DEBUG(2,("Failed to delete %s - %s\n", s, cli_errstr(dstate->tree))); dstate->failed = True; @@ -87,7 +87,7 @@ int cli_deltree(struct cli_tree *tree, const char *dname) dstate.failed = False; /* it might be a file */ - if (cli_unlink(tree, dname)) { + if (NT_STATUS_IS_OK(cli_unlink(tree, dname))) { return 1; } if (NT_STATUS_EQUAL(cli_nt_error(tree), NT_STATUS_OBJECT_NAME_NOT_FOUND) || @@ -102,7 +102,7 @@ int cli_deltree(struct cli_tree *tree, const char *dname) FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM, delete_fn, &dstate); free(mask); - if (!cli_rmdir(dstate.tree, dname)) { + if (NT_STATUS_IS_ERR(cli_rmdir(dstate.tree, dname))) { DEBUG(2,("Failed to delete %s - %s\n", dname, cli_errstr(dstate.tree))); return -1; -- cgit From c5fbb6f23c2d399c7510bc552cdb1a27b1ef66a8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 4 Aug 2004 13:23:35 +0000 Subject: r1654: rename cli_ -> smbcli_ rename CLI_ -> SMBCLI_ metze (This used to be commit 8441750fd9427dd6fe477f27e603821b4026f038) --- source4/libcli/clideltree.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'source4/libcli/clideltree.c') diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c index 2bbfd9bd22..aa73f5b90b 100644 --- a/source4/libcli/clideltree.c +++ b/source4/libcli/clideltree.c @@ -21,7 +21,7 @@ #include "includes.h" struct delete_state { - struct cli_tree *tree; + struct smbcli_tree *tree; int total_deleted; BOOL failed; }; @@ -41,30 +41,30 @@ static void delete_fn(file_info *finfo, const char *name, void *state) asprintf(&s, "%s%s", n, finfo->name); if (finfo->mode & FILE_ATTRIBUTE_READONLY) { - if (NT_STATUS_IS_ERR(cli_setatr(dstate->tree, s, 0, 0))) { + if (NT_STATUS_IS_ERR(smbcli_setatr(dstate->tree, s, 0, 0))) { DEBUG(2,("Failed to remove READONLY on %s - %s\n", - s, cli_errstr(dstate->tree))); + s, smbcli_errstr(dstate->tree))); } } if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) { char *s2; asprintf(&s2, "%s\\*", s); - cli_unlink(dstate->tree, s2); - cli_list(dstate->tree, s2, + smbcli_unlink(dstate->tree, s2); + smbcli_list(dstate->tree, s2, FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM, delete_fn, state); free(s2); - if (NT_STATUS_IS_ERR(cli_rmdir(dstate->tree, s))) { + if (NT_STATUS_IS_ERR(smbcli_rmdir(dstate->tree, s))) { DEBUG(2,("Failed to delete %s - %s\n", - s, cli_errstr(dstate->tree))); + s, smbcli_errstr(dstate->tree))); dstate->failed = True; } dstate->total_deleted++; } else { - if (NT_STATUS_IS_ERR(cli_unlink(dstate->tree, s))) { + if (NT_STATUS_IS_ERR(smbcli_unlink(dstate->tree, s))) { DEBUG(2,("Failed to delete %s - %s\n", - s, cli_errstr(dstate->tree))); + s, smbcli_errstr(dstate->tree))); dstate->failed = True; } dstate->total_deleted++; @@ -77,7 +77,7 @@ static void delete_fn(file_info *finfo, const char *name, void *state) recursively descend a tree deleting all files returns the number of files deleted, or -1 on error */ -int cli_deltree(struct cli_tree *tree, const char *dname) +int smbcli_deltree(struct smbcli_tree *tree, const char *dname) { char *mask; struct delete_state dstate; @@ -87,24 +87,24 @@ int cli_deltree(struct cli_tree *tree, const char *dname) dstate.failed = False; /* it might be a file */ - if (NT_STATUS_IS_OK(cli_unlink(tree, dname))) { + if (NT_STATUS_IS_OK(smbcli_unlink(tree, dname))) { return 1; } - if (NT_STATUS_EQUAL(cli_nt_error(tree), NT_STATUS_OBJECT_NAME_NOT_FOUND) || - NT_STATUS_EQUAL(cli_nt_error(tree), NT_STATUS_OBJECT_PATH_NOT_FOUND) || - NT_STATUS_EQUAL(cli_nt_error(tree), NT_STATUS_NO_SUCH_FILE)) { + if (NT_STATUS_EQUAL(smbcli_nt_error(tree), NT_STATUS_OBJECT_NAME_NOT_FOUND) || + NT_STATUS_EQUAL(smbcli_nt_error(tree), NT_STATUS_OBJECT_PATH_NOT_FOUND) || + NT_STATUS_EQUAL(smbcli_nt_error(tree), NT_STATUS_NO_SUCH_FILE)) { return 0; } asprintf(&mask, "%s\\*", dname); - cli_unlink(dstate.tree, mask); - cli_list(dstate.tree, mask, + smbcli_unlink(dstate.tree, mask); + smbcli_list(dstate.tree, mask, FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM, delete_fn, &dstate); free(mask); - if (NT_STATUS_IS_ERR(cli_rmdir(dstate.tree, dname))) { + if (NT_STATUS_IS_ERR(smbcli_rmdir(dstate.tree, dname))) { DEBUG(2,("Failed to delete %s - %s\n", - dname, cli_errstr(dstate.tree))); + dname, smbcli_errstr(dstate.tree))); return -1; } dstate.total_deleted++; -- cgit From a99b6219a810a1cd10bd62a6716780602808f0cd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 2 Nov 2004 12:15:17 +0000 Subject: r3481: split out client.h and events.h (This used to be commit c6f486574470a311e0d336c026103f131451e21e) --- source4/libcli/clideltree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/libcli/clideltree.c') diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c index aa73f5b90b..7dd3803735 100644 --- a/source4/libcli/clideltree.c +++ b/source4/libcli/clideltree.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "client.h" struct delete_state { struct smbcli_tree *tree; @@ -29,7 +30,7 @@ struct delete_state { /* callback function for torture_deltree() */ -static void delete_fn(file_info *finfo, const char *name, void *state) +static void delete_fn(struct file_info *finfo, const char *name, void *state) { struct delete_state *dstate = state; char *s, *n; -- cgit From 607e3022381ab089bfcc0b153461b6b3ac76f175 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 30 Nov 2004 05:37:57 +0000 Subject: r4013: got rid of a bunch of unused or unmaintained code - removed the clitar code. It is unmaintained, and a horribly badly done hack - removed client.h as it contained mostly unused definitions - removed the unused clidfs.c code (This used to be commit 31a7bddbb3815b4d625e993dbce4805dae1c18f8) --- source4/libcli/clideltree.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/libcli/clideltree.c') diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c index 7dd3803735..30369b977f 100644 --- a/source4/libcli/clideltree.c +++ b/source4/libcli/clideltree.c @@ -19,7 +19,7 @@ */ #include "includes.h" -#include "client.h" +#include "clilist.h" struct delete_state { struct smbcli_tree *tree; @@ -30,7 +30,7 @@ struct delete_state { /* callback function for torture_deltree() */ -static void delete_fn(struct file_info *finfo, const char *name, void *state) +static void delete_fn(struct clilist_file_info *finfo, const char *name, void *state) { struct delete_state *dstate = state; char *s, *n; @@ -41,14 +41,14 @@ static void delete_fn(struct file_info *finfo, const char *name, void *state) n[strlen(n)-1] = 0; asprintf(&s, "%s%s", n, finfo->name); - if (finfo->mode & FILE_ATTRIBUTE_READONLY) { + if (finfo->attrib & FILE_ATTRIBUTE_READONLY) { if (NT_STATUS_IS_ERR(smbcli_setatr(dstate->tree, s, 0, 0))) { DEBUG(2,("Failed to remove READONLY on %s - %s\n", s, smbcli_errstr(dstate->tree))); } } - if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) { + if (finfo->attrib & FILE_ATTRIBUTE_DIRECTORY) { char *s2; asprintf(&s2, "%s\\*", s); smbcli_unlink(dstate->tree, s2); -- cgit From 78c50015bb8bd5a1d831a6e7ec796b3367c73145 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 Jan 2006 15:40:05 +0000 Subject: r12694: Move some headers to the directory of the subsystem they belong to. (This used to be commit c722f665c90103f3ed57621c460e32ad33e7a8a3) --- source4/libcli/clideltree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source4/libcli/clideltree.c') diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c index 30369b977f..0c65d993c8 100644 --- a/source4/libcli/clideltree.c +++ b/source4/libcli/clideltree.c @@ -19,7 +19,8 @@ */ #include "includes.h" -#include "clilist.h" +#include "libcli/raw/libcliraw.h" +#include "libcli/libcli.h" struct delete_state { struct smbcli_tree *tree; -- cgit From 6ab33938d5239e8688440f65e802f627622d301b Mon Sep 17 00:00:00 2001 From: James Peach Date: Mon, 24 Apr 2006 00:16:51 +0000 Subject: r15186: Introduce ISDOT and ISDOTDOT macros for testing whether a filename is "." for "..". These express the intention better that strcmp or strequal and improve searchability via cscope/ctags. (This used to be commit 7e4ad7e8e5ec266b969e3075c4ad7f021571f24e) --- source4/libcli/clideltree.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4/libcli/clideltree.c') diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c index 0c65d993c8..51b4e6568d 100644 --- a/source4/libcli/clideltree.c +++ b/source4/libcli/clideltree.c @@ -21,6 +21,7 @@ #include "includes.h" #include "libcli/raw/libcliraw.h" #include "libcli/libcli.h" +#include "system/dir.h" struct delete_state { struct smbcli_tree *tree; @@ -35,8 +36,9 @@ static void delete_fn(struct clilist_file_info *finfo, const char *name, void *s { struct delete_state *dstate = state; char *s, *n; - if (strcmp(finfo->name, ".") == 0 || - strcmp(finfo->name, "..") == 0) return; + if (ISDOT(finfo->name) || ISDOTDOT(finfo->name)) { + return; + } n = strdup(name); n[strlen(n)-1] = 0; -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/libcli/clideltree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/libcli/clideltree.c') diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c index 51b4e6568d..33c39ea093 100644 --- a/source4/libcli/clideltree.c +++ b/source4/libcli/clideltree.c @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From 6cf69fee189857ae6f85cd3f81a6a58364839942 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Sep 2007 13:31:15 +0000 Subject: r24994: Fix some C++ warnings. (This used to be commit 925abf74fa1ed5ae726bae8781ec549302786b39) --- source4/libcli/clideltree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/libcli/clideltree.c') diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c index 33c39ea093..d191bd277a 100644 --- a/source4/libcli/clideltree.c +++ b/source4/libcli/clideltree.c @@ -33,7 +33,7 @@ struct delete_state { */ static void delete_fn(struct clilist_file_info *finfo, const char *name, void *state) { - struct delete_state *dstate = state; + struct delete_state *dstate = (struct delete_state *)state; char *s, *n; if (ISDOT(finfo->name) || ISDOTDOT(finfo->name)) { return; -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/libcli/clideltree.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/libcli/clideltree.c') diff --git a/source4/libcli/clideltree.c b/source4/libcli/clideltree.c index d191bd277a..2c306e501e 100644 --- a/source4/libcli/clideltree.c +++ b/source4/libcli/clideltree.c @@ -25,7 +25,7 @@ struct delete_state { struct smbcli_tree *tree; int total_deleted; - BOOL failed; + bool failed; }; /* @@ -61,14 +61,14 @@ static void delete_fn(struct clilist_file_info *finfo, const char *name, void *s if (NT_STATUS_IS_ERR(smbcli_rmdir(dstate->tree, s))) { DEBUG(2,("Failed to delete %s - %s\n", s, smbcli_errstr(dstate->tree))); - dstate->failed = True; + dstate->failed = true; } dstate->total_deleted++; } else { if (NT_STATUS_IS_ERR(smbcli_unlink(dstate->tree, s))) { DEBUG(2,("Failed to delete %s - %s\n", s, smbcli_errstr(dstate->tree))); - dstate->failed = True; + dstate->failed = true; } dstate->total_deleted++; } @@ -87,7 +87,7 @@ int smbcli_deltree(struct smbcli_tree *tree, const char *dname) dstate.tree = tree; dstate.total_deleted = 0; - dstate.failed = False; + dstate.failed = false; /* it might be a file */ if (NT_STATUS_IS_OK(smbcli_unlink(tree, dname))) { -- cgit