summaryrefslogtreecommitdiff
path: root/source3/utils/net_groupmap.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-28 17:36:12 +0200
committerVolker Lendecke <vl@samba.org>2009-06-28 22:13:50 +0200
commit711544d4943a40649b6c590f8ee003093081889a (patch)
treeafee8fcd95e3a9b3844dccd9cb11b2418cf67fd8 /source3/utils/net_groupmap.c
parent325a58a6532e2a9bc7b8e21d55c9b1ccfb879bf9 (diff)
downloadsamba-711544d4943a40649b6c590f8ee003093081889a.tar.gz
Turn the pdb_rid_algorithm into a capabilities call that returns flags
Diffstat (limited to 'source3/utils/net_groupmap.c')
-rw-r--r--source3/utils/net_groupmap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c
index a00784e133b..16c61876649 100644
--- a/source3/utils/net_groupmap.c
+++ b/source3/utils/net_groupmap.c
@@ -276,12 +276,12 @@ static int net_groupmap_add(struct net_context *c, int argc, const char **argv)
if ( (rid == 0) && (string_sid[0] == '\0') ) {
d_printf("No rid or sid specified, choosing a RID\n");
- if (pdb_rid_algorithm()) {
- rid = algorithmic_pdb_gid_to_group_rid(gid);
- } else {
+ if (pdb_capabilities() & PDB_CAP_STORE_RIDS) {
if (!pdb_new_rid(&rid)) {
d_printf("Could not get new RID\n");
}
+ } else {
+ rid = algorithmic_pdb_gid_to_group_rid(gid);
}
d_printf("Got RID %d\n", rid);
}
@@ -577,13 +577,13 @@ static int net_groupmap_set(struct net_context *c, int argc, const char **argv)
map.gid = grp->gr_gid;
if (c->opt_rid == 0) {
- if ( pdb_rid_algorithm() )
- c->opt_rid = algorithmic_pdb_gid_to_group_rid(map.gid);
- else {
+ if ( pdb_capabilities() & PDB_CAP_STORE_RIDS ) {
if ( !pdb_new_rid((uint32*)&c->opt_rid) ) {
d_fprintf( stderr, "Could not allocate new RID\n");
return -1;
}
+ } else {
+ c->opt_rid = algorithmic_pdb_gid_to_group_rid(map.gid);
}
}