<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/source3/libnet/libnet_samsync_ldif.c, branch talloc-2.0.0</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>Remove smb_mkstemp() - libreplace will now provide a secure mkstemp() if</title>
<updated>2009-04-20T21:58:26+00:00</updated>
<author>
<name>Jelmer Vernooij</name>
<email>jelmer@samba.org</email>
</author>
<published>2009-04-20T21:58:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=4c32978d973093903a5372a6f358275184bbcab2'/>
<id>4c32978d973093903a5372a6f358275184bbcab2</id>
<content type='text'>
the system one is broken.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
the system one is broken.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix coverity CID#117 - resource leak in error path.</title>
<updated>2009-01-30T01:56:40+00:00</updated>
<author>
<name>Jeremy Allison</name>
<email>jra@samba.org</email>
</author>
<published>2009-01-30T01:56:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=a5f0640bf99e6f7e38b0b1e7a7a56f8f58ec7e47'/>
<id>a5f0640bf99e6f7e38b0b1e7a7a56f8f58ec7e47</id>
<content type='text'>
Jeremy.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Jeremy.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix coverity CID#116. Resource leak on error path.</title>
<updated>2009-01-30T01:31:12+00:00</updated>
<author>
<name>Jeremy Allison</name>
<email>jra@samba.org</email>
</author>
<published>2009-01-30T01:31:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=08802db8dbbbf842b7c006e5ff57ba1c2d0d6439'/>
<id>08802db8dbbbf842b7c006e5ff57ba1c2d0d6439</id>
<content type='text'>
Jeremy.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Jeremy.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix coverity CID#115. Resource leak in error path.</title>
<updated>2009-01-30T01:27:47+00:00</updated>
<author>
<name>Jeremy Allison</name>
<email>jra@samba.org</email>
</author>
<published>2009-01-30T01:27:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=734647bd85560ed02691d79c0a613543043d8625'/>
<id>734647bd85560ed02691d79c0a613543043d8625</id>
<content type='text'>
Jeremy.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Jeremy.
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix another "format not a string literal and no format arguments" warning.</title>
<updated>2008-12-23T17:50:10+00:00</updated>
<author>
<name>Jeremy Allison</name>
<email>jeremy@jeremy-desktop.(none)</email>
</author>
<published>2008-12-23T17:50:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=cb7d7beb99ab7952b5187c05b2660283d93e59fc'/>
<id>cb7d7beb99ab7952b5187c05b2660283d93e59fc</id>
<content type='text'>
Jeremy
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Jeremy
</pre>
</div>
</content>
</entry>
<entry>
<title>s3-libnet-samsync: pass sequence number pointer to process routine.</title>
<updated>2008-11-18T15:05:03+00:00</updated>
<author>
<name>Günther Deschner</name>
<email>gd@samba.org</email>
</author>
<published>2008-11-18T01:01:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=90513515096f0b82d3e9d1cb23df73aa26f267a8'/>
<id>90513515096f0b82d3e9d1cb23df73aa26f267a8</id>
<content type='text'>
Guenther
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Guenther
</pre>
</div>
</content>
</entry>
<entry>
<title>s3-libnet-samsync: move all modules to startup,process,finish callbacks.</title>
<updated>2008-11-18T15:04:54+00:00</updated>
<author>
<name>Günther Deschner</name>
<email>gd@samba.org</email>
</author>
<published>2008-11-17T18:34:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=8c671597550d4fde385f6ef011dfdc7b3695f9f4'/>
<id>8c671597550d4fde385f6ef011dfdc7b3695f9f4</id>
<content type='text'>
Guenther
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Guenther
</pre>
</div>
</content>
</entry>
<entry>
<title>s3-libnet-samsync: use samsync_ops.</title>
<updated>2008-11-18T15:04:39+00:00</updated>
<author>
<name>Günther Deschner</name>
<email>gd@samba.org</email>
</author>
<published>2008-11-17T15:31:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=eef8de5c887e013f5b05742a74fbb130596c62d3'/>
<id>eef8de5c887e013f5b05742a74fbb130596c62d3</id>
<content type='text'>
Guenther
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Guenther
</pre>
</div>
</content>
</entry>
<entry>
<title>s3-libnet-samsync: add samsync_ops to all samsync modules.</title>
<updated>2008-11-18T15:04:30+00:00</updated>
<author>
<name>Günther Deschner</name>
<email>gd@samba.org</email>
</author>
<published>2008-11-17T15:29:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=d10293dfdc1c2aded1305191161dbd31521557bf'/>
<id>d10293dfdc1c2aded1305191161dbd31521557bf</id>
<content type='text'>
Guenther
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Guenther
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix net rpc vampire, based on an *amazing* piece of debugging work by "Cooper S. Blake" &lt;the_analogkid@yahoo.com&gt;.</title>
<updated>2008-10-22T20:21:23+00:00</updated>
<author>
<name>Jeremy Allison</name>
<email>jra@samba.org</email>
</author>
<published>2008-10-22T20:21:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=f53578daf4f5591f47fbe0e3effc50c5bdaffd3b'/>
<id>f53578daf4f5591f47fbe0e3effc50c5bdaffd3b</id>
<content type='text'>
"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-&gt;ntpassword.hash, zero_buf, 16) != 0) {
 209                 sam_pwd_hash(r-&gt;rid, r-&gt;ntpassword.hash, lm_passwd, 0);
 210                 pdb_set_lanman_passwd(account, lm_passwd, PDB_CHANGED);
 211         }
 212
 213         if (memcmp(r-&gt;lmpassword.hash, zero_buf, 16) != 0) {
 214                 sam_pwd_hash(r-&gt;rid, r-&gt;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.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"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-&gt;ntpassword.hash, zero_buf, 16) != 0) {
 209                 sam_pwd_hash(r-&gt;rid, r-&gt;ntpassword.hash, lm_passwd, 0);
 210                 pdb_set_lanman_passwd(account, lm_passwd, PDB_CHANGED);
 211         }
 212
 213         if (memcmp(r-&gt;lmpassword.hash, zero_buf, 16) != 0) {
 214                 sam_pwd_hash(r-&gt;rid, r-&gt;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.
</pre>
</div>
</content>
</entry>
</feed>
