diff options
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/smbpasswd.c | 8 | ||||
-rw-r--r-- | source3/utils/torture.c | 10 |
2 files changed, 11 insertions, 7 deletions
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c index 8953b6d138..2ac44fbdec 100644 --- a/source3/utils/smbpasswd.c +++ b/source3/utils/smbpasswd.c @@ -639,9 +639,13 @@ int main(int argc, char **argv) smb_pwent->smb_nt_passwd = new_nt_p16; } smb_pwent->acct_ctrl &= ~ACB_DISABLED; - } else if (set_no_password) + } else if (set_no_password) { smb_pwent->acct_ctrl |= ACB_PWNOTREQ; - else { + /* This is needed to preserve ACB_PWNOTREQ in mod_smbfilepwd_entry */ + smb_pwent->smb_passwd = NULL; + smb_pwent->smb_nt_passwd = NULL; + } else { + smb_pwent->acct_ctrl &= ~ACB_PWNOTREQ; smb_pwent->smb_passwd = new_p16; smb_pwent->smb_nt_passwd = new_nt_p16; } diff --git a/source3/utils/torture.c b/source3/utils/torture.c index 2bee5f3769..3e29c5a00a 100644 --- a/source3/utils/torture.c +++ b/source3/utils/torture.c @@ -130,7 +130,7 @@ static BOOL rw_torture(struct cli_state *c, int numops) for (i=0;i<numops;i++) { - unsigned n = (unsigned)random()%10; + unsigned n = (unsigned)sys_random()%10; if (i % 10 == 0) { printf("%d\r", i); fflush(stdout); } @@ -611,7 +611,7 @@ static void run_unlinktest(void) static void rand_buf(char *buf, int len) { while (len--) { - *buf = random(); + *buf = sys_random(); buf++; } } @@ -639,8 +639,8 @@ static void run_randomipc(void) } for (i=0;i<1000;i++) { - api = random() % 500; - param_len = random() % 64; + api = sys_random() % 500; + param_len = sys_random() % 64; rand_buf(param, param_len); @@ -860,7 +860,7 @@ static void create_procs(int nprocs, int numops) for (i=0;i<nprocs;i++) { if (fork() == 0) { int mypid = getpid(); - srandom(mypid ^ time(NULL)); + sys_srandom(mypid ^ time(NULL)); run_torture(numops); _exit(0); } |