summaryrefslogtreecommitdiffstats
path: root/source/lib/util.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* need a domain resolving function, but get_trusted_serverlist() will do.Luke Leighton1999-12-021-0/+34
| | | | this is horrible.
* sys_select added one more argument (read, write selectors).Luke Leighton1999-12-011-1/+1
|
* whoa. _major_ restructure of rpcclient. fixed some buuugs, created a few.Luke Leighton1999-11-261-21/+0
| | | | | | found out that getopt() _must_ have optind set to 0 before reuse. still haven't decided what to do with the net* api yet...
* ok. *whew*. this is the first completed part of the restructure.Luke Leighton1999-11-241-0/+21
| | | | | | | | | | | | verified that lsaquery, lsalookupsids work, and found some bugs in the parameters of these commands :-) soo... we now have an lsa_* api that has the same arguments as the nt Lsa* api! cool! the only significant coding difference is the introduction of a user_credentials structure, containing user, domain, pass and ntlmssp flags.
* split array-handling functions into separate module.Luke Leighton1999-11-121-224/+0
|
* preparation for doing a spoolss enum jobs command. had to rewriteLuke Leighton1999-11-081-2/+83
| | | | spoolss_enumjobs parsing code to do read / writes not just writes.
* const feeding frenzyLuke Leighton1999-11-081-5/+5
|
* added rpcclient spoolenum command. enumerates printers.Luke Leighton1999-11-061-12/+82
| | | | | | spoolss_r_io_enumprinters doesn't decode strings correctly as printer_info_1/2 code has only been written to write structures, not read them.
* three types of array-creation / array-deletion functions:Luke Leighton1999-11-031-31/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | char* UNISTR2* SID* decided to create a higher-order function set, add_item_to_array() free_item_array(). higher-order support routines needed to add a new type: type* item_dup(const type*) void item_free(type*) of course, strdup() and free() are perfect, pre-existing examples of such functions, used in the implementation of add_chars_to_array() and free_char_array(). sid_dup() and free() work for the add_sids_to_array() and free_sid_array() implementations. use unistr2_dup() and created unistr2_free() because the functionality behind these may change into something horrible, like [horror] dynamic memory allocation of the UNISTR2 character array. argh!!!! jean-francois, this function set implements what we talked about over... a year ago, now :-)
* rewrote rpcclient enumaliases command.Luke Leighton1999-11-011-0/+35
|
* general, drastic improvements to rpcclient.Luke Leighton1999-10-301-0/+18
| | | | | | | | | | | added samgroup <groupname> command added samgroupmem <groupname> command added proper registry key completion added sam command user-completion (e.g samuser [tab]) added sam command group-completion (e.g samgroup [tab])
* rpcclient regenum key client code rewritten to use higher order functions.Luke Leighton1999-10-291-2/+2
|
* added HKEY_CLASSES_ROOT MSRPC open call. reg_open_hkcr etc. supportedLuke Leighton1999-10-291-1/+9
| | | | in rpcclient, regenum HKEY_CLASSES_ROOT or regenum HKCR to test.
* turning some of the rpcclient functions dynamic. this is likely toLuke Leighton1999-10-211-0/+16
| | | | break a few things...
* BDC support.Luke Leighton1999-07-211-0/+27
|