summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-09-25 23:40:49 +0000
committerJeremy Allison <jra@samba.org>1998-09-25 23:40:49 +0000
commit5f7ee360567a6b4e1a6f43ff01da057d2998fef8 (patch)
treeb8528e7d3bc30fc7b2ab191bc9235be604daf98e /source3/utils
parent14f9495e4c5ff98cd15bf18d7fbc63c1b491cfea (diff)
downloadsamba-5f7ee360567a6b4e1a6f43ff01da057d2998fef8.tar.gz
samba-5f7ee360567a6b4e1a6f43ff01da057d2998fef8.tar.bz2
samba-5f7ee360567a6b4e1a6f43ff01da057d2998fef8.zip
Makefile.in: Fixed bug with continuation line causing proto to fail.
Added $(PROGS) $(SPROGS) as targets for make clean. acconfig.h: Added HAVE_IRIX_SPECIFIC_CAPABILITIES. configure.in: Added sys/capability.h header check. Added function checks for srandom random srand rand. Added HAVE_IRIX_SPECIFIC_CAPABILITIES test. includes.h: Added #include <sys/capability.h>. ntdomain.h: Moved struct acct_info into here from smb.h smb.h: Added KERNEL_OPLOCK_CAPABILITY define. Moved enum action_type into rpcclient.h Moved struct cli_state into client.h Moved struct nt_client_info, struct tar_client_info, struct client_info into rpcclient.h lib/genrand.c: Changed to use sys_random() & friends. lib/smbrun.c: Lose capabilities after fork. lib/system.c: Added set_process_capability(), set_inherited_process_capability() sys_random(), sys_srandom(). lib/util.c: Added Ander's EFBIG lock check to fcntl_lock for 64 bit access to an 32 bit mounted NFS filesystem. nmbd/nmbd.c: Changed to use sys_random() & friends. nmbd/nmbd_browsesync.c: Changed to use sys_random() & friends. passdb/ldap.c: Missed one pdb_encode_acct_ctrl call. passdb/passdb.c: Changed to Ander's code for ' ' characters. passdb/smbpass.c: Added Ander's code to reset ACB_PWNOTREQ. script/mkproto.awk: Added 'long' to prototypes. smbd/chgpasswd.c: Lose capabilities after fork. smbd/open.c: Do the mmap *after* the kernel oplock. smbd/oplock.c: Removed stub code from kernel oplock path. Added set_process_capability(), set_inherited_process_capability() calls. smbd/reply.c: Initialize count = 0, offset = 0. smbd/server.c: Added set_process_capability(), set_inherited_process_capability() calls. tests/summary.c: Ensure we have RANDOM or RAND. utils/smbpasswd.c: Added Ander's code to reset ACB_PWNOTREQ. utils/torture.c: Changed to use sys_random() & friends. Jeremy. (This used to be commit e8be306f23963ac00b1a383ebe0cc1421529fb02)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/smbpasswd.c8
-rw-r--r--source3/utils/torture.c10
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);
}