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

390 Commits

Author SHA1 Message Date
Andrew Bartlett
2050187673 s3:libads Make ads_get_dn() take a talloc context
Also remove ads_memfree(), which was only ever a wrapper around
SAFE_FREE, used only to free the DN from ads_get_ds().

This actually makes libgpo more consistant, as it mixed a talloc and a
malloc based string on the same element.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2009-04-06 15:54:41 +02:00
Günther Deschner
5cdf75e679 s3-libnet-samsync: return appropriate error code in fetch_sam_entry().
Guenther
2009-04-01 19:12:19 +02:00
Günther Deschner
e18f57fd36 s3-libnet-samsync: use smb_create_user().
Guenther
2009-04-01 19:12:19 +02:00
Günther Deschner
e4802bfcad s3-libnet-samsync: some pure cosmetics.
Guenther
2009-04-01 19:12:19 +02:00
Günther Deschner
af78240cbe s3-libnet-samsync: use parent talloc context for libnet_samsync_passdb.
Guenther
2009-04-01 19:12:18 +02:00
Günther Deschner
264b28ec09 s3-libnet: only call libnet_dssync_process() startup and shutdown callbacks when filled in.
Guenther
2009-04-01 16:58:48 +02:00
Günther Deschner
e3f7057b09 s3-libnet: Fix Bug #6193: avoid messing with sync_context in libnet_samsync_delta().
We absolutely need to avoid messing with the sync_context as that breaks the
stream of replication data coming from the DC (only replicates ~350 instead of
~4000 groups).

Guenther
2009-03-25 16:09:13 +01:00
Günther Deschner
531af136f9 s3: remove POLICY_HND.
Guenther
2009-03-18 23:22:29 +01:00
Michael Adam
6c197ffa30 s3: move definition of W_ERROR_NOT_OK_GOTO_DONE down to libcli/util/werror.h
Michael
2009-02-26 13:22:54 +01:00
Günther Deschner
e9d5405948 s3-libnet: fix coverity #848 (UNINIT).
Guenther
2009-02-19 13:01:59 +01:00
Volker Lendecke
fda8abac17 s3: Fix 'net rpc join' for users with the SeMachineAccountPrivilege. 2009-02-03 14:44:30 +01:00
Dan Sledz
d96248a9b4 Add two new parameters to control how we verify kerberos tickets. Removes lp_use_kerberos_keytab parameter.
The first is "kerberos method" and replaces the "use kerberos keytab"
with an enum.  Valid options are:
secrets only - use only the secrets for ticket verification (default)
system keytab - use only the system keytab for ticket verification
dedicated keytab - use a dedicated keytab for ticket verification.
secrets and keytab - use the secrets.tdb first, then the system keytab

For existing installs:
"use kerberos keytab = yes" corresponds to secrets and keytab
"use kerberos keytab = no" corresponds to secrets only

The major difference between "system keytab" and "dedicated keytab" is
that the latter method relies on kerberos to find the correct keytab
entry instead of filtering based on expected principals.

The second parameter is "dedicated keytab file", which is the keytab
to use when in "dedicated keytab" mode.  This keytab is only used in
ads_verify_ticket.
2009-02-01 20:23:31 -08:00
Jeremy Allison
a5f0640bf9 Fix coverity CID#117 - resource leak in error path.
Jeremy.
2009-01-29 17:56:40 -08:00
Jeremy Allison
08802db8db Fix coverity CID#116. Resource leak on error path.
Jeremy.
2009-01-29 17:31:12 -08:00
Jeremy Allison
734647bd85 Fix coverity CID#115. Resource leak in error path.
Jeremy.
2009-01-29 17:27:47 -08:00
Michael Adam
39ec8791f8 s3: make better use of ccache by not including version.h in every C-file.
version.h changes rather frequently. Since it is included via includes.h,
this means each C file will be a cache miss. This applies to the following
situations:

* When building a new package with a new Samba version

* building in a git branch after calling mkversion.sh
  after a new commit (i.e. virtually always)

This patch improves the situation in the following way:

* remove inlude "version.h" from includes.h

* Use samba_version_string() instead of SAMBA_VERSION_STRING
  in files that use no other macro from version.h instead of
  SAMBA_VERSION_STRING.

* explicitly include "version.h" in those files that use more
  macros from "version.h" than just SAMBA_VERSION_STRING.

Michael
2009-01-15 22:56:01 +01:00
Günther Deschner
46f55ef5bc s3-samr: avoid all init_samr_user* functions.
Guenther
2009-01-06 16:02:10 +01:00
Jeremy Allison
cb7d7beb99 Fix another "format not a string literal and no format arguments" warning.
Jeremy
2008-12-23 09:50:10 -08:00
Jeremy Allison
aaea68791c In gcc version 4.3.2 we get warnings for functions declared with
attribute warn_unused_result. Start to fix these.
Jeremy.
2008-12-22 20:08:14 -08:00
Stefan Metzmacher
2bb91392b4 s3:libnet_join: use DS_FORCE_REDISCOVERY
metze
2008-12-13 11:42:37 +01:00
Stefan Metzmacher
6a993cb333 s3:libnet_join: call saf_join_store() after a the join.
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
(similar to commit feef594d27)
2008-12-13 11:42:37 +01:00
Günther Deschner
138283c7c1 s3-libnet: fix DEBUG statement in libnet_keytab.
Guenther
2008-12-11 15:21:54 +01:00
Günther Deschner
c8b0196c95 s3-libnet: fix build warning (missing prototype).
Guenther
2008-12-09 15:07:47 +01:00
Günther Deschner
28099876f9 s3-libnetjoin: Fix bug #5749. Re-set acctflags while joining. fix from metze.
Guenther
2008-11-29 00:16:56 +01:00
Günther Deschner
42adfd1be2 s3-libnetjoin: remove unused md4_trust_password, found by metze.
Guenther
2008-11-29 00:16:46 +01:00
Günther Deschner
4d7485df96 s3-samr: fix init_samr_user_info{23,24} callers.
Guenther
2008-11-28 13:55:38 +01:00
Günther Deschner
98e1dd64ab s3-libnetjoin: fix build warning.
Guenther
2008-11-21 15:57:14 +01:00
Günther Deschner
35ac6236bd s3-libnetjoin: try to show a better error message upon invalid configuration.
Guenther
2008-11-21 14:49:53 +01:00
Günther Deschner
6ef719bf92 s3-libnet-samsync: store samsync sequence number state in keytab.
Guenther
2008-11-18 16:05:37 +01:00
Günther Deschner
b8769141e6 s3-libnet-samsync: refactor libnet_samsync.
Guenther
2008-11-18 16:05:29 +01:00
Günther Deschner
a079c500a6 s3-libnet-samsync: pass back sequence number from fetch_sam_entries_keytab.
Guenther
2008-11-18 16:05:20 +01:00
Günther Deschner
6aaf220f9e s3-libnet-samsync: use netr_DatabaseDeltas unless full replication enforced.
Guenther
2008-11-18 16:05:10 +01:00
Günther Deschner
9051351509 s3-libnet-samsync: pass sequence number pointer to process routine.
Guenther
2008-11-18 16:05:03 +01:00
Günther Deschner
8c67159755 s3-libnet-samsync: move all modules to startup,process,finish callbacks.
Guenther
2008-11-18 16:04:54 +01:00
Günther Deschner
677921b9a3 s3-libnet-samsync: call init and close ops function where appropriate.
Guenther
2008-11-18 16:04:46 +01:00
Günther Deschner
eef8de5c88 s3-libnet-samsync: use samsync_ops.
Guenther
2008-11-18 16:04:39 +01:00
Günther Deschner
d10293dfdc s3-libnet-samsync: add samsync_ops to all samsync modules.
Guenther
2008-11-18 16:04:30 +01:00
Günther Deschner
10572d1bf4 s3-libnet-samsync: add samsync_ops.
Guenther
2008-11-18 16:04:21 +01:00
Günther Deschner
0861a7122e s3-libnet: move add_to_keytab_entries to libnet_keytab.
Guenther
2008-11-18 16:03:49 +01:00
Günther Deschner
1a48107cc4 s3-libnet-samsync: add support for partial replication.
Guenther
2008-11-18 15:59:24 +01:00
Günther Deschner
a48abdaa81 s3-libnet-samsync: use enctype 23 for vampired keytab entries.
Guenther
2008-11-17 19:58:30 +01:00
Günther Deschner
fdc28cf8a5 s3-netlogon: fix type of parameters string in user delta.
Guenther
2008-11-10 21:46:25 +01:00
Günther Deschner
3fa7a1b085 s3-libnet_samsync: print new line in display output.
Guenther
2008-11-04 19:55:07 +01:00
Jeremy Allison
f53578daf4 Fix net rpc vampire, based on an *amazing* piece of debugging work by "Cooper S. Blake" <the_analogkid@yahoo.com>.
"I believe I have found two bugs in the 3.2 code and one bug that
carried on to the 3.3 branch.  In the 3.2 code, everything is
located in the utils/net_rpc_samsync.c file.  What I believe is the
first problem is that fetch_database() is calling
samsync_fix_delta_array() with rid_crypt set to true, which means
the password hashes are unencrypted from the RID encryption.
However, I believe this call is redundant, and the corresponding
call for samdump has rid_crypt set to false.  So I think the
rid_crypt param should be false in fetch_database().

If you follow the code, it makes its way to sam_account_from_delta()
where the password hashes are decrypted a second time by calling
sam_pwd_hash().  I believe this is what is scrambling my passwords.

These methods were refactored somewhere in the 3.3 branch.  Now the
net_rpc_samsync.c class calls rpc_vampire_internals, which calls
libnet/libnet_samsync.c, which calls samsync_fix_delta_array() with
rid_crypt always set to false.  I think that's correct.  But the
second bug has carried through in the sam_account_from_delta()
function:

 208         if (memcmp(r->ntpassword.hash, zero_buf, 16) != 0) {
 209                 sam_pwd_hash(r->rid, r->ntpassword.hash, lm_passwd, 0);
 210                 pdb_set_lanman_passwd(account, lm_passwd, PDB_CHANGED);
 211         }
 212
 213         if (memcmp(r->lmpassword.hash, zero_buf, 16) != 0) {
 214                 sam_pwd_hash(r->rid, r->lmpassword.hash, nt_passwd, 0);
 215                 pdb_set_nt_passwd(account, nt_passwd, PDB_CHANGED);

If you look closely you'll see that the nt hash is going into the
lm_passwd variable and the decrypted value is being set in the lanman
hash, and the lanman hash is being decrypted and put into the nt hash
field.  So the LanMan and NT hashes look like they're being put in
the opposite fields."

Fix this by removing the rid_crypt parameter.
Jeremy.
2008-10-22 13:21:23 -07:00
Jelmer Vernooij
7275952568 Add TALLOC_CTX pointer to generate_random_str(), for consistency with
Samba 4.
2008-10-19 10:05:48 +02:00
Günther Deschner
6503ffaa04 s3: fix s3 drsuapi callers.
Guenther
2008-10-17 10:54:01 +02:00
Günther Deschner
f0dcc1fad4 s4-build: fix drsuapi callers.
Guenther
2008-10-16 14:03:10 +02:00
Volker Lendecke
f4095b62a8 If name_to_fqdn fails, retry with the dns domain the DC gave us
This is a workaround for the cases where you want to join under a netbios name
that is different from your hostname, i.e. a name that can not be found in
/etc/hosts or dns. In these cases, name_to_fqdn fails or gives invalid results.
2008-10-06 15:23:39 +02:00
Volker Lendecke
0e0371b78a "gwen/cc" does not like the double const :-) 2008-10-04 21:52:11 +02:00
Günther Deschner
022947097f s3-ndr: add stub smb_iconv_convenience to some ndr_ functions.
Guenther
2008-09-23 23:35:14 +02:00