summaryrefslogtreecommitdiff
path: root/source3/nsswitch/wbinfo.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/wbinfo.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/wbinfo.c')
-rw-r--r--source3/nsswitch/wbinfo.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c
index 772332ee59..af2a0ce7c6 100644
--- a/source3/nsswitch/wbinfo.c
+++ b/source3/nsswitch/wbinfo.c
@@ -436,6 +436,18 @@ static BOOL wbinfo_sid_to_gid(char *sid)
return True;
}
+static BOOL wbinfo_allocate_rid(void)
+{
+ uint32 rid;
+
+ if (!winbind_allocate_rid(&rid))
+ return False;
+
+ d_printf("New rid: %d\n", rid);
+
+ return True;
+}
+
/* Convert sid to string */
static BOOL wbinfo_lookupsid(char *sid)
@@ -983,6 +995,7 @@ int main(int argc, char **argv)
{ "gid-to-sid", 'G', POPT_ARG_INT, &int_arg, 'G', "Converts gid to sid", "GID" },
{ "sid-to-uid", 'S', POPT_ARG_STRING, &string_arg, 'S', "Converts sid to uid", "SID" },
{ "sid-to-gid", 'Y', POPT_ARG_STRING, &string_arg, 'Y', "Converts sid to gid", "SID" },
+ { "allocate-rid", 'A', POPT_ARG_NONE, 0, 'A', "Get a new RID out of idmap" },
{ "create-user", 'c', POPT_ARG_STRING, &string_arg, 'c', "Create a local user account", "name" },
{ "delete-user", 'x', POPT_ARG_STRING, &string_arg, 'x', "Delete a local user account", "name" },
{ "create-group", 'C', POPT_ARG_STRING, &string_arg, 'C', "Create a local group", "name" },
@@ -1102,6 +1115,12 @@ int main(int argc, char **argv)
goto done;
}
break;
+ case 'A':
+ if (!wbinfo_allocate_rid()) {
+ d_printf("Could not allocate a RID\n");
+ goto done;
+ }
+ break;
case 't':
if (!wbinfo_check_secret()) {
d_printf("Could not check secret\n");