summaryrefslogtreecommitdiff
path: root/source3/libsmb/clifile.c
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/libsmb/clifile.c
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/libsmb/clifile.c')
-rw-r--r--source3/libsmb/clifile.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 144fc4a0c8..b616abd4d2 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -168,6 +168,54 @@ static mode_t unix_filetype_from_wire(uint32 wire_type)
}
/****************************************************************************
+ Do a POSIX getfacl (UNIX extensions).
+****************************************************************************/
+
+BOOL cli_unix_getfacl(struct cli_state *cli, const char *name, char **retbuf)
+{
+ unsigned int param_len = 0;
+ unsigned int data_len = 0;
+ uint16 setup = TRANSACT2_QPATHINFO;
+ char param[sizeof(pstring)+6];
+ char *rparam=NULL, *rdata=NULL;
+ char *p;
+
+ p = param;
+ memset(p, 0, 6);
+ SSVAL(p, 0, SMB_QUERY_POSIX_ACL);
+ p += 6;
+ p += clistr_push(cli, p, name, sizeof(pstring)-6, STR_TERMINATE);
+ param_len = PTR_DIFF(p, param);
+
+ if (!cli_send_trans(cli, SMBtrans2,
+ NULL, /* name */
+ -1, 0, /* fid, flags */
+ &setup, 1, 0, /* setup, length, max */
+ param, param_len, 2, /* param, length, max */
+ NULL, 0, cli->max_xmit /* data, length, max */
+ )) {
+ return False;
+ }
+
+ if (!cli_receive_trans(cli, SMBtrans2,
+ &rparam, &param_len,
+ &rdata, &data_len)) {
+ return False;
+ }
+
+ if (data_len < 6) {
+ SAFE_FREE(rdata);
+ SAFE_FREE(rparam);
+ return False;
+ }
+
+ SAFE_FREE(rparam);
+ *retbuf = rdata;
+
+ return True;
+}
+
+/****************************************************************************
Stat a file (UNIX extensions).
****************************************************************************/