1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

1739 Commits

Author SHA1 Message Date
Amitay Isaacs
17c74e5dfd s3-passdb: Make domain_sid argument optional for search_aliases method
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-26 10:06:33 +10:00
Amitay Isaacs
0cfeb65a0b s3-passdb: Return assigned number of hours and not MAX_HOURS_LEN
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-26 10:06:33 +10:00
Amitay Isaacs
a38a3b16e1 s3-passdb: Convert lm_pw and nt_pw to python string using length
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-26 10:06:32 +10:00
Andrew Tridgell
fb612af655 pdb-samba4: use ldb_get_default_basedn() instead of NULL
this makes pdb-samba4 safe for multi-domain setups

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-25 07:39:37 +10:00
Andreas Schneider
d713f9e9f5 s3-passdb: Only delete 1 entry from memcache.
If we delete or update one user we shouldn't flush the complete
memcache.

Signed-off-by: Simo Sorce <idra@samba.org>

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Sun Aug 21 16:39:10 CEST 2011 on sn-devel-104
2011-08-21 16:39:10 +02:00
Andreas Schneider
99bb3eed1d s3-passdb: Remove always the user from getpwsid cache.
We should do it always, not only in the pdb_default_delete_user()
function.

Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:08:25 -04:00
Andreas Schneider
1152aa8e03 s3-passdb: Keep caches coherent
When deleting a user send a message to all interested parties so they can
purge their caches. Otherwise some processes may positively respond with a
cached getpwnam, when the user have actully been removed.

Without this some tests that remove and then immediately create users are
flakey.

Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:08:25 -04:00
Andreas Schneider
177db0a880 s3-id_cache: Move id caches mgmt out of smbd
We must leave the MSG_IDMAP_KILL operation in SMBD as it uses smbd
specific internal globals and makes sense only in the context of a smbd
daemon.
The rest is moved under lib/ as we need to deal with id cache cleanups
in other daemons too (like lsasd).

Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21 09:08:25 -04:00
Matthias Dieter Wallnöfer
c21c254508 s3:passdb/py_passdb.c - restore Python >= 2.4 compatibility
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-19 21:03:44 +02:00
Andrew Bartlett
0db0e93517 s3-passdb pdb_samba4 handles PDB_PWHISTORY already
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Aug 19 10:40:16 CEST 2011 on sn-devel-104
2011-08-19 10:40:16 +02:00
Amitay Isaacs
22cce00151 s3-passdb: Fix the get/set routines for pw_history for samu
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-19 16:35:11 +10:00
Amitay Isaacs
dadaca01d2 s3-passdb: Display username when reporting error on add_sam_account.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-19 16:35:08 +10:00
Amitay Isaacs
876f9cc290 s3-passdb: Use pdb_get_nt_passwd() to get nt passwd.
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-19 16:35:07 +10:00
Amitay Isaacs
0fef5a3a26 s3-passdb: Fix call for search_aliases(). It returns bool and not NTSTATUS.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-19 16:35:02 +10:00
Amitay Isaacs
1c1f4e27a8 s3-passdb: Return list of sids from python wrapper enum_group_members
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-19 16:35:01 +10:00
Amitay Isaacs
590ed81c48 s3-passdb: Make arguments for python wrapper enum_group_mapping() optional
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-19 16:35:00 +10:00
Amitay Isaacs
f4c7a448d4 s3-passdb: Added python wrapper for passdb methods
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-19 16:34:59 +10:00
Amitay Isaacs
5b444916bf s3-passdb: Python wrapper for passdb
- 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-19 16:34:57 +10:00
Amitay Isaacs
4201d6fd68 s3-passdb: Replace SMB_MALLOC_ARRAY()/SAFE_FREE() with talloc equivalents.
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2011-08-19 16:34:56 +10:00
Björn Jacke
dcb5720ad0 s3/ldap: don't continue if we couldn't get the domain info on startup
while some things work without the domain info, some important things don't,
which is highly irritating. As even calls like EnumTrustDom fail and
thus clients' domain logins fail we are sufficiently broken to refuse to go on.

Autobuild-User: Björn Jacke <bj@sernet.de>
Autobuild-Date: Thu Aug 18 12:48:37 CEST 2011 on sn-devel-104
2011-08-18 12:48:37 +02:00
Andrew Bartlett
3df9e62c97 s3-passdb Use supplied pdb_methods in default passdb search handlers 2011-08-15 08:26:06 +02:00
Andrew Bartlett
d2d2e7ab02 s3-passdb: Fix python < 2.6 build errors in passdb python wrapper
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sun Aug 14 03:59:48 CEST 2011 on sn-devel-104
2011-08-14 03:59:48 +02:00
Amitay Isaacs
1c1f7df956 s3-passdb: Added python method to get_global_sam_sid
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-13 12:31:09 +10:00
Amitay Isaacs
e580f33b13 s3-passdb: Return dom_sid and guid with correct python types.
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-13 12:31:09 +10:00
Amitay Isaacs
a252e69db2 passdb: Move python wrapper for passdb in samba3 python package 2011-08-13 12:31:07 +10:00
Amitay Isaacs
6a18664d51 s3-passdb: Connect to specified samdb if location is provided, otherwise use default
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-13 12:30:50 +10:00
Amitay Isaacs
d7ab07e86f s3-passdb: Fix the error messages and return correct NTSTATUS
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-13 12:30:50 +10:00
Andrew Bartlett
93e8d3b381 s4-scripting Rename passdb upgrade routine to avoid conflict with upgradeprovision 2011-08-13 12:30:49 +10:00
Andrew Bartlett
00364e4e0d s3-passdb Add support for pdb_add_sam_account() and password hashes to pdb_samba4
This will help when using this as part of the Samba3 passdb -> Samba4
ldb database upgrade script.

Andrew Bartlett
2011-08-13 12:30:49 +10:00
Andrew Bartlett
2993113a56 s4-dsdb Add ability to force a particular SID in the upgrade case 2011-08-13 12:30:49 +10:00
Andrew Bartlett
add8505fde s3-passdb Make pdb_element_is_changed available to all passdb modules
This will allow pdb_samba4 to use this

Andrew Bartlett
2011-08-13 12:30:49 +10:00
Amitay Isaacs
65e12c0501 passdb: Allocate talloc stackframe before calling in pdb functions. 2011-08-13 12:30:48 +10:00
Amitay Isaacs
ae9a3274bc passdb: Call with correct backend methods instead of default methods
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-08-13 12:30:48 +10:00
Amitay Isaacs
2e0ccc4772 passdb: Added python wrapper to passdb
- 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>
2011-08-13 12:30:44 +10:00
Amitay Isaacs
08ccc6ed51 passdb: Add a function to read secrets db from a specified path
This allows to load secrets db from a different location. The original
secrets_init() now calls secrets_init_path() with lp_private_dir().
2011-08-13 10:25:06 +10:00
Amitay Isaacs
6f21f556c1 passdb: Add a function to expose loaded backend list.
This function is used in python wrapper to list available python backends.
2011-08-13 10:25:06 +10:00
Günther Deschner
51481c5912 s3-secrets: add lsa_secret passdb api.
Guenther
2011-07-31 22:37:26 +02:00
Günther Deschner
f9a5df8929 s3-passdb: add dummy calls to control global (replicated) secrets.
Guenther
2011-07-31 22:37:26 +02:00
Michael Adam
0b5c4a601a s3:dbwrap: move all .c and .h files of dbwrap to lib/dbwrap/
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Jul 29 13:34:22 CEST 2011 on sn-devel-104
2011-07-29 13:34:22 +02:00
Michael Adam
1abdd9b2bb s3:dbwrap: move db_open() to a file dbwrap_open.c of its own.
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-07-29 12:23:13 +02:00
Andrew Tridgell
356a2cc0b0 s3-waf: the passdb subsystem needs to be called pdb
the 'pdb' name is builtin to the passdb module loading code as a fixed
string. We need to call the subsystem pdb so that external passdb
modules end up in bin/modules/pdb/ where they can be found by the
Samba3 module loader

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-28 15:20:51 +10:00
Jeremy Allison
ee34c25c8a First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systems
Remove
int toupper_ascii(int c);
int tolower_ascii(int c);
int isupper_ascii(int c);
int islower_ascii(int c);

and replace with their _m equivalents, as they are identical.
2011-07-19 13:19:29 -07:00
Andrew Bartlett
6e6aaacedb lib/util Move bitmap.c to lib/util 2011-07-08 11:23:23 +02:00
Andrew Bartlett
0ac4f64928 s3-build link passdb modules against libpassdb
This ensures that they don't include a duplicate copy of
pdb_interface.c functions, because they will instead link the library.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Mon Jul  4 12:24:50 CEST 2011 on sn-devel-104
2011-07-04 12:24:50 +02:00
Andrew Bartlett
6b97a3b1ff s3-build allow_undefined_symbols=False is the default now 2011-07-04 19:03:52 +10:00
Günther Deschner
8bc3f957bc s3-waf: add some missing tdb dependencies.
Guenther
2011-06-28 16:43:01 +02:00
Andrew Bartlett
5db74b9607 lib/util Remove samba-util-common!
All of this code is now in common, so we don't need the second
'-common' library any more!

Andrew Bartlett
2011-06-21 09:36:22 +10:00
Rusty Russell
d925b327f4 tdb_compat: Higher level API fixes.
My previous patches fixed up all direct TDB callers, but there are a
few utility functions and the db_context functions which are still
using the old -1 / 0 return codes.

It's clearer to fix up all the callers of these too, so everywhere is
consistent: non-zero means an error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Sumit Bose
d5661467e1 s3-passdb: Implement new pdb trust calls for the default backend
Signed-off-by: Simo Sorce <idra@samba.org>

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Sun Jun 12 06:45:25 CEST 2011 on sn-devel-104
2011-06-12 06:45:25 +02:00
Andrew Bartlett
74eed8f3ed s3-param Remove special case for global_myname(), rename to lp_netbios_name()
There is no reason this can't be a normal constant string in the
loadparm system, now that we have lp_set_cmdline() to handle overrides
correctly.

Andrew Bartlett
2011-06-09 12:40:09 +02:00