summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-11-12 23:42:12 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:16 -0500
commitf995b164b98221e224661e370d61ad08dadb2986 (patch)
treeab48f2b1ec70e8ee0aadacb6adc5934db8a7addc /source3/client
parenta13b603b79e170683b6b5b339d3494d32a9eaf39 (diff)
downloadsamba-f995b164b98221e224661e370d61ad08dadb2986.tar.gz
samba-f995b164b98221e224661e370d61ad08dadb2986.tar.bz2
samba-f995b164b98221e224661e370d61ad08dadb2986.zip
r3713: Implementation of get posix acls in UNIX extensions. Passes valgrind.
Need to add printout functions in client and set posix acl in server. SteveF - take a look at this for the cifsfs client ! Once this is working and tested the next step is to write this up for the UNIX extensions spec. documents. Jeremy. (This used to be commit 1bd3f133442a472b4718b94a636f2fec89a2e0dc)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 311eaef8f2..5644635de7 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -1789,6 +1789,52 @@ static char *unix_mode_to_str(char *s, mode_t m)
}
/****************************************************************************
+ UNIX getfacl.
+****************************************************************************/
+
+static int cmd_getfacl(void)
+{
+ pstring src, name;
+ uint16 major, minor;
+ uint32 caplow, caphigh;
+ char *retbuf = NULL;
+
+ if (!SERVER_HAS_UNIX_CIFS(cli)) {
+ d_printf("Server doesn't support UNIX CIFS calls.\n");
+ return 1;
+ }
+
+ if (!cli_unix_extensions_version(cli, &major, &minor, &caplow, &caphigh)) {
+ d_printf("Can't get UNIX CIFS version from server.\n");
+ return 1;
+ }
+
+ if (!(caplow & CIFS_UNIX_POSIX_ACLS_CAP)) {
+ d_printf("This server supports UNIX extensions but doesn't support POSIX ACLs.\n");
+ return 1;
+ }
+
+ pstrcpy(src,cur_dir);
+
+ if (!next_token_nr(NULL,name,NULL,sizeof(name))) {
+ d_printf("stat file\n");
+ return 1;
+ }
+
+ pstrcat(src,name);
+
+ if (!cli_unix_getfacl(cli, src, &retbuf)) {
+ d_printf("%s getfacl file %s\n",
+ cli_errstr(cli), src);
+ return 1;
+ }
+
+ /* ToDo : Print out the ACL values. */
+ SAFE_FREE(retbuf);
+ return 0;
+}
+
+/****************************************************************************
UNIX stat.
****************************************************************************/
@@ -2355,6 +2401,7 @@ static struct
{"du",cmd_du,"<mask> computes the total size of the current directory",{COMPL_REMOTE,COMPL_NONE}},
{"exit",cmd_quit,"logoff the server",{COMPL_NONE,COMPL_NONE}},
{"get",cmd_get,"<remote name> [local name] get a file",{COMPL_REMOTE,COMPL_LOCAL}},
+ {"getfacl",cmd_getfacl,"<file name> get the POSIX ACL on a file (UNIX extensions only)",{COMPL_REMOTE,COMPL_LOCAL}},
{"hardlink",cmd_hardlink,"<src> <dest> create a Windows hard link",{COMPL_REMOTE,COMPL_REMOTE}},
{"help",cmd_help,"[command] give help on a command",{COMPL_NONE,COMPL_NONE}},
{"history",cmd_history,"displays the command history",{COMPL_NONE,COMPL_NONE}},