summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_sid.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-03-14 10:24:19 +0000
committerVolker Lendecke <vlendec@samba.org>2004-03-14 10:24:19 +0000
commit5b0f30e01c5a51f98025b035bfa5e00eb0268fef (patch)
tree46e4a3d4e1bed72363fb8332642af9639a7fffb6 /source3/nsswitch/winbindd_sid.c
parentaf6225afa95cf1d8dd6bb1bfb438daaf6097e30a (diff)
downloadsamba-5b0f30e01c5a51f98025b035bfa5e00eb0268fef.tar.gz
samba-5b0f30e01c5a51f98025b035bfa5e00eb0268fef.tar.bz2
samba-5b0f30e01c5a51f98025b035bfa5e00eb0268fef.zip
Add and delete aliases via srv_samr_nt. For that I added a RID allocation call
to winbindd. idmap_allocate_rid wants information about whether this will be a user or a group, I did not export this to the winbind interface. The reason for idmap to get that info is to keep consistent with the algorithmic convention to alloc only even rids for users and odd rids for groups. I'm not fully convinced that this really gains us anything. Any real good arguments? Volker (This used to be commit 7f62cf933cad69799204bfdc773e08ff0dde0b20)
Diffstat (limited to 'source3/nsswitch/winbindd_sid.c')
-rw-r--r--source3/nsswitch/winbindd_sid.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd_sid.c b/source3/nsswitch/winbindd_sid.c
index 8ff6cfd271..d4206558c5 100644
--- a/source3/nsswitch/winbindd_sid.c
+++ b/source3/nsswitch/winbindd_sid.c
@@ -434,3 +434,23 @@ done:
return WINBINDD_OK;
}
+
+enum winbindd_result winbindd_allocate_rid(struct winbindd_cli_state *state)
+{
+ if ( !state->privileged ) {
+ DEBUG(2, ("winbindd_allocate_rid: non-privileged access "
+ "denied!\n"));
+ return WINBINDD_ERROR;
+ }
+
+ /* We tell idmap to always allocate a user RID. There might be a good
+ * reason to keep RID allocation for users to even and groups to
+ * odd. This needs discussion I think. For now only allocate user
+ * rids. */
+
+ if (!NT_STATUS_IS_OK(idmap_allocate_rid(&state->response.data.rid,
+ USER_RID_TYPE)))
+ return WINBINDD_ERROR;
+
+ return WINBINDD_OK;
+}