[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Mon Feb 22 15:37:27 MST 2010


The branch, master has been updated
       via  f1fe808... Add an "attributes" string to allinfo. Jeremy.
      from  82f6f39... s3: Explicitly handle inbuf in cli_trans_done

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f1fe808978ac420387a80a6862762ba3dd090af0
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Feb 22 14:36:40 2010 -0800

    Add an "attributes" string to allinfo.
    Jeremy.

-----------------------------------------------------------------------

Summary of changes:
 source3/client/client.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/client.c b/source3/client/client.c
index f275ddd..7dc412f 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",


-- 
Samba Shared Repository


More information about the samba-cvs mailing list