summaryrefslogtreecommitdiffstats
path: root/source3/passdb/py_passdb.c
Commit message (Collapse)AuthorAgeFilesLines
* s3:passdb: Fix the use of uninitialized scalar variable.Poornima Gurusiddaiah2014-02-241-8/+2
| | | | | | | | Coverity-id: 1107228,1107227 Signed-off-by: Poornima Gurusiddaiah <pgurusid@redhat.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
* s3-passdb: Fix string duplication to pointers.Andreas Schneider2014-01-091-2/+12
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Jan 9 22:35:25 CET 2014 on sn-devel-104
* samba:python - Py_RETURN_NONE remove compatibility code for releases < 2.4Matthias Dieter Wallnöfer2014-01-091-4/+0
| | | | | | | | | http://www.python.org/doc//current/c-api/none.html Reviewed-By: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date(master): Thu Jan 9 16:27:47 CET 2014 on sn-devel-104
* ntdb: switch between secrets.tdb and secrets.ntdb depending on 'use ntdb'Rusty Russell2013-02-201-1/+1
| | | | | | | | | | | Since we open with dbwrap, it auto-converts old tdbs (which it will rename to secrets.tdb.bak once it's done). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au> Autobuild-Date(master): Wed Feb 20 07:09:19 CET 2013 on sn-devel-104
* s3-passdb: Allow reload of the static passdb from pythonAndrew Bartlett2012-08-281-0/+18
| | | | | | This is then used in provision when the passdb backend is forced. Andrew Bartlett
* s3-pypassdb: Fix wrapper for pdb_domain_info to return correct ↵Andrew Bartlett2012-08-021-2/+2
| | | | dns_{domain,forest}
* source3/passdb/py_passdb.c: wrap all calls in talloc_stackframe()Rusty Russell2012-07-181-519/+489
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dbwrap needs it. Some calls were already wrapped, but they checked the talloc_stackframe() return unnecessarily: it can never be NULL. This is the coccinelle patch I used: // Add in a stackframe to every function: be sure to free it on (every) return @rule0@ identifier func; @@ func(...) { +TALLOC_CTX *frame = talloc_stackframe(); <... +talloc_free(frame); return ...; ...> } // Get rid of tframe allocation/frees, replace usage with frame. @rule1@ identifier func; identifier oldframe; @@ func(...) { ... -TALLOC_CTX *oldframe; ... -if ((oldframe = talloc_stackframe()) == NULL) { - ... -} <... -talloc_free(oldframe); ...> } // Get rid of tframe (variant 2) @rule2@ identifier func; identifier oldframe; @@ func(...) { ... -TALLOC_CTX *oldframe; ... -oldframe = talloc_stackframe(); -if (oldframe == NULL) { - ... -} <... -talloc_free(oldframe); ...> } // Change tframe to frame @rule3@ identifier func; @@ func(...) { <... -tframe +frame ...> } Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* source3/passdb/py_passdb.c: don't steal from talloc_stackframe().Rusty Russell2012-07-181-15/+2
| | | | | | | | | | If you want a stack-style allocation, use talloc_stackframe(). If you don't, don't use it. In particular, talloc_stackframe() here is actually inside a pool, and stealing from pools is a bad idea. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* s3-pypassdb: add wrapper for enum_group_membershipsAndrew Bartlett2012-05-031-1/+57
| | | | | | | | This will be used in samba3upgrade to try and get the group memberships by instead asking for the groups each user is in. This reverse lookup may be more reliable, as this is used at login time. Andrew Bartlett
* s3-pypassdb: remove unused variableAndrew Bartlett2012-05-031-2/+0
|
* s3-passdb: Change pdb_sid_to_id() to return struct unixidAndrew Bartlett2012-05-021-5/+4
| | | | | | | | | This will make it easier to consistantly pass a struct unixid all the way up and down the idmap stack, and allow ID_TYPE_BOTH to be handled correctly. Andrew Bartlett Signed-off-by: Michael Adam <obnox@samba.org>
* s3-passdb: Remove unused sampass->pass_must_change_timeAndrew Bartlett2012-04-191-4/+3
| | | | | | | | | | | | There is no need to call pdb_set_pass_must_change_time() because nothing ever consults that value. It is always calculated from the domain policy. Also, this means we no longer store the value in LDAP. The value would only ever be set when migrating from tdbsam or smbpasswd, not on password changes, so would become incorrect over time. Andrew Bartlett
* s3-py-passdb: Fix handling of uninitialized gid valuesAmitay Isaacs2011-11-181-1/+1
| | | | | | | | Uninitialized gid value is set to -1 and return as such from python passdb api. Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Fri Nov 18 06:18:33 CET 2011 on sn-devel-104
* s4-s3-upgrade now look for -1 as the special 'not set' valueAndrew Bartlett2011-11-181-1/+1
| | | | | | | this is possible because we know the py_passdb will always set -1 here, not passing though 0xFFFFFFFF. Andrew Bartlett
* py_passdb: Cannot steal an item pointer from an arrayAmitay Isaacs2011-11-111-4/+9
| | | | | Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Fri Nov 11 12:04:33 CET 2011 on sn-devel-104
* s3-py_passdb Ensure that group mapping list input is initailisedAndrew Bartlett2011-11-091-1/+2
| | | | | | This may help to ensure we consistantly crash on an incorrect de-reference. Andrew Bartlett
* pdb-interface: Do not use unid_t hereSimo Sorce2011-10-181-3/+4
| | | | | | | | This interface needs to be publicly available, unid_t here is not really useful and makes it harder to use it as unid_t is not a public union. Autobuild-User: Simo Sorce <idra@samba.org> Autobuild-Date: Tue Oct 18 20:57:16 CEST 2011 on sn-devel-104
* s3-group-mapping: Remove fstrings from GROUP_MAP.Simo Sorce2011-10-121-3/+5
| | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Oct 12 19:28:12 CEST 2011 on sn-devel-104
* s3-passdb: Cleanup use of fstring and move to talloc.Simo Sorce2011-09-261-5/+14
| | | | Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-passdb: Allocate talloc stackframe before calling pdb_get_group_sid()Amitay Isaacs2011-08-261-5/+6
| | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3-passdb: Make domain_sid argument optional for search_aliases methodAmitay Isaacs2011-08-261-5/+10
| | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3-passdb: Return assigned number of hours and not MAX_HOURS_LENAmitay Isaacs2011-08-261-3/+4
| | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3-passdb: Convert lm_pw and nt_pw to python string using lengthAmitay Isaacs2011-08-261-2/+2
| | | | | | | lm_pw and nt_pw are fixed length strings and convert them to python strings as fixed length strings. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3:passdb/py_passdb.c - restore Python >= 2.4 compatibilityMatthias Dieter Wallnöfer2011-08-191-0/+7
| | | | | Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Fri Aug 19 21:03:44 CEST 2011 on sn-devel-104
* s3-passdb: Fix the get/set routines for pw_history for samuAmitay Isaacs2011-08-191-2/+2
| | | | | | | | Return pw_history with current string length (which is a multiple of PW_HISTORY_ENTRY_LEN) and same thing for setting the pw_history. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3-passdb: Display username when reporting error on add_sam_account.Amitay Isaacs2011-08-191-1/+2
| | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3-passdb: Fix call for search_aliases(). It returns bool and not NTSTATUS.Amitay Isaacs2011-08-191-4/+1
| | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3-passdb: Return list of sids from python wrapper enum_group_membersAmitay Isaacs2011-08-191-5/+9
| | | | | | | | Instead of returning rids as the C api does, return sids, so it is similar to enum_aliasmem and can be used easily in s3_upgrade. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3-passdb: Make arguments for python wrapper enum_group_mapping() optionalAmitay Isaacs2011-08-191-5/+10
| | | | | | | Set the defaults, if no arguments are provided. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3-passdb: Added python wrapper for passdb methodsAmitay Isaacs2011-08-191-21/+831
| | | | | | | | | | | | | Added following methods - uid_to_sid, gid_to_sid, sid_to_id, new_rid - get_trusteddom_pw, set_trusteddom_pw, del_trusteddom_pw, enum_trusteddoms - get_trusted_domain, get_trusted_domain_by_sid, set_trusted_domain, del_trusted_domain, enum_trusted_domains - get_secret, set_secret, delete_secret Updated documentation for all methods Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3-passdb: Python wrapper for passdbAmitay Isaacs2011-08-191-8/+1283
| | | | | | | | | | | | | | | | | | | - Added Groupmap python wrapper - Added passdb methods getgrsid, getgrgid, getgrnam create_dom_group, delete_dom_group add_group_mapping_entry, update_group_mapping_entry, delete_group_mapping_entry enum_group_mapping, enum_group_members add_groupmem, del_groupmem create_alias, delete_alias get_aliasinfo, set_aliasinfo add_aliasmem, del_aliasmem, enum_aliasmem get_account_policy, set_account_policy search_groups, search_aliases Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s3-passdb: Fix python < 2.6 build errors in passdb python wrapperAndrew Bartlett2011-08-141-0/+4
| | | | | Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sun Aug 14 03:59:48 CEST 2011 on sn-devel-104
* s3-passdb: Added python method to get_global_sam_sidAmitay Isaacs2011-08-131-0/+31
| | | | Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s3-passdb: Return dom_sid and guid with correct python types.Amitay Isaacs2011-08-131-7/+31
| | | | Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* passdb: Allocate talloc stackframe before calling in pdb functions.Amitay Isaacs2011-08-131-2/+32
|
* passdb: Added python wrapper to passdbAmitay Isaacs2011-08-131-0/+1553
- Added python wrapper for samu structure. - Added python wrapper for passdb methods: domain_info(), getsampwnam(), getsampwsid(), create_user(), delete_user(), add_sam_account(), delete_sam_account(), update_sam_account(), rename_sam_account(), search_users() Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>