summaryrefslogtreecommitdiff
path: root/source3/utils/net_idmap.c
AgeCommit message (Collapse)AuthorFilesLines
2013-10-02net: allow "net idmap get ranges" to list all rangesMichael Adam1-5/+7
Omission of SID parameter lists ranges for all domains. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Oct 2 12:23:33 CEST 2013 on sn-devel-104
2013-10-02net: implement "net idmap delete ranges"Michael Adam1-0/+67
Inspired by a patch by Atul Kulkarni <atul.kulkarni@in.ibm.com>. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: add "net idmap get ranges" operation for autoridMichael Adam1-0/+78
Implemented using the idmap_autorid_iterate_domain_ranges_read() function. Based on earlier patch by Atul Kulkarni <atul.kulkarni@in.ibm.com>. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: implement "net idmap delete range"Michael Adam1-0/+95
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: implement "net idmap get range"Michael Adam1-0/+86
get the range for a domain sid and range index. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: add "net idmap set range" (for autorid backend)Michael Adam1-0/+83
This lets the admin store a range for a domain/index pair. Call syntax is: net idmap set range <RANGE> <DOMSID> [<INDEX>] INDEX defaults to 0. Pair-Programmed-With: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net idmap: add utility function parse_uint32()Volker Lendecke1-0/+24
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-10-02net: add "net idmap get config" to read the autorid config from the databaseAtul Kulkarni1-0/+50
Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: add "net idmap get" commandMichael Adam1-0/+17
This has no subcommands yet and is added in preparation of adding some. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: add "net idmap set config" command to store the autorid global configAtul Kulkarni1-0/+47
Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: add new function net_idmap_opendb_autorid()Atul Kulkarni1-0/+51
This checks the backend is autorid, and opens the db if so. If readonly == true, the DB is simply opened for reading. If readonly == false, the DB is created if necessary and initialized with HWMs. Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: rename "idmap_dump_ctx" to "net_idmap_ctx".Michael Adam1-6/+6
This started specific, but is now generic. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: move the "net idmap delete" functionality to subcommand "net idmap ↵Michael Adam1-5/+24
delete mapping" This is in preparation of adding more types of entries to delete... Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: add the "net idmap set secret" subcommand as alias for "net idmap secret"Michael Adam1-1/+9
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: move the "net idmap set" functionality to subcommand "net idmap set ↵Michael Adam1-3/+21
mapping" This is in preparation of adding more "net idmap set" subcommands for the autorid backend. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: rename "net idmap setmap" to "net idmap set"Michael Adam1-2/+3
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: improve help text for "net idmap restore"Michael Adam1-1/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-10-02net: improve help text for "net idmap dump"Michael Adam1-1/+1
With idmap autorid "dump ID mappings" is not precise enough any more. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2013-03-09s3-net: Allow setting the ldap password for idmap_rfc2307Christof Schmitt1-2/+4
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-02-05s3:net: reduce indentation in net idmap delete for symmetry and consistencyMichael Adam1-5/+7
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05s3:net: introduce a talloc stackframe for net idmap deleteMichael Adam1-3/+2
this simplifies the freeing at the end Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05s3:net_idmap_delete do not lock two records at the same timeChristian Ambach1-24/+25
the lock order check will prohibit this and as we are running inside a transaction there is no need to lock the records before deleting them Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Christian Ambach <ambi@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
2013-02-05s3:net idmap: use lp_idmap_default_backend() now that we have it.Michael Adam1-1/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
2013-02-05s3:net idmap: remove call to lp_idmap_backend() - this is useless.Michael Adam1-2/+2
The variable behind lp_idmap_backend() is never set. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
2013-01-29s3:utils/net remove aclmapset commandChristian Ambach1-73/+0
this was made for the nfs4:sidmap code that has been removed, so this subcommand can also go away Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Jan 29 15:37:18 CET 2013 on sn-devel-104
2013-01-29s3:net_idmap_dump support dumping autorid backendChristian Ambach1-8/+106
- remember the type of idmapping database (tdb or autorid) this allows to make rest of the code (e.g. dump) know which database-style it will encounter - add a seperate dump function for autorid - default to TDB if db-file is given on the command-line Pair-Programmed-With: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Signed-off-by: Christian Ambach <ambi@samba.org> Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Michael Adam <obnox@samba.org>
2013-01-29s3:net_idmap_dump add missing bracesChristian Ambach1-1/+2
see README.Coding Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-01-29s3:net_idmap_dump remove obsolete support for tdb:idmap2.tdb parameterChristian Ambach1-6/+2
this one got removed from idmap_tdb2 a while ago Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-01-29s3:net_idmap_dump deal with idmap config * : backend config styleChristian Ambach1-6/+13
this is the new config style since Samba 3.6 and should be detected by net idmap dump Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2012-08-09Check error returns from strupper_m() (in all reasonable places).Jeremy Allison1-1/+5
2012-07-18loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell1-1/+2
They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-15dbwrap: dbwrap_store_int32->dbwrap_store_int32_bystringVolker Lendecke1-2/+4
Signed-off-by: Michael Adam <obnox@samba.org>
2012-01-18s3: Add a "lock_order" argument to db_openVolker Lendecke1-4/+8
This will be used to enforce a lock hierarchy between the databases. We have seen deadlocks between locking.tdb, brlock.tdb, serverid.tdb and notify*.tdb. These should be fixed by refusing a dbwrap_fetch_locked that does not follow a defined lock hierarchy.
2011-10-11s3:dbwrap: change dbwrap_store_int32() to NTSTATUS return typeMichael Adam1-6/+10
for consistency and better error propagation
2011-10-11s3:net: convert net idmap to use only dbwrap wrapper functionsMichael Adam1-19/+34
Avoid direct use of the db_record and db_context structs.
2011-07-29s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/Michael Adam1-1/+1
Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.Michael Adam1-0/+1
Also start new folder lib/dbwrap/ where dbwrap_open.c is stored and make the fallbacke implementation functoins non-static and create a dbwrap_private.h header file that contains their prototypes.
2011-05-06s3: only include tdb headers where needed.Günther Deschner1-0/+1
Guenther
2011-04-07s3-net: fix the usage output of "net idmap check"Gregor Beck1-4/+5
Signed-off-by: Michael Adam <obnox@samba.org>
2011-04-04s3-net: add command "net idmap check"Gregor Beck1-1/+46
This is a tool to check the consistency of an idmap tdb database. The default mode is to scan the database and list invalid entries, e.g. records with an invalid format, or records which are valid but for which the reverse mapping entry is missing. With the "--repair" switch, one can enter an interactive repair mode which will prompt for each invalid entry found with the option to delete, skip or edit the record. There is also a non-interactive repair mode triggered by "--auto" which will remove all records with invalid content and fill up mappings which are missing the reverse entry. The "--test" parameter lets "net idmap check" only list the changes that would be written and not actually commit them to the database. The "--lock" option allows to lock the database already in the first reading traverse, in order to remove the race when the database has to be closed and reopened again before writing the changes. Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Mon Apr 4 18:21:09 CEST 2011 on sn-devel-104
2011-03-30s3-includes: only include system/filesys.h when needed.Günther Deschner1-0/+1
Guenther
2011-02-09s3:net idmap: implement net idmap deleteGregor Beck1-5/+137
Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Wed Feb 9 15:06:06 CET 2011 on sn-devel-104
2011-02-09s3:net idmap dump: report correct database file when failed to open idmap db.Michael Adam1-1/+1
2011-02-09s3:net idmap dump: use net_idmap_dbfileGregor Beck1-7/+15
2011-02-09s3:net idmap restore: correctly abort operation if dbfile could not be ↵Michael Adam1-0/+5
determined
2011-02-09s3:net idmap: fix error reporting in net_idmap_dbfile()Michael Adam1-3/+10
The last case which results in dbfile == NULL is not an out of memory case but means no --db has been specified and the idmap backend is not supported for auto-determining the idmap tdb file.
2011-02-09s3:net factor out net_idmap_dbfileGregor Beck1-33/+37
2011-02-09s3:net idmap restore: fix segfault on missing input fileGregor Beck1-0/+6
2011-02-08s3:net: remove unused net_idmap_helpGregor Beck1-16/+0
Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Tue Feb 8 11:50:37 CET 2011 on sn-devel-104
2011-01-02s3:net: make idmap_store_secret static.Michael Adam1-3/+4
Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Sun Jan 2 13:41:07 CET 2011 on sn-devel-104