diff options
author | Volker Lendecke <vl@samba.org> | 2009-06-28 17:36:12 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-06-28 22:13:50 +0200 |
commit | 711544d4943a40649b6c590f8ee003093081889a (patch) | |
tree | afee8fcd95e3a9b3844dccd9cb11b2418cf67fd8 /source3/utils | |
parent | 325a58a6532e2a9bc7b8e21d55c9b1ccfb879bf9 (diff) | |
download | samba-711544d4943a40649b6c590f8ee003093081889a.tar.gz samba-711544d4943a40649b6c590f8ee003093081889a.tar.bz2 samba-711544d4943a40649b6c590f8ee003093081889a.zip |
Turn the pdb_rid_algorithm into a capabilities call that returns flags
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_groupmap.c | 12 | ||||
-rw-r--r-- | source3/utils/net_sam.c | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/source3/utils/net_groupmap.c b/source3/utils/net_groupmap.c index a00784e133..16c6187664 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); } } diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c index 787bbdd502..62abef000d 100644 --- a/source3/utils/net_sam.c +++ b/source3/utils/net_sam.c @@ -817,14 +817,14 @@ static NTSTATUS map_unix_group(const struct group *grp, GROUP_MAP *pmap) fstrcpy(map.nt_name, grpname); - if (pdb_rid_algorithm()) { - rid = algorithmic_pdb_gid_to_group_rid( grp->gr_gid ); - } else { + if (pdb_capabilities() & PDB_CAP_STORE_RIDS) { if (!pdb_new_rid(&rid)) { DEBUG(3, ("Could not get a new RID for %s\n", grp->gr_name)); return NT_STATUS_ACCESS_DENIED; } + } else { + rid = algorithmic_pdb_gid_to_group_rid( grp->gr_gid ); } sid_compose(&map.sid, get_global_sam_sid(), rid); |