+
+ /*
+ * We need the NT hash of the user who is changing the user's password.
+ * This NT hash is used to generate a "user session key"
+ * This "user session key" is in turn used to encrypt/decrypt the user's password.
+ */
+
+ become_root();
+ smb_pass = getsmbpwuid(user.uid);
+ unbecome_root();
+ if(smb_pass == NULL) {
+ DEBUG(0,("_samr_set_userinfo: Unable to get smbpasswd entry for uid %u\n", (unsigned int)user.uid ));
+ return NT_STATUS_ACCESS_DENIED;
+ }
+
+ memset(sess_key, '\0', 16);
+ mdfour(sess_key, smb_pass->smb_nt_passwd, 16);
+