1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3:pylibsmb: Minor refactor to py_cli_list() variables

Add a define for the file attribute mask (we'll reuse it in a subsequent
patch), and make the variable type explicit.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Tim Beale 2018-12-12 13:47:46 +13:00 committed by Tim Beale
parent 1d0d1a758b
commit ea00215d53

View File

@ -30,6 +30,9 @@
#include "trans2.h" #include "trans2.h"
#include "libsmb/clirap.h" #include "libsmb/clirap.h"
#define LIST_ATTRIBUTE_MASK \
(FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_HIDDEN)
static PyTypeObject *get_pytype(const char *module, const char *type) static PyTypeObject *get_pytype(const char *module, const char *type)
{ {
PyObject *mod; PyObject *mod;
@ -1151,7 +1154,7 @@ static NTSTATUS do_listing(struct py_cli_state *self,
void *priv) void *priv)
{ {
char *mask = NULL; char *mask = NULL;
unsigned info_level = SMB_FIND_FILE_BOTH_DIRECTORY_INFO; unsigned int info_level = SMB_FIND_FILE_BOTH_DIRECTORY_INFO;
struct file_info *finfos = NULL; struct file_info *finfos = NULL;
size_t i; size_t i;
size_t num_finfos = 0; size_t num_finfos = 0;
@ -1208,10 +1211,7 @@ static PyObject *py_cli_list(struct py_cli_state *self,
{ {
char *base_dir; char *base_dir;
char *user_mask = NULL; char *user_mask = NULL;
unsigned attribute = unsigned int attribute = LIST_ATTRIBUTE_MASK;
FILE_ATTRIBUTE_DIRECTORY |
FILE_ATTRIBUTE_SYSTEM |
FILE_ATTRIBUTE_HIDDEN;
NTSTATUS status; NTSTATUS status;
PyObject *result; PyObject *result;
const char *kwlist[] = { "directory", "mask", "attribs", NULL }; const char *kwlist[] = { "directory", "mask", "attribs", NULL };