summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-02-22 14:36:40 -0800
committerJeremy Allison <jra@samba.org>2010-02-22 14:36:40 -0800
commitf1fe808978ac420387a80a6862762ba3dd090af0 (patch)
treeff7aa00ccef021056a9154ebb4644cd2dfd868d5 /source3
parent82f6f3920c3127caf5e32de4c81830e74300e0f8 (diff)
downloadsamba-f1fe808978ac420387a80a6862762ba3dd090af0.tar.gz
samba-f1fe808978ac420387a80a6862762ba3dd090af0.tar.bz2
samba-f1fe808978ac420387a80a6862762ba3dd090af0.zip
Add an "attributes" string to allinfo.
Jeremy.
Diffstat (limited to 'source3')
-rw-r--r--source3/client/client.c27
1 files changed, 27 insertions, 0 deletions
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",