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

17 Commits

Author SHA1 Message Date
Jelmer Vernooij
4c32978d97 Remove smb_mkstemp() - libreplace will now provide a secure mkstemp() if
the system one is broken.
2009-04-20 23:58:26 +02: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
Jeremy Allison
cb7d7beb99 Fix another "format not a string literal and no format arguments" warning.
Jeremy
2008-12-23 09:50:10 -08: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
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
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
Michael Adam
a0e664ebe7 libnet samsync ldif: fix the build without LDAP.
Michael
(This used to be commit 32df05bd1f)
2008-08-08 23:03:51 +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
Günther Deschner
92df9ae393 net_vampire: use bool for last_query information in samsync.
Guenther
(This used to be commit fa1976e23a)
2008-06-27 01:59:26 +02:00
Günther Deschner
6f4571bf69 net_vampire: fix included header.
Guenther
(This used to be commit 1dbe6ea860)
2008-06-23 23:38:52 +02:00
Günther Deschner
fefcb70f87 net_vampire: add error and result_message to samsync_context.
Guenther
(This used to be commit e0b1172004)
2008-06-17 19:55:16 +02:00
Günther Deschner
16eb846fa5 net_vampire: use generic output filename and use correct argv element.
Guenther
(This used to be commit e0843e631e)
2008-06-17 10:49:13 +02:00
Günther Deschner
51fec7863b net_vampire: move ldif code out of net_rpc_samsync.c
Guenther
(This used to be commit 1d5758ec3a)
2008-06-17 10:49:13 +02:00