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

1517 Commits

Author SHA1 Message Date
Volker Lendecke
63a70ba0ad Prepare control support
We will have arrays of controls passed to tldap.c. Follow a mantra from the
classic book "Thinking Forth" by Leo Brodie: Favor counts over terminators :-)

This makes the parameter lists to tldap pretty long, but everyone will have
wrapper routines anyway, see for example tldap_search_fmt. And the OpenLDAP
manpages call the non-_ext routines deprecated, probably for a reason.
2009-06-20 18:54:06 +02:00
Volker Lendecke
62eb817c06 Fix setting passwords in pdb_ads
The samba4 password_hash module does not allow changing the password fields via
the "delete oldval" -> "add newval" set of modify operations, it requires a
single "replace with newval" operation.

Andrew, Samba3 by default uses that delete/add pair to detect if between
fetching the old value and storing the new one the old value has changed. This
is lost by using the "replace" operation.

Would it make sense to add this to the password_hash module?

Volker
2009-06-20 12:15:21 +02:00
Volker Lendecke
eb8c081771 talloc_tos() aborts if it can not get a stackframe 2009-06-20 12:15:21 +02:00
Volker Lendecke
6e4c57ced5 Activate tldap tracing in pdb_ads 2009-06-12 15:04:21 +02:00
Tim Prouty
ef55c2bd91 s3 passdb ads: add missing character 2009-06-11 11:01:51 -07:00
Volker Lendecke
117c19efa4 Implement pdb_enum_alias_memberships 2009-06-11 18:04:35 +02:00
Volker Lendecke
6372bd695d Implement pdb_ads_set_aliasinfo 2009-06-10 23:57:49 +02:00
Volker Lendecke
baa47dd278 pdb_default_aliasinfo is just fine for pdb_ads right now 2009-06-10 23:57:49 +02:00
Volker Lendecke
96df53fdc7 Implement pdb_ads_lookup_rids 2009-06-10 23:08:09 +02:00
Volker Lendecke
6e9e0334ff Fix a segfault in pdb_ads_delete_user()
If a user comes from the passdb cache, priv is NULL
2009-06-10 23:08:09 +02:00
Volker Lendecke
b660e51dec If there are no mods, don't bother the ldap server 2009-06-09 22:40:36 +02:00
Volker Lendecke
078443bc67 Some more fields in pdb_ads_init_ads_from_sam() 2009-06-09 22:40:36 +02:00
Volker Lendecke
9af9a43464 Do not pull samAccountName twice 2009-06-09 21:46:30 +02:00
Volker Lendecke
0302bbda35 No need to free twice -- thanks gd :-) 2009-06-09 15:28:21 +02:00
Volker Lendecke
fa074c9916 Implement pdb_ads_[add|del]_groupmem 2009-06-09 15:25:15 +02:00
Volker Lendecke
63e6bb947a Implement pdb_ads_delete_dom_group 2009-06-09 14:49:34 +02:00
Volker Lendecke
89bd09e7f3 Implement pdb_ads_enum_group_members 2009-06-08 23:59:12 +02:00
Volker Lendecke
46b5cce1e9 Fix some nonempty blank lines 2009-06-08 23:11:14 +02:00
Volker Lendecke
094f47e7cf Fix two 64-bit warnings 2009-06-08 21:14:11 +02:00
Volker Lendecke
275ca400db Implement pdb_[add|del]aliasmem 2009-06-08 21:14:10 +02:00
Volker Lendecke
af82489b41 Do not use a variable format string 2009-06-08 21:14:10 +02:00
Volker Lendecke
7ab4d3fa43 Implement pdb_ads_enum_aliasmem 2009-06-08 21:14:10 +02:00
Volker Lendecke
a51e6ce43c Pass a talloc_ctx to pdb_enum_aliasmem 2009-06-08 21:14:10 +02:00
Volker Lendecke
5ea88420da Implement pdb_ads_delete_alias 2009-06-08 21:14:10 +02:00
Volker Lendecke
66c3cd1e92 Implement pdb_ads_create_dom_group() 2009-06-08 21:14:10 +02:00
Volker Lendecke
e2611e2b12 More pdb_ads stuff 2009-06-07 23:14:40 +02:00
Volker Lendecke
14a2974092 Make "net sam list" work for groups, aliases and builtins 2009-06-07 12:32:29 +02:00
Volker Lendecke
f3b227c0d2 Return full info in pdb_ads_search_users() 2009-06-07 12:32:25 +02:00
Günther Deschner
fbb1e990ab s3-samr: fix return code of _samr_LookupRids when run with pdb_ldap.
when _samr_LookupRids is called with no rids, it needs to return
NT_STATUS_NONE_MAPPED (not NT_STATUS_NO_MEMORY).

Found by RPC-SAMR torture test.

Guenther
2009-06-07 02:24:21 +02:00
Karolin Seeger
c94d1cd7b1 s3/passdb: Fix debug message: 'net setmaxrid' does not exist.
This is aiming bug #6351.

Karolin
2009-06-06 15:11:16 +02:00
Volker Lendecke
23b501e02a Add an early prototyp of pdb_ads.c.
The purpose of this module is to connect to a locally running samba4 ldap
server for an alternative "Franky" setup. Right now it contains a couple of
gross hacks: For example it just takes the s4-chosed RID directly as uid/gid...

Checking in tldap and pdb_ads now, I think 3777 insertions are enough for a
start...
2009-06-06 13:10:30 +02:00
Volker Lendecke
14c1362034 Fix some nonempty blank lines 2009-05-31 12:16:34 +02:00
Günther Deschner
10eec5ebc0 s3-passdb: fix uninitialized variable in local_password_change().
Guenther
2009-05-29 18:08:02 +02:00
Simo Sorce
64d1b5c4e1 Consolidate user create/delete paths in smbpasswd
This patch changes the way smbpasswd behaves when adding/deleting users.
smbpasswd now calls pdb_create_user/pdb_delete_user, this means that if
add/delete user scripts are configured then they are used to create or
delete unix users as well. If the scripts are not defined the behavioris
unchanged.
This also allow to use smbpasswd -a/-x with ldapsam:editposix to allow
automatic creation/deletion of users.

Signed-off-by: Günther Deschner <gd@samba.org>
2009-05-29 18:03:42 +02:00
Günther Deschner
bff54b90c3 util: move add_gid_to_array_unique to toplevel and add add_uid_to_array_unique.
Guenther
2009-05-29 13:49:58 +02:00
Volker Lendecke
01ea4249da TALLOC_ZERO_P->talloc_zero 2009-05-28 10:52:04 +02:00
Volker Lendecke
d07464b21f Do not segfault in pdb_search_destructor if no real search was started 2009-05-28 10:52:04 +02:00
Marc VanHeyningen
75de7c0e87 s3: zero an uninitialized array
Invalid pointers were being dereferenced in lookup_sids causing
occasional seg faults.

Signed-off-by: Tim Prouty <tprouty@samba.org>
2009-05-27 12:37:35 -07:00
Volker Lendecke
49ca690b4b Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STAT
This patch introduces

struct stat_ex {
        dev_t           st_ex_dev;
        ino_t           st_ex_ino;
        mode_t          st_ex_mode;
        nlink_t         st_ex_nlink;
        uid_t           st_ex_uid;
        gid_t           st_ex_gid;
        dev_t           st_ex_rdev;
        off_t           st_ex_size;
        struct timespec st_ex_atime;
        struct timespec st_ex_mtime;
        struct timespec st_ex_ctime;
        struct timespec st_ex_btime; /* birthtime */
        blksize_t       st_ex_blksize;
        blkcnt_t        st_ex_blocks;
};
typedef struct stat_ex SMB_STRUCT_STAT;

It is really large because due to the friendly libc headers playing macro
tricks with fields like st_ino, so I renamed them to st_ex_xxx.

Why this change? To support birthtime, we already have quite a few #ifdef's at
places where it does not really belong. With a stat struct that we control, we
can consolidate the nanosecond timestamps and the birthtime deep in the VFS
stat calls.

At this moment it is triggered by a request to support the birthtime field for
GPFS. GPFS does not extend the system level struct stat, but instead has a
separate call that gets us the additional information beyond posix. Without
being able to do that within the VFS stat calls, that support would have to be
scattered around the main smbd code.

It will very likely break all the onefs modules, but I think the changes will
be reasonably easy to do.
2009-05-26 17:48:23 +02:00
Simo Sorce
4112bb2428 Move smb_create_user() in samsync
It is not used anywhere else, so make it also static and remove
it from proto.h
2009-05-16 15:30:48 -04:00
Aravind Srinivasan
5aefb44bf0 s3: Fallback to the legacy sid_to_(uid|gid) instead of returning NULL.
This is very similar to be1dfff02d
2009-05-12 17:13:40 -07:00
Jeremy Allison
196084d641 Fix the last few format arg missmatches I missed.
Jeremy.
2009-05-12 10:38:00 -07:00
Volker Lendecke
c9efd454c5 Fix bug 6157
This patch picks the alphabetically smallest one of the multi-value attribute
"uid". This fixes a regression against 3.0 and also becomes deterministic.
2009-05-12 15:21:46 +02:00
Jeremy Allison
b4c9cfb2af Fix a bunch of compiler warnings about wrong format types.
Should make Solaris 10 builds look cleaner.
Jeremy.
2009-05-11 21:56:57 -07:00
Björn Jacke
f238809d23 s3/ldap: also handle DirX return codes 2009-05-08 00:33:30 +02:00
Günther Deschner
fee4c99be4 s3-ldap: fix more callers of smbldap_dn_talloc() that were passing a NULL context.
Guenther
2009-05-05 21:22:28 +02:00
Günther Deschner
5b37df21f6 s3-ldapsam: Fix Bug #6313: ldapsam_update_sam_account() crashes while doing talloc_free on malloced memory.
Guenther
2009-05-05 21:14:53 +02:00
Andrew Bartlett
f28f113d8e Rework Samba3 to use new libcli/auth code (partial)
This commit is mostly to cope with the removal of SamOemHash (replaced
by arcfour_crypt()) and other collisions (such as changed function
arguments compared to Samba3).

We still provide creds_hash3 until Samba3 uses the credentials code in
netlogon server

Andrew Bartlett
2009-04-14 16:23:35 +10:00
Andrew Bartlett
3b3e21bd9b Convert Samba3 to use the common lib/util/charset API
This removes calls to push_*_allocate() and pull_*_allocate(), as well
as convert_string_allocate, as they are not in the common API

To allow transition to a common charcnv in future, provide Samba4-like
strupper functions in source3/lib/charcnv.c

(the actual implementation remains distinct, but the API is now shared)

Andrew Bartlett
2009-04-14 12:53:56 +10:00
Andrew Bartlett
9512640155 s3:smbldap Remove smbldap_get_dn
This removes one more caller to pull_utf8_allocate()

Signed-off-by: Günther Deschner <gd@samba.org>
2009-04-06 14:52:51 +02:00
Jeremy Allison
c57b32c5ab Allow pdbedit to change a user rid/sid. Based on a fix from Alexander Zagrebin <alexz@visp.ru>.
Jeremy.
2009-04-01 20:21:02 -07:00
Günther Deschner
d0e1ff4aff s3-passdb: add smb_create_user().
Guenther
2009-04-01 19:12:19 +02:00
Michael Adam
6edaf6188c s3: fix the fix for bug #6195 - dont let smbd child processes panic
This patch makes sure the original and temporary TDBs are closed
_before_ the rename. Originally, the open TDB was renamed, and so
the name passdb.tdb.tmp stayed around in the db context. Hence
upon client connect, the smbd children died because reinit_after_fork()
calling tdb_reopen_all() would try to reopen passdb.tdb.tmp which
existed no longer...

Michael
2009-04-01 12:26:36 +02:00
Jeremy Allison
0b890ae19a Fix the problem of 3.0.x passdb databases being version
3 but using a different hash calculation than 3.2.x passwd
databases (also version 3). Introduces a minor version
number.
Jeremy.
2009-03-27 21:29:37 -07:00
Jeremy Allison
d942d248d6 Fix bug #6195 - Migrating from 3.0.x to 3.3.x can fail to update passdb.tdb correctly. For the clustering case.
Clustered setups should have only ever used
the unsigned version of TDB_DATA in the
first place so they can't be in this mess :-).
Just do the normal upgrade in the clustered case.
Jeremy.
2009-03-27 12:13:13 -07:00
Volker Lendecke
f91565544f Fix bug 6097
A client sent a SID with authority 0 and 0 sub-authorities. W2k3 replies with
NT_STATUS_INVALID_SID, even if other SIDs in the list are valid.

Thanks to Pavel <wylda@volny.cz> for the bug report!
2009-03-24 11:59:42 +01:00
Jeremy Allison
f942cb616e Fix bug #6195 - Migrating from 3.0.x to 3.3.x can fail to update passdb.tdb correctly.
This is a really nasty one to fix as in order to successfully update the
passdb.tdb we must do the equivalent of a tdbbackup to move to the new hash
values before we do the upgrade.
Jeremy.
2009-03-18 15:44:13 -07:00
Alexander Zagrebin
b4ae0e8d84 Missing break in conversion function prevents tdb password database update. 2009-03-17 15:38:33 -07:00
Dan Sledz
b6616ca8dc s3 pdb_wbc_sam: LookupRids should return sAMAccountName, not NT4 names
Also fix an incorrect TALLOC_FREE
2009-03-12 13:00:47 -07:00
Volker Lendecke
46bcb10b5a Shape up pdb_search a bit by making it a talloc ctx with a destructor 2009-03-07 17:51:21 +01:00
Tim Prouty
ef89c4bc0d s3 passdb: Add back some useful debug statements
Originally removed in be1dfff02d
2009-03-03 16:49:36 -08:00
Dan Sledz
be1dfff02d It appears that the first time we see a uid/gid that winbind can't map,
we end up returning the null sid instead of falling back to the legacy
code.  Next time through the code we'll hit the negative cache and do
the right thing, but we still fail the first time.

If we fail the winbind id to sid mapping, call the legacy version.  This
catches the case where we don't have a negative cache entry for the mapping.
This is better than returning the NULL sid to the caller.
2009-03-02 16:50:19 -08:00
Volker Lendecke
06b018767b Fix an incompatible pointer passed to winbind_get_groups
This is the same bug that was fixed in other places of the code a few times
already:

A C compiler ONLY does automatic type conversions during an assignment.

Passing down a pointer to type A to a function taking type B as an
argument does NOT do any automatic type conversions.

If required, I can dig up the relevant portions of the C standard.
2009-02-25 13:04:19 +01:00
Dan Sledz
aeab22b55c s3: Rename auth_onefs_wb and pdb_onefs_sam
auth_onefs_wb.c -> auth_wbc.c
pdb_onefs_sam.c -> pdb_wbc_sam.c

No changes to functionality
2009-02-24 16:08:06 -08:00
Volker Lendecke
e9467ff26e Fix a typo 2009-02-21 12:54:34 +01:00
Dan Sledz
fc02c3b089 Introduce a new passdb backend: pdb_onefs_sam
Implements a custom backend for onefs that exclusively uses the wbclient
interface for all passdb calls.
It lacks some features of a standard passdb.
In particular it's a read only interface and doesn't implement privileges.
2009-02-20 19:39:07 -08:00
Jeremy Allison
669f2a02e2 Fix printf warnings found on systems where time_t <> long int.
Jeremy.
2009-02-19 13:36:20 -08:00
Jeremy Allison
fab0baeed1 Fix bug #6117 - Samba 3.3.0: pdbedit -a core dumps.
Jeremy.
2009-02-17 13:43:58 -08:00
Steven Danneman
5cd4b7b7c0 s3: Added new parameter "map untrusted to domain"
When enabled this reverts smbd to the legacy domain remapping behavior when
a user provides an untrusted domain

This partially reverts d8c54fdd
2009-02-12 13:55:44 -08:00
Dan Sledz
d8c54fddda s3: Change behavior when seeing an unknown domain.
After a lot of testing against various Windows servers (W2K, W2K3, W2K8),
within an AD domain it seems that unknown domains will only be translated
to the local account domain, not the netbios name of the member server's
domain.  This makes samba act more like Windows.
2009-02-11 19:39:18 -08:00
Volker Lendecke
b1677505a5 Fix some nonempty blank lines 2009-02-08 13:53:49 +01:00
Volker Lendecke
dba6624dca Fix nonempty blank lines 2009-02-01 14:34:22 +01:00
todd stecher
989ad44d32 Memory leaks and other fixes found by Coverity 2009-01-21 17:13:03 -08:00
Michael Adam
62e7849ddc s3:passdb: put login_cache.tdb into cache_dir, not lock_dir.
Michael
2009-01-16 01:02:22 +01:00
Jeremy Allison
b3e6247a9e Fix bug #6035 - Possible race between fcntl F_SETLKW and alarm delivery.
Jeremy.
2009-01-14 13:17:38 -08:00
Jelmer Vernooij
08259c1c52 Add iconv_convenience argument to size functions. 2009-01-01 04:45:33 +01:00
Stefan Metzmacher
7516ba860c s3:pdb_tdb: store the next rid counter in passdb.tdb instead of winbind_idmap.tdb
This upgrades the TDBSAM_VERSION to 4 and SAMU_BUFFER_V4.

metze
2008-12-29 21:10:49 +01:00
Stefan Metzmacher
671469ae7e s3:passdb: add SAMU_BUFFER_V4 with no changes
The upgrade is required because of the followin TDBSAM_VERSION
upgrade.

metze
2008-12-29 21:10:49 +01:00
Stefan Metzmacher
0544734309 s3:passdb: make marshalling struct samu from and to a buffer more generic
This marshalling isn't specific to tdbsam and it's
ugly to have the related functions in two different files.

metze
2008-12-29 21:10:49 +01:00
Jeremy Allison
94df767f21 More asprintf warning fixes.
Jeremy.
2008-12-23 11:45:26 -08:00
Jeremy Allison
aa4abac6b7 Fix more ‘asprintf’, declared with attribute warn_unused_result.
Jeremy.
2008-12-23 10:42:25 -08:00
Jeremy Allison
7fd114bab7 Fix more "warning: ignoring return value of ‘asprintf’, declared with
attribute warn_unused_result"
Jeremy.
2008-12-23 10:27:24 -08:00
Günther Deschner
9203954428 s3-ldapsam: Fix Bug 5957: do not abort rename process on valid rename script.
Guenther
(cherry picked from commit 26139344fd)
(cherry picked from commit 866efa63a2)
2008-12-09 17:41:26 +01:00
Volker Lendecke
3c98d5bd98 Make memcache_add_talloc NULL out the source pointer
This is an orthogonality measure to make clear this pointer now belongs to the
cache.
(cherry picked from commit e6080c6e87d6fe3995b121a772bf3f6343fa666f)
2008-11-14 20:27:46 +01:00
Jeremy Allison
8962be69c7 Make us clean under valgrind --leak-check=full by using talloc_autofree_context() instead of NULL.
Remove the code in memcache that does a TALLOC_FREE on stored pointers. That's a disaster waiting
to happen. If you're storing talloc'ed pointers, you can't know their lifecycle and they should
be deleted when their parent context is deleted, so freeing them at some arbitrary point later
will be a double-free.
Jeremy.
2008-11-06 20:48:13 -08:00
Jeremy Allison
0db0ce4974 Fix bug #5825 - Account locking out doesnt work with an LDAP backend.Based on a problem found by Boyang. Only the pdb_nds backend implements login attempts so this was broken for tdbsam and ldap.
Jeremy.
2008-11-06 06:42:04 -08:00
Günther Deschner
992c03a192 s4-lsa: merge lsa_LookupSids/{2,3} from s3 lsa idl.
Guenther
2008-10-27 19:33:23 +01:00
Jelmer Vernooij
81fabeff2d Use libutil genrand. 2008-10-23 18:46:35 +02:00
Jelmer Vernooij
e16e6e9cb0 Use standard types. 2008-10-22 03:41:24 +02:00
Jelmer Vernooij
389cfee579 Use GUID_random. 2008-10-14 02:41:20 +02:00
Jelmer Vernooij
1b99d8fbb5 Use common util_file code. 2008-10-12 17:34:43 +02:00
Volker Lendecke
f3ba7fc0b9 Store a local schannel key in secrets.tdb 2008-10-06 09:54:16 +02:00
Simo Sorce
3fa16da8c7 Revert "Split lookup_name() and create a new functiong called"
This reverts commit 8594edf666.
(This used to be commit ad462e2e2d)
2008-09-03 14:36:43 -04:00
Simo Sorce
c5894e1477 Merge branch 'v3-devel' of ssh://git.samba.org/data/git/samba into v3-devel
(This used to be commit 8e4dca3b94)
2008-09-03 11:52:54 -04:00
Jeremy Allison
dc3f6b0861 Fix bug spotted by Simo - don't use legacy if expired entry.
Jeremy.
(This used to be commit a7bbd33139)
2008-08-26 18:05:34 -07:00
Jeremy Allison
d1f140a9ba Don't ask winbindd if we got a -ve cache entry.
Jeremy.
(This used to be commit 91f85d0dca)
2008-08-26 16:14:25 -07:00
Simo Sorce
a1de4e988d Merge branch 'v3-devel' of ssh://git.samba.org/data/git/samba into v3-devel
(This used to be commit e038f1cf9f)
2008-08-26 18:56:49 -04:00
Jeremy Allison
95cc5ee395 Fix the build :-(. Ask winbindd if we find a negative cache entry (or should
we just call the legacy function ?).
Jeremy.
(This used to be commit 566d3b6e76)
2008-08-26 15:51:56 -07:00
Jeremy Allison
d2f223d83d Get smbd to look (read-only) into the winbindd cache for uid/gid <--> sid mappings.
Jeremy.
(This used to be commit 31ba955d69)
2008-08-26 14:52:11 -07:00
Simo Sorce
5e7655fa27 Split lookup_name() and create a new functiong called
lookup_domain_name(). This new function accept separated
strings for domain and name.
(This used to be commit 8594edf666)
2008-08-17 19:54:41 -04:00
Andrew Tridgell
fe3dd9b3e6 fixed lots of places that paniced on a failed transaction_commit,
thinking it was a failure of a transaction cancel
(This used to be commit 22dbe158ed)
2008-08-13 11:54:10 +02:00
Andrew Tridgell
0f41961e4f first cut at adding full transactions for ctdb to samba3
(This used to be commit f91a3e0f7b)
2008-08-13 11:54:08 +02:00
Karolin Seeger
669afbc291 pdb_interface: Fix typo in debug message.
Karolin
(This used to be commit e04da654c0)
2008-07-29 12:05:40 +02:00
Jeremy Allison
61859a18f0 Add casts to uint32_t to match prototype for sid_append_rid().
Jeremy.
(This used to be commit 1500401967)
2008-07-24 12:01:46 -07:00
Jeremy Allison
a4932d6657 Use sys_getgrnam not getgrnam. Pointed out by Herb.
Jeremy.
(This used to be commit 43eec65170)
2008-07-24 11:56:49 -07:00
John H Terpstra
b39237d3b3 pdb_ldap: Raise level for debug message to avoid log file flooding.
(This used to be commit 9b863a10da)
2008-07-24 09:49:28 +02:00
Karolin Seeger
490b60b500 Use LDAP macros instead of attribute names.
Karolin
(This used to be commit 7dae8b04f1)
2008-07-18 15:36:20 +02:00
Karolin Seeger
df15541926 Fix typo.
retieve -> retrieve

Karolin
(This used to be commit 37c6413070)
2008-07-14 16:40:36 +02:00
Volker Lendecke
e613ecbea5 Revert "Make use of sid_check_is_in_unix_users/groups"
This reverts commit cd8e63b2b4.
(This used to be commit 061e55d4f4)
2008-07-11 17:53:25 +02:00
Volker Lendecke
68071e94a5 Revert "Don't scream, better explain a bit in comments"
This reverts commit dcc39ed004.
(This used to be commit 26ca09a357)
2008-07-11 17:53:25 +02:00
Volker Lendecke
d803fa6e46 Revert "Remove an unused variable"
This reverts commit 454cb852e0.
(This used to be commit cae8ec3199)
2008-07-11 17:53:25 +02:00
Volker Lendecke
90f3da4720 Fix some memleaks regarding trustdom passwords
(This used to be commit 3d2913d599)
2008-07-10 18:25:00 +02:00
Volker Lendecke
ad91d960d0 Fix some uninitialized variable references via ndr_print
(This used to be commit 26fb3fea81)
2008-07-10 18:24:54 +02:00
Volker Lendecke
516e381e09 Give a nice error message if trying to join with a non-privileged user
(This used to be commit 347772fc39)
2008-07-10 10:48:15 +02:00
Volker Lendecke
b611fd9550 Remove an unused variable
(This used to be commit 454cb852e0)
2008-07-03 16:44:13 +02:00
Volker Lendecke
d1635687ae Don't scream, better explain a bit in comments
(This used to be commit dcc39ed004)
2008-07-03 11:08:51 +02:00
Volker Lendecke
abb42b267b Make use of sid_check_is_in_unix_users/groups
Don't replicate code unnecessarily
(This used to be commit cd8e63b2b4)
2008-07-03 11:08:51 +02:00
Volker Lendecke
0e7d1aae2f Fix a memleak in secrets_fetch_afs_key
Coverity ID 570
(This used to be commit 0f52dc3f7e)
2008-06-07 08:51:35 +02:00
Volker Lendecke
8c98f5af6f Fix a memleak in secrets_fetch_trust_account_password_legacy
Coverity ID 571
(This used to be commit a551773e34)
2008-06-07 08:50:02 +02:00
Volker Lendecke
32452565be Fix a memleak in fetch_ldap_pw
Fix Coverity ID 572, also fix the error check for secrets_fetch failing
(This used to be commit 2663c81a78)
2008-06-07 08:48:13 +02:00
Michael Adam
6cebad5b67 Remove unused function is_trusted_domain_situation().
This combined check has been replaced by is_dc_trusted_domain_situation()
which does not check for lp_allow_trusted_domains().

Michael
(This used to be commit 0a24c038b7)
2008-05-26 16:42:25 +02:00
Michael Adam
6efce4738f passdb: check for is_dc_trusted_domain_situation() in get_trust_pw_hash().
Before fetching legacy password hash, check for trusted domain situation,
but also fail if trusted domain support is not enabled.

Michael
(This used to be commit aa1b8287f4)
2008-05-26 16:42:24 +02:00
Michael Adam
48026d814b passdb: add comment explaining logic in get_trust_pw_clear().
Michael
(This used to be commit 5f197c659e)
2008-05-26 16:42:24 +02:00
Michael Adam
a186e598c4 passdb: in get_trust_pw_clear() correctly fail if trusted domains not supported
(but trusted domain situation was found)

This completes the fix for bugs #5425 and #5451 by Steven Dannemann,
in that now no special cases are left uncovered.

Michael
(This used to be commit 0b26bcd3be)
2008-05-26 16:42:24 +02:00
Michael Adam
4de01a909a Add function is_dc_trusted_domain_situation().
This is like is_trusted_domain_situation() except that it does not
check for lp_allow_trusted_domains().

Michael
(This used to be commit a284c88435)
2008-05-26 16:42:24 +02:00
Gerald W. Carter
b72fc49f44 Manually port Steven Dannenman fix for using the correct machine domain when
looking up trust credentials in our tdb.

   commit fd0ae47046
   Author: Steven Danneman <sdanneman@isilon.com>
   Date:   Thu May 8 13:34:49 2008 -0700

      Use machine account and machine password from our domain when
      contacting trusted domains.
(This used to be commit 69b37ae607)
2008-05-23 15:19:58 -05:00
Tim Prouty
fb37f15600 Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 6b189dabc5)
2008-05-20 22:40:13 +02:00
Volker Lendecke
3643aa9a63 Fix a panic in the [ug]id2sid valgrind bug fix
Always, always run "make test" before pushing stuff :-)
(This used to be commit 1444db8be1)
2008-05-06 13:56:21 +02:00
Volker Lendecke
1fe90d8d04 Fix a valgrind bug in the new [ug]id2sid cache
When we're given a SID, it is not always padded with zeros. Only look at the
initialized parts in the SID.
(This used to be commit 8717085dba)
2008-05-06 12:16:02 +02:00
Volker Lendecke
2b3d03d6f1 Remove unix_homedir from struct user_struct
This makes pdb_get_unix_homedir unused. I wonder if that was ever really used...
(This used to be commit 36bfd32f1f)
2008-05-05 18:28:58 +02:00
Stefan Metzmacher
625f2d6c23 pdb_tdb: fix the upgrade code, db_traverse returns the number of records!
metze
(This used to be commit baaf571d54)
2008-04-15 00:25:11 +02:00
Volker Lendecke
16198dc51e Convert dbwrap_trans_delete to NTSTATUS
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit dead193f46)
2008-04-01 14:04:22 +02:00
Volker Lendecke
fcdfff1cc8 Convert dbwrap_trans_store to NTSTATUS
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit 5f4de856af)
2008-04-01 14:04:22 +02:00
Stefan Metzmacher
8957f6b0cf pdb_tdb: use != 0 instead off == -1 for dbwrap functions
metze
(This used to be commit d4826a0136)
2008-04-01 14:04:20 +02:00
Stefan Metzmacher
663eb087e6 passdb: guard pdb_generate_sam_sid() with a transaction
This prevents possible races with some dbwrap backends

metze
(This used to be commit 9322442510)
2008-04-01 14:04:20 +02:00
Stefan Metzmacher
a5f3911d70 passdb/secrets: add secrets_db_ctx() to get the db_context
metze
(This used to be commit 986bc7e8b2)
2008-04-01 14:04:20 +02:00
Stefan Metzmacher
dbd2e3860d pdb_tdb: use db_open_trans()
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit 9925cc01a2)
2008-03-27 18:14:57 +01:00
Stefan Metzmacher
7d413b8bee pdb_tdb: use db_sam->transaction_start(db_sam) != 0 consistent
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit 3bf9ab640e)
2008-03-27 18:14:57 +01:00
Stefan Metzmacher
4b2ce410a5 passdb/secrets: use db_open_trans()
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit b61b8ca494)
2008-03-27 18:14:57 +01:00
Stefan Metzmacher
3b0592bc15 passdb/secrets: it's enough to use traverse_read() in secrets_trusted_domains()
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
(This used to be commit 729f7b9ff3)
2008-03-27 18:14:56 +01:00
Marc VanHeyningen
e06aa46b9f Coverity fixes
(This used to be commit 3fc85d2259)
2008-03-17 20:52:25 +01:00
Volker Lendecke
88ee949777 Convert pdb_tdb to use dbwrap
(This used to be commit 948ab77863)
2008-03-17 11:51:50 +01:00
Volker Lendecke
f3856d074f Fix bug 4901
(This used to be commit 1dd8fa9a52)
2008-03-14 18:01:23 +01:00
Volker Lendecke
28244425b2 Convert secrets.c to use dbwrap
(This used to be commit 9d30e5991c)
2008-03-11 17:09:19 +01:00
Volker Lendecke
1ebfc66b2c Use a separate tdb for mutexes
Another preparation to convert secrets.c to dbwrap: The dbwrap API does not
provide a sane tdb_lock_with_timeout abstraction. In the clustered case the DC
mutex is needed per-node anyway, so it is perfectly fine to use a local mutex
only.
(This used to be commit f94a63cd8f)
2008-03-10 21:08:45 +01:00
Volker Lendecke
d634ab06b3 Convert secrets_lock_trust_account_password to talloc
This is preparing the conversion of secrets.c to ctdb
(This used to be commit 1307f0130c)
2008-03-10 21:08:45 +01:00
Volker Lendecke
b175ffa702 Make use of talloc_asprintf_strupper_m in secrets.c
(This used to be commit 3ac4f935c0)
2008-03-10 09:52:08 +01:00
Volker Lendecke
2e8d375346 Avoid some pointless checks
secrets_init() makes sure that the tdb is initialized
(This used to be commit 8725dbc888)
2008-03-10 09:51:58 +01:00
Volker Lendecke
c2cd0e3c54 Use talloc_tos() in secrets_init
(This used to be commit 27065382d9)
2008-03-10 09:51:51 +01:00
Volker Lendecke
9d7cad7e82 Fix a memleak -- Coverity ID 222
(cherry picked from commit a40781bafa3a8f0c7737164bca6cf74b0a452e72)
(This used to be commit 86cabcad74)
2008-03-05 18:44:26 +01:00