summaryrefslogtreecommitdiff
path: root/source3/passdb/py_passdb.c
AgeCommit message (Collapse)AuthorFilesLines
2012-08-28s3-passdb: Allow reload of the static passdb from pythonAndrew Bartlett1-0/+18
This is then used in provision when the passdb backend is forced. Andrew Bartlett
2012-08-02s3-pypassdb: Fix wrapper for pdb_domain_info to return correct ↵Andrew Bartlett1-2/+2
dns_{domain,forest}
2012-07-18source3/passdb/py_passdb.c: wrap all calls in talloc_stackframe()Rusty Russell1-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>
2012-07-18source3/passdb/py_passdb.c: don't steal from talloc_stackframe().Rusty Russell1-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>
2012-05-03s3-pypassdb: add wrapper for enum_group_membershipsAndrew Bartlett1-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
2012-05-03s3-pypassdb: remove unused variableAndrew Bartlett1-2/+0
2012-05-02s3-passdb: Change pdb_sid_to_id() to return struct unixidAndrew Bartlett1-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>
2012-04-19s3-passdb: Remove unused sampass->pass_must_change_timeAndrew Bartlett1-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
2011-11-18s3-py-passdb: Fix handling of uninitialized gid valuesAmitay Isaacs1-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
2011-11-18s4-s3-upgrade now look for -1 as the special 'not set' valueAndrew Bartlett1-1/+1
this is possible because we know the py_passdb will always set -1 here, not passing though 0xFFFFFFFF. Andrew Bartlett
2011-11-11py_passdb: Cannot steal an item pointer from an arrayAmitay Isaacs1-4/+9
Autobuild-User: Amitay Isaacs <amitay@samba.org> Autobuild-Date: Fri Nov 11 12:04:33 CET 2011 on sn-devel-104
2011-11-09s3-py_passdb Ensure that group mapping list input is initailisedAndrew Bartlett1-1/+2
This may help to ensure we consistantly crash on an incorrect de-reference. Andrew Bartlett
2011-10-18pdb-interface: Do not use unid_t hereSimo Sorce1-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
2011-10-12s3-group-mapping: Remove fstrings from GROUP_MAP.Simo Sorce1-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
2011-09-26s3-passdb: Cleanup use of fstring and move to talloc.Simo Sorce1-5/+14
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-26s3-passdb: Allocate talloc stackframe before calling pdb_get_group_sid()Amitay Isaacs1-5/+6
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-26s3-passdb: Make domain_sid argument optional for search_aliases methodAmitay Isaacs1-5/+10
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-26s3-passdb: Return assigned number of hours and not MAX_HOURS_LENAmitay Isaacs1-3/+4
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-26s3-passdb: Convert lm_pw and nt_pw to python string using lengthAmitay Isaacs1-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>
2011-08-19s3:passdb/py_passdb.c - restore Python >= 2.4 compatibilityMatthias Dieter Wallnöfer1-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
2011-08-19s3-passdb: Fix the get/set routines for pw_history for samuAmitay Isaacs1-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>
2011-08-19s3-passdb: Display username when reporting error on add_sam_account.Amitay Isaacs1-1/+2
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-19s3-passdb: Fix call for search_aliases(). It returns bool and not NTSTATUS.Amitay Isaacs1-4/+1
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-19s3-passdb: Return list of sids from python wrapper enum_group_membersAmitay Isaacs1-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>
2011-08-19s3-passdb: Make arguments for python wrapper enum_group_mapping() optionalAmitay Isaacs1-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>
2011-08-19s3-passdb: Added python wrapper for passdb methodsAmitay Isaacs1-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>
2011-08-19s3-passdb: Python wrapper for passdbAmitay Isaacs1-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>
2011-08-14s3-passdb: Fix python < 2.6 build errors in passdb python wrapperAndrew Bartlett1-0/+4
Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Sun Aug 14 03:59:48 CEST 2011 on sn-devel-104
2011-08-13s3-passdb: Added python method to get_global_sam_sidAmitay Isaacs1-0/+31
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-13s3-passdb: Return dom_sid and guid with correct python types.Amitay Isaacs1-7/+31
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-13passdb: Allocate talloc stackframe before calling in pdb functions.Amitay Isaacs1-2/+32
2011-08-13passdb: Added python wrapper to passdbAmitay Isaacs1-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>