summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_lsa_nt.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-02-06 05:42:19 +0000
committerAndrew Tridgell <tridge@samba.org>2003-02-06 05:42:19 +0000
commitb4776d89ea9861def5b9d491b3ec6b881d086505 (patch)
tree63318e41031212fabf236217b16e6adf87473cb6 /source3/rpc_server/srv_lsa_nt.c
parent68fdf96637b4f0b5ea3769988b1b865a14ef9fad (diff)
downloadsamba-b4776d89ea9861def5b9d491b3ec6b881d086505.tar.gz
samba-b4776d89ea9861def5b9d491b3ec6b881d086505.tar.bz2
samba-b4776d89ea9861def5b9d491b3ec6b881d086505.zip
added the LSA privileges server backend stubs. Right now they just log
what was requested. (This used to be commit 64ac6c2bcb729c4658de48e929cc792681903ecc)
Diffstat (limited to 'source3/rpc_server/srv_lsa_nt.c')
-rw-r--r--source3/rpc_server/srv_lsa_nt.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index fc51d7ef2f..7a2f5ae443 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -1260,3 +1260,84 @@ NTSTATUS _lsa_query_info2(pipes_struct *p, LSA_Q_QUERY_INFO2 *q_u, LSA_R_QUERY_I
return r_u->status;
}
+
+
+/***************************************************************************
+ For a given SID, enumerate all the privilege this account has.
+ ***************************************************************************/
+NTSTATUS _lsa_enum_acct_rights(pipes_struct *p, LSA_Q_ENUM_ACCT_RIGHTS *q_u, LSA_R_ENUM_ACCT_RIGHTS *r_u)
+{
+ struct lsa_info *info=NULL;
+ char **rights = NULL;
+ int num_rights = 0;
+
+ r_u->status = NT_STATUS_OK;
+
+ /* find the connection policy handle. */
+ if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+ return NT_STATUS_INVALID_HANDLE;
+
+ init_r_enum_acct_rights(r_u, num_rights, rights);
+
+ return r_u->status;
+}
+
+/***************************************************************************
+ add privileges to a acct by SID
+ ***************************************************************************/
+NTSTATUS _lsa_add_acct_rights(pipes_struct *p, LSA_Q_ADD_ACCT_RIGHTS *q_u, LSA_R_ADD_ACCT_RIGHTS *r_u)
+{
+ struct lsa_info *info=NULL;
+ int i;
+
+ r_u->status = NT_STATUS_OK;
+
+ /* find the connection policy handle. */
+ if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+ return NT_STATUS_INVALID_HANDLE;
+
+ /* no backend yet - just print them */
+
+ DEBUG(5,("_lsa_add_acct_rights to %s (%d rights)\n",
+ sid_string_static(&q_u->sid.sid), q_u->rights.count));
+
+ for (i=0;i<q_u->rights.count;i++) {
+ DEBUG(5,("\t%s\n", unistr2_static(&q_u->rights.strings[i].string)));
+ }
+
+ init_r_add_acct_rights(r_u);
+
+ return r_u->status;
+}
+
+
+/***************************************************************************
+ remove privileges from a acct by SID
+ ***************************************************************************/
+NTSTATUS _lsa_remove_acct_rights(pipes_struct *p, LSA_Q_REMOVE_ACCT_RIGHTS *q_u, LSA_R_REMOVE_ACCT_RIGHTS *r_u)
+{
+ struct lsa_info *info=NULL;
+ int i;
+
+ r_u->status = NT_STATUS_OK;
+
+ /* find the connection policy handle. */
+ if (!find_policy_by_hnd(p, &q_u->pol, (void **)&info))
+ return NT_STATUS_INVALID_HANDLE;
+
+
+ /* no backend yet - just print them */
+
+ DEBUG(5,("_lsa_remove_acct_rights from %s all=%d (%d rights)\n",
+ sid_string_static(&q_u->sid.sid),
+ q_u->removeall,
+ q_u->rights.count));
+
+ for (i=0;i<q_u->rights.count;i++) {
+ DEBUG(5,("\t%s\n", unistr2_static(&q_u->rights.strings[i].string)));
+ }
+
+ init_r_remove_acct_rights(r_u);
+
+ return r_u->status;
+}