summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-01-16 12:49:59 +0100
committerVolker Lendecke <vl@samba.org>2011-01-17 08:03:42 +0100
commit21d5485e062e37f112ce82ab3ae4e73c53ce081d (patch)
tree3925fa2d005f7118c59fadfd87869ed76dac440a /source3/libsmb
parent2068b96dce77735a9b93bee49b5750c574e79652 (diff)
downloadsamba-21d5485e062e37f112ce82ab3ae4e73c53ce081d.tar.gz
samba-21d5485e062e37f112ce82ab3ae4e73c53ce081d.tar.bz2
samba-21d5485e062e37f112ce82ab3ae4e73c53ce081d.zip
s3: Add cli_setpathinfo
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clifile.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 394968f506..f68c99fc71 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -205,6 +205,41 @@ NTSTATUS cli_setpathinfo_recv(struct tevent_req *req)
return tevent_req_simple_recv_ntstatus(req);
}
+NTSTATUS cli_setpathinfo(struct cli_state *cli,
+ uint16_t level,
+ const char *path,
+ uint8_t *data,
+ size_t data_len)
+{
+ TALLOC_CTX *frame = talloc_stackframe();
+ struct tevent_context *ev;
+ struct tevent_req *req;
+ NTSTATUS status = NT_STATUS_NO_MEMORY;
+
+ if (cli_has_async_calls(cli)) {
+ /*
+ * Can't use sync call while an async call is in flight
+ */
+ status = NT_STATUS_INVALID_PARAMETER;
+ goto fail;
+ }
+ ev = tevent_context_init(frame);
+ if (ev == NULL) {
+ goto fail;
+ }
+ req = cli_setpathinfo_send(ev, ev, cli, level, path, data, data_len);
+ if (req == NULL) {
+ goto fail;
+ }
+ if (!tevent_req_poll_ntstatus(req, ev, &status)) {
+ goto fail;
+ }
+ status = cli_setpathinfo_recv(req);
+ fail:
+ TALLOC_FREE(frame);
+ return status;
+}
+
/****************************************************************************
Hard/Symlink a file (UNIX extensions).
Creates new name (sym)linked to oldname.