summaryrefslogtreecommitdiffstats
path: root/source3/utils/net_idmap.c
Commit message (Collapse)AuthorAgeFilesLines
* dbwrap: add a dbwrap_flags argument to db_open()Michael Adam2014-02-071-4/+4
| | | | | | | | | | This is in preparation to support handing flags to backends, in particular activating read only record support for ctdb databases. For a start, this does nothing but adding the parameter, and all databases use DBWRAP_FLAG_NONE. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* autorid: Correctly init range_index for "delete range"Volker Lendecke2013-11-141-0/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Nov 14 15:55:54 CET 2013 on sn-devel-104
* net: remove net idmap secretAtul Kulkarni2013-11-081-8/+0
| | | | | | | | | | | This is moved to net idmap set secret for consistency. Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Nov 8 01:03:25 CET 2013 on sn-devel-104
* net: correct typos in net idmap delete ranges help messageAtul Kulkarni2013-11-071-2/+2
| | | | | | Signed-off-by: Atul Kulkarni <atul.kulkarni@in.ibm.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* net: allow "net idmap get ranges" to list all rangesMichael Adam2013-10-021-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
* net: implement "net idmap delete ranges"Michael Adam2013-10-021-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>
* net: add "net idmap get ranges" operation for autoridMichael Adam2013-10-021-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>
* net: implement "net idmap delete range"Michael Adam2013-10-021-0/+95
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* net: implement "net idmap get range"Michael Adam2013-10-021-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>
* net: add "net idmap set range" (for autorid backend)Michael Adam2013-10-021-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>
* net idmap: add utility function parse_uint32()Volker Lendecke2013-10-021-0/+24
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* net: add "net idmap get config" to read the autorid config from the databaseAtul Kulkarni2013-10-021-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>
* net: add "net idmap get" commandMichael Adam2013-10-021-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>
* net: add "net idmap set config" command to store the autorid global configAtul Kulkarni2013-10-021-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>
* net: add new function net_idmap_opendb_autorid()Atul Kulkarni2013-10-021-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>
* net: rename "idmap_dump_ctx" to "net_idmap_ctx".Michael Adam2013-10-021-6/+6
| | | | | | | This started specific, but is now generic. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* net: move the "net idmap delete" functionality to subcommand "net idmap ↵Michael Adam2013-10-021-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>
* net: add the "net idmap set secret" subcommand as alias for "net idmap secret"Michael Adam2013-10-021-1/+9
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* net: move the "net idmap set" functionality to subcommand "net idmap set ↵Michael Adam2013-10-021-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>
* net: rename "net idmap setmap" to "net idmap set"Michael Adam2013-10-021-2/+3
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* net: improve help text for "net idmap restore"Michael Adam2013-10-021-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* net: improve help text for "net idmap dump"Michael Adam2013-10-021-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>
* s3-net: Allow setting the ldap password for idmap_rfc2307Christof Schmitt2013-03-091-2/+4
| | | | Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:net: reduce indentation in net idmap delete for symmetry and consistencyMichael Adam2013-02-051-5/+7
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
* s3:net: introduce a talloc stackframe for net idmap deleteMichael Adam2013-02-051-3/+2
| | | | | | | this simplifies the freeing at the end Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
* s3:net_idmap_delete do not lock two records at the same timeChristian Ambach2013-02-051-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>
* s3:net idmap: use lp_idmap_default_backend() now that we have it.Michael Adam2013-02-051-1/+1
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Christian Ambach <ambi@samba.org>
* s3:net idmap: remove call to lp_idmap_backend() - this is useless.Michael Adam2013-02-051-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>
* s3:utils/net remove aclmapset commandChristian Ambach2013-01-291-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
* s3:net_idmap_dump support dumping autorid backendChristian Ambach2013-01-291-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>
* s3:net_idmap_dump add missing bracesChristian Ambach2013-01-291-1/+2
| | | | | | | see README.Coding Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:net_idmap_dump remove obsolete support for tdb:idmap2.tdb parameterChristian Ambach2013-01-291-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>
* s3:net_idmap_dump deal with idmap config * : backend config styleChristian Ambach2013-01-291-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>
* Check error returns from strupper_m() (in all reasonable places).Jeremy Allison2012-08-091-1/+5
|
* loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell2012-07-181-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>
* dbwrap: dbwrap_store_int32->dbwrap_store_int32_bystringVolker Lendecke2012-06-151-2/+4
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3: Add a "lock_order" argument to db_openVolker Lendecke2012-01-181-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.
* s3:dbwrap: change dbwrap_store_int32() to NTSTATUS return typeMichael Adam2011-10-111-6/+10
| | | | for consistency and better error propagation
* s3:net: convert net idmap to use only dbwrap wrapper functionsMichael Adam2011-10-111-19/+34
| | | | Avoid direct use of the db_record and db_context structs.
* s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/Michael Adam2011-07-291-1/+1
| | | | | Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
* s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.Michael Adam2011-07-291-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.
* s3: only include tdb headers where needed.Günther Deschner2011-05-061-0/+1
| | | | Guenther
* s3-net: fix the usage output of "net idmap check"Gregor Beck2011-04-071-4/+5
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3-net: add command "net idmap check"Gregor Beck2011-04-041-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
* s3-includes: only include system/filesys.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3:net idmap: implement net idmap deleteGregor Beck2011-02-091-5/+137
| | | | | Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Wed Feb 9 15:06:06 CET 2011 on sn-devel-104
* s3:net idmap dump: report correct database file when failed to open idmap db.Michael Adam2011-02-091-1/+1
|
* s3:net idmap dump: use net_idmap_dbfileGregor Beck2011-02-091-7/+15
|
* s3:net idmap restore: correctly abort operation if dbfile could not be ↵Michael Adam2011-02-091-0/+5
| | | | determined
* s3:net idmap: fix error reporting in net_idmap_dbfile()Michael Adam2011-02-091-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.