diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-12-14 06:31:20 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:07:26 -0500 |
commit | 4d545e09c899dd63dfc055d05dd871c7df8638a5 (patch) | |
tree | 249b696f724805bb43065390cdba9cde64e7c1cc /source4/libcli | |
parent | e07525eabdf9d6430a683dc809b453212e764fd5 (diff) | |
download | samba-4d545e09c899dd63dfc055d05dd871c7df8638a5.tar.gz samba-4d545e09c899dd63dfc055d05dd871c7df8638a5.tar.bz2 samba-4d545e09c899dd63dfc055d05dd871c7df8638a5.zip |
r4202: added smbclient commands "addprivileges" and "delprivileges" for
easily adding/removing privileges from users
(This used to be commit 8764909c05c4829d1e4f7eaf8c18e8ef1e53645f)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/util/clilsa.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/source4/libcli/util/clilsa.c b/source4/libcli/util/clilsa.c index c3c7f8cc77..4204adcc07 100644 --- a/source4/libcli/util/clilsa.c +++ b/source4/libcli/util/clilsa.c @@ -297,3 +297,49 @@ NTSTATUS smblsa_lookup_name(struct smbcli_state *cli, return NT_STATUS_OK; } + + +/* + add a set of privileges to the given sid +*/ +NTSTATUS smblsa_sid_add_privileges(struct smbcli_state *cli, struct dom_sid *sid, + TALLOC_CTX *mem_ctx, + struct lsa_RightSet *rights) +{ + NTSTATUS status; + struct lsa_AddAccountRights r; + + status = smblsa_connect(cli); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + r.in.handle = &cli->lsa->handle; + r.in.sid = sid; + r.in.rights = rights; + + return dcerpc_lsa_AddAccountRights(cli->lsa->pipe, mem_ctx, &r); +} + +/* + remove a set of privileges from the given sid +*/ +NTSTATUS smblsa_sid_del_privileges(struct smbcli_state *cli, struct dom_sid *sid, + TALLOC_CTX *mem_ctx, + struct lsa_RightSet *rights) +{ + NTSTATUS status; + struct lsa_RemoveAccountRights r; + + status = smblsa_connect(cli); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + r.in.handle = &cli->lsa->handle; + r.in.sid = sid; + r.in.unknown = 0; + r.in.rights = rights; + + return dcerpc_lsa_RemoveAccountRights(cli->lsa->pipe, mem_ctx, &r); +} |