From f1fe808978ac420387a80a6862762ba3dd090af0 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 22 Feb 2010 14:36:40 -0800 Subject: Add an "attributes" string to allinfo. Jeremy. --- source3/client/client.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'source3') diff --git a/source3/client/client.c b/source3/client/client.c index f275dddd8b..7dc412fe3a 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -1526,6 +1526,31 @@ static int cmd_altname(void) return 0; } +static char *attr_str(TALLOC_CTX *mem_ctx, uint16_t mode) +{ + char *attrs = TALLOC_ZERO_ARRAY(mem_ctx, char, 17); + int i = 0; + + if (!(mode & FILE_ATTRIBUTE_NORMAL)) { + if (mode & FILE_ATTRIBUTE_READONLY) { + attrs[i++] = 'R'; + } + if (mode & FILE_ATTRIBUTE_HIDDEN) { + attrs[i++] = 'H'; + } + if (mode & FILE_ATTRIBUTE_SYSTEM) { + attrs[i++] = 'S'; + } + if (mode & FILE_ATTRIBUTE_DIRECTORY) { + attrs[i++] = 'D'; + } + if (mode & FILE_ATTRIBUTE_ARCHIVE) { + attrs[i++] = 'A'; + } + } + return attrs; +} + /**************************************************************************** Show all info we can get ****************************************************************************/ @@ -1568,6 +1593,8 @@ static int do_allinfo(const char *name) unix_timespec_to_nt_time(&tmp, c_time); d_printf("change_time: %s\n", nt_time_string(talloc_tos(), tmp)); + d_printf("attributes: %s\n", attr_str(talloc_tos(), mode)); + if (!cli_qpathinfo_streams(cli, name, talloc_tos(), &num_streams, &streams)) { d_printf("%s getting streams for %s\n", -- cgit