/* Make slave stdin/out/err of child. */
- if (sys_dup2(slave, STDIN_FILENO) != STDIN_FILENO)
+ if (dup2(slave, STDIN_FILENO) != STDIN_FILENO)
{
DEBUG(3, ("Could not re-direct stdin\n"));
return (False);
}
- if (sys_dup2(slave, STDOUT_FILENO) != STDOUT_FILENO)
+ if (dup2(slave, STDOUT_FILENO) != STDOUT_FILENO)
{
DEBUG(3, ("Could not re-direct stdout\n"));
return (False);
}
- if (sys_dup2(slave, STDERR_FILENO) != STDERR_FILENO)
+ if (dup2(slave, STDERR_FILENO) != STDERR_FILENO)
{
DEBUG(3, ("Could not re-direct stderr\n"));
return (False);
bool change_lanman_password(struct samu *sampass, uchar *pass2)
{
- static uchar null_pw[16];
+ uchar null_pw[16];
uchar unenc_new_pw[16];
bool ret;
uint32 acct_ctrl;
if (pwd == NULL) {
if (acct_ctrl & ACB_PWNOTREQ) {
uchar no_pw[14];
- memset(no_pw, '\0', 14);
+
+ ZERO_STRUCT(no_pw);
+
E_P16(no_pw, null_pw);
- /* Get the new lanman hash. */
- D_P16(null_pw, pass2, unenc_new_pw);
+ pwd = null_pw;
} else {
DEBUG(0,("change_lanman_password: no lanman password !\n"));
return False;
}
- } else {
- /* Get the new lanman hash. */
- D_P16(pwd, pass2, unenc_new_pw);
}
+ /* Get the new lanman hash. */
+ D_P16(pwd, pass2, unenc_new_pw);
+
if (!pdb_set_lanman_passwd(sampass, unenc_new_pw, PDB_CHANGED)) {
return False;
}
struct samu **hnd,
char **pp_new_passwd)
{
- static uchar null_pw[16];
- static uchar null_ntpw[16];
+ uchar null_pw[16];
+ uchar null_ntpw[16];
struct samu *sampass = NULL;
uint8 *password_encrypted;
const uint8 *encryption_key;
if ((can_change_time != 0) && (time(NULL) < can_change_time)) {
DEBUG(1, ("user %s cannot change password now, must "
"wait until %s\n", username,
- http_timestring(can_change_time)));
+ http_timestring(talloc_tos(), can_change_time)));
if (samr_reject_reason) {
*samr_reject_reason = SAMR_REJECT_OTHER;
}