summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
AgeCommit message (Collapse)AuthorFilesLines
2000-03-10Fixups for compiles with gcc flags -Wall -Wshadow -Wstrict-prototypes ↵Jeremy Allison1-5/+5
-Wpointer-arith -Wcast-qual Partially implemented rpc daemon redirect (needs more work). Jeremy. (This used to be commit a462191698fa589ceac4afd14c652adf699eccad)
2000-03-06changed prs_unistr to parse empty and non-empty strings the same way.Jean-François Micouleau1-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. (This used to be commit 025cdb345f6de287a41d4449b2662dbc5e762bf2)
2000-02-09Fixed wildcard match bug with '****' with smbclient. Found by Andrew (damn ↵Jeremy Allison1-2/+3
him! :-). Jeremy. (This used to be commit c8ca70f99ee2eae5e29ddf0dd4bc231fbcd188f2)
2000-02-07Jeremy can you check lib/util_unistr.c for codepages support ?Jean-François Micouleau1-0/+12
I added 2 UNICODE <-> ASCII functions which _don't_ honor codepage support. J.F. (This used to be commit b81dc7b7f832cae2e66076398a134fbb6c1f78ca)
2000-02-03Comments to use vfs_* functions instead of dos_* unless reallyTim Potter1-1/+3
accessing files on local disk. (This used to be commit b55f63da7e6a3c306ce668c77ed63a41d33240db)
2000-01-25First set of speed improvements from Ying Chen <ying@almaden.ibm.com>.Jeremy Allison1-137/+1
Inline several commonly used functions as macros. Jeremy. (This used to be commit fc0219c7cc4b83e6db17d5b3be70d74fd7971089)
2000-01-14Added "inherit permissions" patch.Jeremy Allison1-0/+28
Fixed locking bug found by Andrew. Jeremy. (This used to be commit 38dffd360dc2e44bfc9e751f017e24f81ff0f2fa)
2000-01-11Fixed bug in unix_mask_match() that caused veto files not to work.Jeremy Allison1-31/+9
Jeremy. (This used to be commit f5fedf80bce84dba1468631202337077511bcd25)
2000-01-07this looks like a big commit, but it isn't really :)Andrew Tridgell1-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. (This used to be commit b563be824b8c3141c49558eced7829b48d4ab26f)
2000-01-06Generic wildcard matching fix from weidel@multichart.de.Jeremy Allison1-19/+80
Jeremy. (This used to be commit 8b790cf3e21dd415e1daba24f5eba219e824cdc4)
2000-01-03simple mods to add msrpc pipe redirection. default behaviour: fall backLuke Leighton1-0/+15
to using internal msrpc code in smbd. (This used to be commit 8976e26d46cb991710bc77463f7f928ac00dd4d8)
2000-01-03got rid of mem_manAndrew Tridgell1-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! (This used to be commit 25b13f8b79d648188036f027f45bc78ec117cc88)
1999-12-21converted all our existing shared memory code to use a tdb databaseAndrew Tridgell1-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 (This used to be commit e48c2d9937eea0667b8cd3332e49c06314ef31e7)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-873/+583
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-12-12changed function name of get_home_dir() to get_unixhome_dir(), to stopLuke Leighton1-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. (This used to be commit 054195df9b6187c663ede5cf4489499abbdc29fc)
1999-12-12final part of "first" phase converting over to msrpc daemon architecture.Luke Leighton1-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. (This used to be commit caa50525220b0d0250fa139367593c2de2c12135)
1999-12-12delineation between smb and msrpc more marked. smbd now constructsLuke Leighton1-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()...) (This used to be commit aa3c659a8dba0437c17c60055a6ed30fdfecdb6d)
1999-12-09OK. This code works on a RedHat 6.0 system. However smbpasswdGerald Carter1-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 (This used to be commit e1d2b174caf5f0c48a8fac25778f72a868ec6eb7)
1999-12-02added get_any_dc_name() function.Luke Leighton1-0/+1
(This used to be commit 455e17dbb7d451b462004f302f5c68770f17b65e)
1999-12-02need a domain resolving function, but get_trusted_serverlist() will do.Luke Leighton1-0/+34
this is horrible. (This used to be commit 9df973fe711f322075d86d6792d6c0b8539c1d00)
1999-12-01sys_select added one more argument (read, write selectors).Luke Leighton1-1/+1
(This used to be commit e4d92ff9dfc51735e6932748f66a7c20b2c1cb6a)
1999-11-26whoa. _major_ restructure of rpcclient. fixed some buuugs, created a few.Luke Leighton1-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... (This used to be commit 29c480085e786905bfd92ea3cd93658f94e96e47)
1999-11-24ok. *whew*. this is the first completed part of the restructure.Luke Leighton1-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. (This used to be commit 57bff6fe82d777e599d535f076efb2328ba1188b)
1999-11-12split array-handling functions into separate module.Luke Leighton1-224/+0
(This used to be commit cc2ce2b755b12cb3d97522aaee69b93309571abc)
1999-11-08preparation for doing a spoolss enum jobs command. had to rewriteLuke Leighton1-2/+83
spoolss_enumjobs parsing code to do read / writes not just writes. (This used to be commit bc659a09f9103eee9616279e27fafacf89dcd9b9)
1999-11-08const feeding frenzyLuke Leighton1-5/+5
(This used to be commit 6d27c5f32dab7607398ae907eadb1c27a416da0d)
1999-11-06added rpcclient spoolenum command. enumerates printers.Luke Leighton1-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. (This used to be commit 135eaa977385cdd5f572a51f654f14d893347d7b)
1999-11-03three types of array-creation / array-deletion functions:Luke Leighton1-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 :-) (This used to be commit a80ea2eb47d298095eb6e5b0455309daa3a631cb)
1999-11-01rewrote rpcclient enumaliases command.Luke Leighton1-0/+35
(This used to be commit 492fdaaf2009e7d7e840323357a333fdf9c4d2e1)
1999-10-30general, drastic improvements to rpcclient.Luke Leighton1-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]) (This used to be commit bc5d021916a2f070c62011870a80b3b2707aff3b)
1999-10-29rpcclient regenum key client code rewritten to use higher order functions.Luke Leighton1-2/+2
(This used to be commit 6a759c57dcb851aa19d1d4156249a3df112aefd0)
1999-10-29added HKEY_CLASSES_ROOT MSRPC open call. reg_open_hkcr etc. supportedLuke Leighton1-1/+9
in rpcclient, regenum HKEY_CLASSES_ROOT or regenum HKCR to test. (This used to be commit b0aa933ef4c0b58840430cf3b3cb3cbeb5c7f704)
1999-10-21turning some of the rpcclient functions dynamic. this is likely toLuke Leighton1-0/+16
break a few things... (This used to be commit 4b06f303235d36903b6e9f55ee45b987d98256b0)
1999-07-21BDC support.Luke Leighton1-0/+27
(This used to be commit 2331aa32ab36c3ee5fd8cfbe972e57299939e33d)
1999-07-07added debug reporting to pwdb_sam_map_names() and pwdb_smb_map_names()Luke Leighton1-1/+1
(This used to be commit baab30815238a803badeafa1ed8f029d7782242f)
1999-06-29improving authentication code (tidyup).Luke Leighton1-3/+3
(This used to be commit ab1a6aa42db5217f025941fb5107436556bc23b7)
1999-06-13Moved code that changes the pw_passwd entry (i.e shadow password andTim Potter1-2/+2
weird unixware stuff) into _Get_Pwnam() to fix a memory allocation bug. Note that the Get_Pwnam() function now returns a const struct passwd * as a hint to other developers not to change entries in the struct passwd. (This used to be commit 36d7cb4ccc42268e8e6a7b783c945d1853624958)
1999-05-07had to move day display names into lib/util, to get rpctorture to compile.Luke Leighton1-0/+2
(This used to be commit 8c80742e4e5604bc667314e51c47924efd65df49)
1999-05-06Jani Jaakkola's "getpwuid() / getpwnam()" hash-cache-hackLuke Leighton1-13/+0
(This used to be commit 899fc053c50448db65092d9f25fea99433cfb29f)
1999-04-12Fix compile warning in nametouid().Tim Potter1-1/+1
(This used to be commit deb6dfb4e0c975a93a7bb3f93265c678eb35bd76)
1999-03-12Stefan Walter: spotted *p_group == NULL which should be p_group == ↵Luke Leighton1-2/+14
NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL.Stefan Walter: spotted *p_group == NULL which should be p_group == NULL. (This used to be commit 81b5304fe5ea518680b2516e2da39f31c1d05afb)
1999-03-09mods to allow inter-domain trust accounts to be added to SAM databaseLuke Leighton1-30/+36
using smbpasswd command. (This used to be commit 62d499f83256c6e8b3308dc4bd8e9f5df873b14b)
1999-02-03cache unix groups so that two-level getgrent calls don't occur.Luke Leighton1-0/+71
(This used to be commit f7dfa55a2e191ae780d399026bce48f68cda4bf0)
1998-12-09oops, util_pwdb.c appears to be included in PASSDB_OBJ not LIB_OBJ.Luke Leighton1-0/+14
(This used to be commit ca10eb44909e66a07dc7f88b0a740390f9ec3922)
1998-12-07fixed warnings (and potential errors) due to integer overflow whenAndrew Tridgell1-2/+3
creating locking masks (This used to be commit 5e2844d5edb15de29b976d2ff077ffbe012b860c)
1998-12-04- renamed do_samr_xxx to samr_xxxLuke Leighton1-4/+4
- renamed do_lsa_xxx to lsa_xxx - added "enumgroups [-m]" command, enumerates groups, shows members. - added cmd_sam_add_groupmem(), need to call these in rpcclient.c - added cmd_sam_add_aliasmem(), need to call these in rpcclient.c - modified "enumaliases [-m]" command - improved "enumgroups" and "enumaliases" to display names not just RIDS/SIDs. - renamed "samr_unknown_12" to "samr_lookup_rids". - added the following client-side functions: get_samr_query_groupmem() get_samr_query_aliasmem() get_samr_query_groupinfo() samr_enum_dom_groups() samr_enum_dom_aliases() samr_add_aliasmem() samr_add_groupmem() - improved display output (display.c) (This used to be commit eacc5e581af2b4de24186b9be3238b352c54effe)
1998-12-03moved get_unixgroups it will be needed by the unix instance of the groupLuke Leighton1-0/+49
DB API (This used to be commit ef58e48bc9af338ed6c734205d4faf82371284ac)
1998-12-01adding some samr parsing calls (group / alias adding / deleting)Luke Leighton1-0/+15
added code that moves MACHINE.SID to DOMAIN_NAME.SID if it exists. (This used to be commit 51c1c31768a92d9c57ee6c09b78419bcbc544f03)
1998-11-29weekend work. user / group database API.Luke Leighton1-43/+60
- split sam_passwd and smb_passwd into separate higher-order function tables - renamed struct smb_passwd's "smb_user" to "unix_user". added "nt_user" plus user_rid, and added a "wrap" function in both sam_passwd and smb_passwd password databases to fill in the blank entries that are not obtained from whatever password database API instance is being used. NOTE: whenever a struct smb_passwd or struct sam_passwd is used, it MUST be initialised with pwdb_sam_init() or pwd_smb_init(), see chgpasswd.c for the only example outside of the password database APIs i could find. - added query_useraliases code to rpcclient. - dealt with some nasty interdependencies involving non-smbd programs and the password database API. this is still not satisfactorily resolved completelely, but it's the best i can do for now. - #ifdef'd out some password database options so that people don't mistakenly set them unless they recompile to _use_ those options. lots of debugging done, it's still not finished. the unix/NT uid/gid and user-rid/group-rid issues are better, but not perfect. the "BUILTIN" domain is still missing: users cannot be added to "BUILTIN" groups yet, as we only have an "alias" db API and a "group" db API but not "builtin-alias" db API... (This used to be commit 5d5d7e4de7d1514ab87b07ede629de8aa00519a1)
1998-11-25Makefile.in: Added maintainer mode fixes.Jeremy Allison1-179/+20
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. (This used to be commit 6acb4b68f68d516e2ac3c47e500f5600d653435e)