self.assertNotEqual(expected_count, 0, 'No files were found')
actual_count = len(c.list('',
- info_level=libsmb.SMB2_FIND_POSIX_INFORMATION,
- posix=True))
+ info_level=libsmb.SMB2_FIND_POSIX_INFORMATION))
self.assertEqual(actual_count-2, expected_count,
'SMB2_FIND_POSIX_INFORMATION failed to list contents')
CreateContexts=[posix_context(perm)])
c.close(f)
- res = c.list("", info_level=libsmb.SMB2_FIND_POSIX_INFORMATION, posix=True)
+ res = c.list("", info_level=libsmb.SMB2_FIND_POSIX_INFORMATION)
found_files = {get_string(i['name']): i['perms'] for i in res}
for fname, perm in test_files.items():
self.assertIn(get_string(fname), found_files.keys(),
posix=True)
self.assertTrue(c.have_posix())
- res = c.list("", info_level=libsmb.SMB2_FIND_POSIX_INFORMATION, posix=True)
+ res = c.list("", info_level=libsmb.SMB2_FIND_POSIX_INFORMATION)
found_files = {get_string(i['name']): i for i in res}
dotdot = found_files['..']
self.assertEqual('S-1-0-0', dotdot['owner_sid'],
struct tevent_context *ev,
struct cli_state *cli,
const char *pathname,
- unsigned int info_level,
- bool posix)
+ unsigned int info_level)
{
struct tevent_req *req = NULL, *subreq = NULL;
struct cli_smb2_list_state *state = NULL;
return tevent_req_post(req, ev);
}
- if (smbXcli_conn_have_posix(cli->conn) && posix) {
+ if (smbXcli_conn_have_posix(cli->conn) &&
+ info_level == SMB2_FIND_POSIX_INFORMATION)
+ {
NTSTATUS status;
/* The mode MUST be 0 when opening an existing file/dir, and
struct tevent_context *ev,
struct cli_state *cli,
const char *pathname,
- unsigned int info_level,
- bool posix);
+ unsigned int info_level);
NTSTATUS cli_smb2_list_recv(
struct tevent_req *req,
TALLOC_CTX *mem_ctx,
struct cli_state *cli,
const char *mask,
uint32_t attribute,
- uint16_t info_level,
- bool posix)
+ uint16_t info_level)
{
struct tevent_req *req = NULL;
struct cli_list_state *state;
if (proto >= PROTOCOL_SMB2_02) {
state->subreq = cli_smb2_list_send(state, ev, cli, mask,
- info_level, posix);
+ info_level);
state->recv_fn = cli_smb2_list_recv;
} else if (proto >= PROTOCOL_LANMAN2) {
state->subreq = cli_list_trans_send(
? SMB_FIND_FILE_BOTH_DIRECTORY_INFO : SMB_FIND_INFO_STANDARD;
}
- req = cli_list_send(frame, ev, cli, mask, attribute, info_level, false);
+ req = cli_list_send(frame, ev, cli, mask, attribute, info_level);
if (req == NULL) {
goto fail;
}
struct cli_state *cli,
const char *mask,
uint32_t attribute,
- uint16_t info_level,
- bool posix);
+ uint16_t info_level);
NTSTATUS cli_list_recv(
struct tevent_req *req,
TALLOC_CTX *mem_ctx,
const char *base_dir, const char *user_mask,
uint16_t attribute,
unsigned int info_level,
- bool posix,
NTSTATUS (*callback_fn)(struct file_info *,
const char *, void *),
void *priv)
dos_format(mask);
req = cli_list_send(NULL, self->ev, self->cli, mask, attribute,
- info_level, posix);
+ info_level);
if (req == NULL) {
status = NT_STATUS_NO_MEMORY;
goto done;
char *user_mask = NULL;
unsigned int attribute = LIST_ATTRIBUTE_MASK;
unsigned int info_level = 0;
- bool posix = false;
NTSTATUS status;
enum protocol_types proto = smbXcli_conn_protocol(self->cli->conn);
PyObject *result = NULL;
- const char *kwlist[] = { "directory", "mask", "attribs", "posix",
+ const char *kwlist[] = { "directory", "mask", "attribs",
"info_level", NULL };
NTSTATUS (*callback_fn)(struct file_info *, const char *, void *) =
&list_helper;
- if (!ParseTupleAndKeywords(args, kwds, "z|sIpI:list", kwlist,
+ if (!ParseTupleAndKeywords(args, kwds, "z|sII:list", kwlist,
&base_dir, &user_mask, &attribute,
- &posix, &info_level)) {
+ &info_level)) {
return NULL;
}
}
}
- if (posix) {
+ if (info_level == SMB2_FIND_POSIX_INFORMATION) {
callback_fn = &list_posix_helper;
}
status = do_listing(self, base_dir, user_mask, attribute,
- info_level, posix, callback_fn, result);
+ info_level, callback_fn, result);
if (!NT_STATUS_IS_OK(status)) {
Py_XDECREF(result);