Add an "attributes" string to allinfo.
authorJeremy Allison <jra@samba.org>
Mon, 22 Feb 2010 22:36:40 +0000 (14:36 -0800)
committerJeremy Allison <jra@samba.org>
Mon, 22 Feb 2010 22:36:40 +0000 (14:36 -0800)
Jeremy.

source3/client/client.c

index f275dddd8bff86e6bf3d5c6a2cc366793fa4b0de..7dc412fe3a92dcf8077559a6425b903537674d02 100644 (file)
@@ -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",