summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorTim Beale <timbeale@catalyst.net.nz>2018-12-12 13:47:46 +1300
committerTim Beale <timbeale@samba.org>2019-01-07 01:23:08 +0100
commitea00215d53891215e20531f75a7ec7e5dec3df5e (patch)
treee9e6f9e1d28436034a44c2b171d148701ac237ca /source3
parent1d0d1a758bacaf160f320f39156923ab4c273fd5 (diff)
downloadsamba-ea00215d53891215e20531f75a7ec7e5dec3df5e.tar.gz
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>
Diffstat (limited to 'source3')
-rw-r--r--source3/libsmb/pylibsmb.c10
1 files changed, 5 insertions, 5 deletions
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 };