summaryrefslogtreecommitdiffstats
path: root/source/lib/util.c
Commit message (Collapse)AuthorAgeFilesLines
* Removed silly Get_Hostbyname() wrapper as DNS names are case-insensitiveTim Potter2001-06-181-65/+4
| | | | | and the use of this function only increased timeouts when Samba queries a broken DNS server.
* removed need for scandir in client.cAndrew Tridgell2001-05-071-1/+3
| | | | fixed possible bug with readdirname on systems with NAMELEN != strlen
* Removed mktemp from HEAD - same as done in 2.2.Jeremy Allison2001-04-181-39/+4
| | | | Jeremy.
* Added fix from "Eric Boehm" <boehm@nortelnetworks.com> to try and set hardJeremy Allison2001-04-131-0/+24
| | | | | limit before setting soft limit. Jeremy.
* As Andrew suggested, make smbrun return a fd for a deleted file which can thenJeremy Allison2001-04-131-2/+3
| | | | | be read. Jeremy.
* To stop people complaining about the mktemp call, move it into lib/util.c. ↵Jeremy Allison2001-04-111-0/+14
| | | | | | | | Thanks to Andrew for all this code. Fixed extra line in lib/sysacls.c that broke XFS ACL code. Jeremy.
* Fixed --with-automount compile error.Jeremy Allison2001-04-101-2/+2
| | | | Jeremy.
* Got "medieval on our ass" about adding the -1 to slprintf.Jeremy Allison2001-04-081-1/+1
| | | | Jeremy.
* Patch to make automount lookup fallback to get home directory from getpwnam.Jeremy Allison2001-03-261-19/+25
| | | | | From Robert Montjoy <Rob_Montjoy@ECECS.UC.EDU>. Jeremy.
* Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison2001-03-111-1/+1
| | | | | | RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy.
* started support for unicode on the wire in smbd. Using a very similarAndrew Tridgell2001-03-101-0/+9
| | | | | | | | | method to what was used in the client I now have session setup and tconx working. Currently this is enabled with SMBD_USE_UNICODE environment variable. Once the code is complete this will become a smb.conf option.
* - neater setting of bccAndrew Tridgell2001-02-201-6/+16
| | | | - converted cli_rename and cli_unlink
* Ok - fixed a bug in our levelII oplock code. We need to break a level II onJeremy Allison2000-11-161-51/+0
| | | | | | | | | a byte range lock (write lock only, but Win2k breaks on read lock also so I do the same) - if you think about why, this is obvious. Also fixed our client code to do level II oplocks, if requested, and fixed the code where we would assume the client wanted level II if it advertised itself as being level II capable - it may not want that. Jeremy.
* Fix to allow smbd to call winbindd if it is running for all group enumeration,Jeremy Allison2000-10-131-15/+35
| | | | | | | | falling back to the UNIX calls on error. This should fix all problems with smbd enumerating all users in all groups in all trusted domains via winbindd. Also changed GETDC to query 1C name rather than 1b name as only the PDC registers 1b. Jeremy.
* Restructuring of the code to remove dos_ChDir/dos_GetWd and re-vector themJeremy Allison2000-09-271-131/+0
| | | | | | | through the VFS. All file access/directory access code in smbd should now go via the vfs. Added vfs_chown/vfs_chmod calls. Still looking at vfs_get_nt_acl() vfs_set_nt_acl() call API design. Jeremy.
* Linux kernel oplocks now seem to work, but need a _lot_ of testingAndrew Tridgell2000-06-111-1/+1
| | | | | I had to modify sys_select() to not loop on EINTR. I added a wrapper called sys_select_intr() which gives the old behaviour.
* Changed name of case_sensitive in mask_match to avaid gcc "shadow global"Jeremy Allison2000-05-171-4/+2
| | | | | warning. Jeremy.
* Moved uglyness needed in fcntl locking (64->32 bit mapping, NFSJeremy Allison2000-05-021-102/+6
| | | | | | | errors etc.) into locking/posix.c, where it is needed. fcntl_lock in lib/util.c is now very small and clean. Added (*lock) op to vfs layer. Jeremy.
* Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison2000-05-021-3/+3
| | | | | of doing a system call every time we want to just get our pid. Jeremy.
* - removed all our old wildcard matching code and replaced it with aAndrew Tridgell2000-04-301-604/+53
| | | | | | | | | | | | | | | | call to ms_fnmatch(). This also removes all the Win9X semantics stuff and a bunch of other associated cruft. - moved the stat cache code into statcache.c - fixed the uint16 alignment requirements of ascii_to_unistr() and unistr_to_ascii() - trans2 SMB_FIND_FILE_BOTH_DIRECTORY_INFO returns the short name as unicode always (at least thats what NT4 does) - fixed some errors in the in-memory tdb code. Still ugly, but doesn't crash as much
* YIPEE!!!!!Andrew Tridgell2000-04-301-1/+1
| | | | | | | | | | | We finally have a perfect emulation of Microsoft wildcard matching. The routine ms_fnmatch() does wildcard matching with all MS wildcards (including the unicode wildcards), and masktest against a NT4 workstation with hundreds of thousands of random exmaples has not found a single error. amazingly it is only about 60 lines of code, but it has taken us years to get it right. I didn't sleep much last night :)
* moved the INSURE hook into util.cAndrew Tridgell2000-04-241-0/+26
|
* if using insure then don't close fd 2Andrew Tridgell2000-04-231-1/+4
|
* return NULL for a zero size memdupAndrew Tridgell2000-04-221-0/+1
|
* moved standard_sub() and friends into a separate moduleAndrew Tridgell2000-04-171-269/+1
|
* added standard_sub_snum() function for modules that don't haveAndrew Tridgell2000-04-151-1/+8
| | | | a connection structure
* Removed "ole locking compat" parameter (no longer used).Jeremy Allison2000-04-121-34/+1
| | | | | | We now get/set/check POSIX locks, but I still need to code up the close fd braindamage... Jeremy.
* include/byteorder.h: ALIGN4/ALIGN2 macros.Jeremy Allison2000-04-111-25/+0
| | | | | | | | | | | | include/includes.h: Added SMB_BIG_UINT_BITS. lib/util.c: Removed align2/align4 - use macros. libsmb/namequery.c: Use ALIGN2. locking/locking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. Needed to move to hiding POSIX locks at a lower layer. nmbd/nmbd_processlogon.c: Use ALIGN2/ALIGN4 macros. smbd/blocking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. smbd/reply.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. Jeremy.
* add an align4() functionAndrew Tridgell2000-04-111-1/+14
|
* finally got sick of the "extern int Client" code and the stupidAndrew Tridgell2000-04-111-51/+2
| | | | | | | | | | | | | | | | assumption that we have one socket everywhere while doing so I discovered a few bugs! 1) the clientgen session retarget code if used from smbd or nmbd would cause a crash as it called close_sockets() which closed our main socket! fixed by removing close_sockets() completely - it is unnecessary 2) the caching in client_addr() and client_name() was bogus - it could easily get fooled and give the wrong result. fixed. 3) the retarget could could recurse, allowing an easy denial of service attack on nmbd. fixed.
* moved nmblib-specific code from util.c to nmblib.c.Luke Leighton2000-03-271-191/+0
|
* Fixups for compiles with gcc flags -Wall -Wshadow -Wstrict-prototypes ↵Jeremy Allison2000-03-101-5/+5
| | | | | | | -Wpointer-arith -Wcast-qual Partially implemented rpc daemon redirect (needs more work). Jeremy.
* changed prs_unistr to parse empty and non-empty strings the same way.Jean-François Micouleau2000-03-061-14/+20
| | | | | | | | | | | | fixed typo in SPOOLSS_SYNT some cleanup of unused functions wrote make_spoolss_enumprinter and make_spoolss_openprinterex for rpcclient as I'm trying to keep in sync the parsing code between HEAD and TNG. Will commit changes to TNG after lunch. J.F.
* Fixed wildcard match bug with '****' with smbclient. Found by Andrew (damn ↵Jeremy Allison2000-02-091-2/+3
| | | | | | him! :-). Jeremy.
* Jeremy can you check lib/util_unistr.c for codepages support ?Jean-François Micouleau2000-02-071-0/+12
| | | | | | | I added 2 UNICODE <-> ASCII functions which _don't_ honor codepage support. J.F.
* Comments to use vfs_* functions instead of dos_* unless reallyTim Potter2000-02-031-1/+3
| | | | accessing files on local disk.
* First set of speed improvements from Ying Chen <ying@almaden.ibm.com>.Jeremy Allison2000-01-251-137/+1
| | | | | Inline several commonly used functions as macros. Jeremy.
* Added "inherit permissions" patch.Jeremy Allison2000-01-141-0/+28
| | | | | Fixed locking bug found by Andrew. Jeremy.
* Fixed bug in unix_mask_match() that caused veto files not to work.Jeremy Allison2000-01-111-31/+9
| | | | Jeremy.
* this looks like a big commit, but it isn't really :)Andrew Tridgell2000-01-071-5/+4
| | | | | | | | This fixes our netbios scope handling. We now have a 'netbios scope' option in smb.conf and the scope option is removed from make_nmb_name() this was prompted by a bug in our PDC finding code where it didn't append the scope to the query of the '*' name.
* Generic wildcard matching fix from weidel@multichart.de.Jeremy Allison2000-01-061-19/+80
| | | | Jeremy.
* simple mods to add msrpc pipe redirection. default behaviour: fall backLuke Leighton2000-01-031-0/+15
| | | | to using internal msrpc code in smbd.
* got rid of mem_manAndrew Tridgell2000-01-031-7/+0
| | | | | | | yamd is much better, and doesn't require any source code changes if you haven't seen yamd then take a look at http://www3.hmc.edu/~neldredge/yamd/ its excellent!
* converted all our existing shared memory code to use a tdb databaseAndrew Tridgell1999-12-211-0/+21
| | | | | | | | | | | | | instead of either sysv or mmap shared memory or lock files. this means we can now completely remove locking_shm.c locking_slow.c shmem.c shmem_sysv.c and lots of other things also got simpler locking.c got a bit larger, but is much better compartmentalised now
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-873/+583
|
* changed function name of get_home_dir() to get_unixhome_dir(), to stopLuke Leighton1999-12-121-3/+3
| | | | | | | clash with gnu readline library. fixed issue with [homes] service not being there - call lp_add_home() just before starting the msrpc processing.
* final part of "first" phase converting over to msrpc daemon architecture.Luke Leighton1999-12-121-9/+237
| | | | | | | | | | | | done a minimal amout of clean-up in the Makefile, removing unnecessary modules from the link stage. this is not complete, yet, and will involve some changes, for example to smbd, to remove dependencies on the password database API that shouldn't be there. for example, smbd should not ever call getsmbpwXXX() it should call the Samr or Lsa API. this first implementation has minor problems with not reinstantiating the same services as the caller. the "homes" service is a good example.
* delineation between smb and msrpc more marked. smbd now constructsLuke Leighton1999-12-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pdus, and then feeds them over either a "local" function call or a "remote" function call to an msrpc service. the "remote" msrpc daemon, on the other side of a unix socket, then calls the same "local" function that smbd would, if the msrpc service were being run from inside smbd. this allows a transition from local msrpc services (inside the same smbd process) to remote (over a unix socket). removed reference to pipes_struct in msrpc services. all msrpc processing functions take rpcsrv_struct which is a structure containing state info for the msrpc functions to decode and create pdus. created become_vuser() which does everything not related to connection_struct that become_user() does. removed, as best i could, connection_struct dependencies from the nt spoolss printing code. todo: remove dcinfo from rpcsrv_struct because this stores NETLOGON-specific info on a per-connection basis, and if the connection dies then so does the info, and that's a fairly serious problem. had to put pretty much everything that is in user_struct into parse_creds.c to feed unix user info over to the msrpc daemons. why? because it's expensive to do unix password/group database lookups, and it's definitely expensive to do nt user profile lookups, not to mention pretty difficult and if you did either of these it would introduce a complication / unnecessary interdependency. so, send uid/gid/num_groups/gid_t* + SID+num_rids+domain_group_rids* + unix username + nt username + nt domain + user session key etc. this is the MINIMUM info identified so far that's actually implemented. missing bits include the called and calling netbios names etc. (basically, anything that can be loaded into standard_sub() and standard_sub_basic()...)
* OK. This code works on a RedHat 6.0 system. However smbpasswdGerald Carter1999-12-091-2/+9
| | | | | | | | | | | | | | | | | time out of sending the session setup on Solaris 2.6. No idea. I'll work on it some tomorrow. This is to fix the "Unable to setup password vectors" thingy. Also changed an inet_aton() to inet_addr() as the former is not very portable :-) Luke, I set the redir flag to false because the connection to the smb-agent was failing and smbpasswd bombed. Double check me on this one. -jc
* added get_any_dc_name() function.Luke Leighton1999-12-021-0/+1
|