summaryrefslogtreecommitdiffstats
path: root/source/lib/genrand.c
Commit message (Collapse)AuthorAgeFilesLines
* BIG patch...Andrew Bartlett2003-01-021-1/+1
| | | | | | | | | | | | | | | | This patch makes Samba compile cleanly with -Wwrite-strings. - That is, all string literals are marked as 'const'. These strings are always read only, this just marks them as such for passing to other functions. What is most supprising is that I didn't need to change more than a few lines of code (all in 'net', which got a small cleanup of net.h and extern variables). The rest is just adding a lot of 'const'. As far as I can tell, I have not added any new warnings - apart from making all of tdbutil.c's function const (so they warn for adding that const string to struct). Andrew Bartlett
* good security patch from Timothy.Sell@unisys.comAndrew Tridgell2002-07-281-1/+1
| | | | | we could generate short passwords! samba-patches 880
* used findstatic.pl to make some variables static and remove some deadAndrew Tridgell2002-07-011-2/+2
| | | | code
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* getpwnam -> getpwnam_alloc.Andrew Bartlett2002-01-231-1/+2
| | | | idra has promised not to revert these this time :-)
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-3/+0
|
* move to SAFE_FREE()Simo Sorce2001-09-171-2/+1
|
* Fixed compiler warning.Tim Potter2001-05-291-2/+2
|
* Fix for random stream generator.Jeremy Allison2001-05-241-168/+186
| | | | Jeremy.
* Merge of Andrew's changes in 2.2.Jeremy Allison2001-04-131-1/+1
| | | | Jeremy.
* Can't use space in random string used for exec.Jeremy Allison2001-04-121-1/+1
| | | | Jeremy.
* Changed lp_add/delete/enum scripts to use lockdir if spool dir doesn'tJeremy Allison2001-04-121-0/+24
| | | | | | | exist for printer. Rather than using pid for suffix, use a 16 byte random string. Created generate_random_str() function in genrand.c. Still needs more testing but this is the way to go. Jeremy.
* Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison2000-05-021-1/+1
| | | | | of doing a system call every time we want to just get our pid. Jeremy.
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-3/+3
|
* - typecast malloc / Realloc issues.Luke Leighton1999-10-251-2/+2
| | | | - signed / unsigned issues.
* use /dev/urandom not /dev/random in head branch.Andrew Tridgell1999-04-281-6/+9
| | | | | also got rid of /tmp time based random source. I saw a system with a huge number of files in /tmp and logging in was taking a _long_ time.
* Makefile.in: Added maintainer mode fixes.Jeremy Allison1998-11-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | aclocal.m4: Added AC_LIBTESTFUNC. configure.in: Fixed -lsecurity -lsec problems. client.c: dos_ fixes. groupdb/aliasunix.c: Dead code removal. include/includes.h: Added default PRINTCAP_NAME. lib/genrand.c: dos_ fixes. lib/replace.c: Added strtoul. lib/system.c: dos_ fixes. lib/util.c: dos_ fixes. lib/util_sid.c: Signed/unsigned fixes. lib/util_str.c: removed bad const. locking/locking_slow.c: dos_ fixes. printing/printing.c: dos_ fixes. rpc_server/srv_samr.c: Dead code removal. rpc_server/srv_sid.c: global_myworkgroup defined with wrong size AGAIN ! smbd/dir.c: dos_ fixes. smbd/open.c: dos_ fixes. smbd/oplock.c: dos_ fixes. smbd/reply.c smbd/server.c smbd/service.c smbd/uid.c: dos_ fixes. Jeremy.
* Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.Jeremy Allison1998-11-171-2/+2
| | | | | | | | | | Tidied up some of the mess (no other word for it). Still doesn't compile cleanly. There are calls with incorrect parameters that don't seem to be doing the right thing. This code still needs surgery :-(. Jeremy.
* Makefile.in: Fixed bug with continuation line causing proto to fail.Jeremy Allison1998-09-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* More abstraction of file system data types, to move to a 64Jeremy Allison1998-09-011-3/+3
| | | | | | | | | | | | | | | | | | | | | bit file interface for the NT SMB's. Created a new define, SMB_STRUCT_STAT that currently is defined to be struct stat - this wil change to a user defined type containing 64 bit info when the correct wrappers are written for 64 bit stat(), fstat() and lstat() calls. Also changed all sys_xxxx() calls that were previously just wrappers to the same call prefixed by a dos_to_unix() call into dos_xxxx() calls. This makes it explicit when a pathname translation is being done, and when it is not. Now, all sys_xxx() calls are meant to be wrappers to mask OS differences, and not silently converting filenames on the fly. Jeremy.
* This is a security audit change of the main source.Jeremy Allison1998-05-121-1/+1
| | | | | | | | | | | | | | | | | | It removed all ocurrences of the following functions : sprintf strcpy strcat The replacements are slprintf, safe_strcpy and safe_strcat. It should not be possible to use code in Samba that uses sprintf, strcpy or strcat, only the safe_equivalents. Once Andrew has fixed the slprintf implementation then this code will be moved back to the 1.9.18 code stream. Jeremy.
* genrand.c: SGI compile warning fix.Jeremy Allison1998-05-051-1/+1
| | | | | | | | | | | | | | ipc.c: Fix for duplicate printer names being long. loadparm.c: Set bNetWkstaUserLogon to false by default - new code in password.c protects us. nmbd_logonnames.c: nmbd_namequery.c: nmbd_namerelease.c: Debug messages fix. password.c: SGI compile warning fix, fix for tcon() with bNetWkstaUserLogon call. reply.c: SGI compile warning fix. server.c Debug messages fix. smbpass.c: Fix for incorrect pointer. Jeremy.
* genrand.c: Changed SMB_PASSWD_FILE to lp_smb_passwd_file().Jeremy Allison1998-04-231-1/+1
| | | | | | | | | | password.c: Started the initial code for domain_client_validate(). All bracketed with #ifdef DOMAIN_CLIENT for now. reply.c: Call to domain_client_validate(). All bracketed with #ifdef DOMAIN_CLIENT for now. smbpass.c: New code to get/set machine passwords. Tidied up nesting of lock calls. Jeremy.
* genrand.c: Improved generation of random values, more secure.Jeremy Allison1998-04-221-9/+32
| | | | | | | | | loadparm.c: Started add of 'security=domain' code. password.c: Fix for security=server NT bugs. reply.c: Started add of 'security=domain' code. server.c: Started add of 'security=domain' code. smb.h: Started add of 'security=domain' code. Jeremy.
* many systems don't have /etc/shadow but do have another system forAndrew Tridgell1998-04-211-0/+12
| | | | | | | | | | making encrypted passwords secret. For example, with secure NIS+ only root can get the encrypted password. hash in the encrypted password of "root" to provide a nice source of secret on such systems. On systems that don't have this (ie. any user can get roots encrypted password) then the security is so slack that it probably doesn't matter what we do to generate the secret.
* improved the secret buffer generation a bit. It now uses /etc/shadowAndrew Tridgell1998-04-211-22/+39
| | | | | and smbpasswd if possible, and doesn't put it all through a 32 bit bottleneck.
* genrand.c: Improved filename based random seed generation.Jeremy Allison1998-04-201-18/+55
| | | | | lib/rpc/server/srv_netlog.c: Changed to use generate_random_buffer(). Jeremy.
* Makefile: Added genrand.oJeremy Allison1998-04-201-0/+137
clientgen.c: Changed to fill change password buffer with random stuff. password.c: Changed to get challenge from genrand.c server.c: Added #ifdef around O_SYNC. version.h: Changed to 1.9.19prealpha. genrand.c: New code to generate (hopefully) good random numbers for use in crypto challenges/session keys etc. PLEASE REVIEW THIS CODE AND SUGGEST IMPROVEMENTS !!!!!! Jeremy.