From: Tim Beale Date: Wed, 12 Dec 2018 00:47:46 +0000 (+1300) Subject: s3:pylibsmb: Minor refactor to py_cli_list() variables X-Git-Tag: tdb-1.3.17~90 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ea00215d53891215e20531f75a7ec7e5dec3df5e;p=thirdparty%2Fsamba.git 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 Reviewed-by: Andrew Bartlett --- diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c index 08de5d0f531..44389454d6f 100644 --- a/source3/libsmb/pylibsmb.c +++ b/source3/libsmb/pylibsmb.c @@ -30,6 +30,9 @@ #include "trans2.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) { PyObject *mod; @@ -1151,7 +1154,7 @@ static NTSTATUS do_listing(struct py_cli_state *self, void *priv) { 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; size_t i; size_t num_finfos = 0; @@ -1208,10 +1211,7 @@ static PyObject *py_cli_list(struct py_cli_state *self, { char *base_dir; char *user_mask = NULL; - unsigned attribute = - FILE_ATTRIBUTE_DIRECTORY | - FILE_ATTRIBUTE_SYSTEM | - FILE_ATTRIBUTE_HIDDEN; + unsigned int attribute = LIST_ATTRIBUTE_MASK; NTSTATUS status; PyObject *result; const char *kwlist[] = { "directory", "mask", "attribs", NULL };