summaryrefslogtreecommitdiff
path: root/examples/libsmbclient
diff options
context:
space:
mode:
authorDerrell Lipman <derrell@samba.org>2006-09-02 21:47:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:39:47 -0500
commit5e44fc4cd47108245c567b9e676a5d8c09787d96 (patch)
treea5c7ca55269f524c240139de536c9797d8ca4904 /examples/libsmbclient
parentb7a5e3de1eac86bd460aed341ec17a01f4b82e5f (diff)
downloadsamba-5e44fc4cd47108245c567b9e676a5d8c09787d96.tar.gz
samba-5e44fc4cd47108245c567b9e676a5d8c09787d96.tar.bz2
samba-5e44fc4cd47108245c567b9e676a5d8c09787d96.zip
r18009: Fixes bug 4026.
This completes the work Jeremy began last week, disambiguating the meaning of c_time. (In POSIX terminology, c_time means "status Change time", not "create time".) All uses of c_time, a_time and m_time have now been replaced with change_time, access_time, and write_time, and when creation time is intended, create_time is used. Additionally, the capability of setting and retrieving the create time have been added to the smbc_setxattr() and smbc_getxattr() functions. An example of setting all four times can be seen with the program examples/libsmbclient/testacl with the following command line similar to: testacl -f -S "system.*:CREATE_TIME:1000000000,ACCESS_TIME:1000000060,WRITE_TIME:1000000120,CHANGE_TIME:1000000180" 'smb://server/share/testfile.txt' The -f option turns on the new mode which uses full time names in the attribute specification (e.g. ACCESS_TIME vs A_TIME). (This used to be commit 8e119b64f1d92026dda855d904be09912a40601c)
Diffstat (limited to 'examples/libsmbclient')
-rw-r--r--examples/libsmbclient/testacl.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/examples/libsmbclient/testacl.c b/examples/libsmbclient/testacl.c
index ce5694b331..4d327b39a7 100644
--- a/examples/libsmbclient/testacl.c
+++ b/examples/libsmbclient/testacl.c
@@ -23,6 +23,7 @@ int main(int argc, const char *argv[])
int flags;
int debug = 0;
int numeric = 0;
+ int full_time_names = 0;
enum acl_mode mode = SMB_ACL_GET;
static char *the_acl = NULL;
int ret;
@@ -43,6 +44,11 @@ int main(int argc, const char *argv[])
0, "Set debug level (0-100)"
},
{
+ "full_time_names", 'f', POPT_ARG_NONE, &full_time_names,
+ 1,
+ "Use new style xattr names, which include CREATE_TIME"
+ },
+ {
"delete", 'D', POPT_ARG_STRING, NULL,
'D', "Delete an acl", "ACL"
},
@@ -133,6 +139,11 @@ int main(int argc, const char *argv[])
printf("Could not initialize smbc_ library\n");
return 1;
}
+
+ if (full_time_names) {
+ SMBCCTX *context = smbc_set_context(NULL);
+ smbc_option_set(context, "full_time_names", 1);
+ }
/* Perform requested action */
@@ -143,11 +154,11 @@ int main(int argc, const char *argv[])
{
if (numeric)
{
- the_acl = "system.nt_sec_desc.*";
+ the_acl = "system.*";
}
else
{
- the_acl = "system.nt_sec_desc.*+";
+ the_acl = "system.*+";
}
}
ret = smbc_getxattr(path, the_acl, value, sizeof(value));