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,
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 <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
#include "libcli/libcli.h"
#include "libcli/raw/libcliraw.h"
+#include "libcli/raw/raw_proto.h"
struct search_private {
struct clilist_file_info *dirlist;
/****************************************************************************
Interpret a long filename structure.
****************************************************************************/
-static BOOL interpret_long_filename(enum smb_search_data_level level,
+static bool interpret_long_filename(enum smb_search_data_level level,
const union smb_search_data *info,
struct clilist_file_info *finfo)
{
default:
DEBUG(0,("Unhandled level %d in interpret_long_filename\n", (int)level));
- return False;
+ return false;
}
- return True;
+ return true;
}
/* callback function used for trans2 search */
-static BOOL smbcli_list_new_callback(void *private, const union smb_search_data *file)
+static bool smbcli_list_new_callback(void *private_data, const union smb_search_data *file)
{
- struct search_private *state = (struct search_private*) private;
+ struct search_private *state = (struct search_private*) private_data;
struct clilist_file_info *tdl;
/* add file info to the dirlist pool */
struct clilist_file_info,
state->dirlist_len + 1);
if (!tdl) {
- return False;
+ return false;
}
state->dirlist = tdl;
state->dirlist_len++;
state->total_received++;
state->ff_searchcount++;
- return True;
+ return true;
}
int smbcli_list_new(struct smbcli_tree *tree, const char *Mask, uint16_t attribute,
union smb_search_next next_parms;
struct search_private state; /* for callbacks */
int received = 0;
- BOOL first = True;
+ bool first = true;
int num_received = 0;
int max_matches = 512;
char *mask;
state.dirlist_len = 0;
state.total_received = 0;
- state.dirlist = talloc_new(state.mem_ctx);
+ state.dirlist = talloc_array(state.mem_ctx,
+ struct clilist_file_info, 0);
mask = talloc_strdup(state.mem_ctx, Mask);
if (level == RAW_SEARCH_DATA_GENERIC) {
received = first_parms.t2ffirst.out.count;
if (received <= 0) break;
if (ff_eos) break;
- first = False;
+ first = false;
} else {
NTSTATUS status;
Interpret a short filename structure.
The length of the structure is returned.
****************************************************************************/
-static BOOL interpret_short_filename(enum smb_search_data_level level,
+static bool interpret_short_filename(enum smb_search_data_level level,
const union smb_search_data *info,
struct clilist_file_info *finfo)
{
default:
DEBUG(0,("Unhandled level %d in interpret_short_filename\n", (int)level));
- return False;
+ return false;
}
- return True;
+ return true;
}
/* callback function used for smb_search */
-static BOOL smbcli_list_old_callback(void *private, const union smb_search_data *file)
+static bool smbcli_list_old_callback(void *private_data, const union smb_search_data *file)
{
- struct search_private *state = (struct search_private*) private;
+ struct search_private *state = (struct search_private*) private_data;
struct clilist_file_info *tdl;
/* add file info to the dirlist pool */
state->dirlist_len + 1);
if (!tdl) {
- return False;
+ return false;
}
state->dirlist = tdl;
state->dirlist_len++;
state->ff_searchcount++;
state->id = file->search.id; /* return resume info */
- return True;
+ return true;
}
int smbcli_list_old(struct smbcli_tree *tree, const char *Mask, uint16_t attribute,
struct search_private state; /* for callbacks */
const int num_asked = 500;
int received = 0;
- BOOL first = True;
+ bool first = true;
int num_received = 0;
char *mask;
int i;
state.total_received = 0;
state.data_level = RAW_SEARCH_DATA_SEARCH;
- state.dirlist = talloc_new(state.mem_ctx);
+ state.dirlist = talloc_array(state.mem_ctx, struct clilist_file_info,
+ 0);
mask = talloc_strdup(state.mem_ctx, Mask);
while (1) {
received = first_parms.search_first.out.count;
if (received <= 0) break;
- first = False;
+ first = false;
} else {
NTSTATUS status;