summaryrefslogtreecommitdiffstats
path: root/source/lib/util.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* added debug reporting to pwdb_sam_map_names() and pwdb_smb_map_names()Luke Leighton1999-07-071-1/+1
|
* improving authentication code (tidyup).Luke Leighton1999-06-291-3/+3
|
* Moved code that changes the pw_passwd entry (i.e shadow password andTim Potter1999-06-131-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.
* had to move day display names into lib/util, to get rpctorture to compile.Luke Leighton1999-05-071-0/+2
|
* Jani Jaakkola's "getpwuid() / getpwnam()" hash-cache-hackLuke Leighton1999-05-061-13/+0
|
* Fix compile warning in nametouid().Tim Potter1999-04-121-1/+1
|
* Stefan Walter: spotted *p_group == NULL which should be p_group == ↵Luke Leighton1999-03-121-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.
* mods to allow inter-domain trust accounts to be added to SAM databaseLuke Leighton1999-03-091-30/+36
| | | | using smbpasswd command.
* cache unix groups so that two-level getgrent calls don't occur.Luke Leighton1999-02-031-0/+71
|
* oops, util_pwdb.c appears to be included in PASSDB_OBJ not LIB_OBJ.Luke Leighton1998-12-091-0/+14
|
* fixed warnings (and potential errors) due to integer overflow whenAndrew Tridgell1998-12-071-2/+3
| | | | creating locking masks
* - renamed do_samr_xxx to samr_xxxLuke Leighton1998-12-041-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)
* moved get_unixgroups it will be needed by the unix instance of the groupLuke Leighton1998-12-031-0/+49
| | | | DB API
* adding some samr parsing calls (group / alias adding / deleting)Luke Leighton1998-12-011-0/+15
| | | | added code that moves MACHINE.SID to DOMAIN_NAME.SID if it exists.
* weekend work. user / group database API.Luke Leighton1998-11-291-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...
* Makefile.in: Added maintainer mode fixes.Jeremy Allison1998-11-251-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.
* unix instance of group database APILuke Leighton1998-11-231-4/+13
|
* Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.Jeremy Allison1998-11-171-3/+3
| | | | | | | | | | 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.
* - group database API. oops and oh dear, the threat has been carried out:Luke Leighton1998-11-171-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the pre-alpha "domain group" etc parameters have disappeared. - interactive debug detection - re-added mem_man (andrew's memory management, detects memory corruption) - american spellings of "initialise" replaced with english spelling of "initialise". - started on "lookup_name()" and "lookup_sid()" functions. proper ones. - moved lots of functions around. created some modules of commonly used code. e.g the password file locking code, which is used in groupfile.c and aliasfile.c and smbpass.c - moved RID_TYPE_MASK up another bit. this is really unfortunate, but there is no other "fast" way to identify users from groups from aliases. i do not believe that this code saves us anything (the multipliers) and puts us at a disadvantage (reduces the useable rid space). the designers of NT aren't silly: if they can get away with a user- interface-speed LsaLookupNames / LsaLookupSids, then so can we. i spoke with isaac at the cifs conference, the only time for example that they do a security context check is on file create. certainly not on individual file reads / writes, which would drastically hit their performance and ours, too. - renamed myworkgroup to global_sam_name, amongst other things, when used in the rpc code. there is also a global_member_name, as we are always responsible for a SAM database, the scope of which is limited by the role of the machine (e.g if a member of a workgroup, your SAM is for _local_ logins only, and its name is the name of your server. you even still have a SID. see LsaQueryInfoPolicy, levels 3 and 5). - updated functionality of groupname.c to be able to cope with names like DOMAIN\group and SERVER\alias. used this code to be able to do aliases as well as groups. this code may actually be better off being used in username mapping, too. - created a connect to serverlist function in clientgen.c and used it in password.c - initialisation in server.c depends on the role of the server. well, it does now. - rpctorture. smbtorture. EXERCISE EXTREME CAUTION.
* extracted the password change code from smbpasswd and used it in swatAndrew Tridgell1998-11-121-0/+53
| | | | instead of opening pipes and other horrible stuff.
* largely rewrote smbpasswd so that the code is understandable. ThisAndrew Tridgell1998-11-121-1/+1
| | | | | | | | | | | | | should allow us to call a function in swat rather than piping to smbpasswd. while doing this I also fixed quite a few "const char *" versus "char *" issues that cropped up while using const to track down bugs in the code. This led to changes in several generic functions. The smbpasswd changes should be correct but they have not been extensively tested. At least if I have introduced bugs then we should be able to fix them more easily than before.
* changed syntax of registry commands so keys can start with HKLM or HKU.Luke Leighton1998-11-111-13/+55
| | | | sorted lookupsids command
* util functions split into relevant modules, first pass.Luke Leighton1998-11-101-1992/+99
|
* Makefile.in: Removed rpc_server/srv_ldap_helpers.c per J.F.'s instructions.Jeremy Allison1998-11-091-1/+1
| | | | | | | | | | | | | client/client.c: client/clitar.c: include/client.h: smbwrapper/smbw_dir.c: smbwrapper/smbw_stat.c: smbwrapper/smbw.c: lib/util.c: Converted all use of 'mode' to uint16. smbd/quotas.c: Fixed stupid comment bug I put in there :-(. printing/printing.c: Fix from J.F. to new code. Jeremy.
* use abort() instead of exit() in smb_panic()Andrew Tridgell1998-10-281-1/+1
| | | | | the reason we don't return() here is that smb_panic() is used not just for segv but also for detected errors (such as buffer overflows)
* include/smb.h: Added #defines for lots of things - makes our code a *lot* ↵Jeremy Allison1998-10-231-1/+1
| | | | | | | | | | | | | easier to read. lib/util.c: Fixed Luke's set_first_token() function - should return void. smbd/close.c: Move delete_on_close into file_fd_struct structure. smbd/ipc.c: Changed local_machine back to fstring. smbd/nttrans.c: Use defines for mapping share modes. smbd/open.c: Move delete_on_close into file_fd_struct structure, added code for ALLOW_SHARE_DELETE. smbd/reply.c: Use defines for mapping share modes. smbd/trans2.c: Move delete_on_close into file_fd_struct structure. Jeremy.
* rpctorture commandLuke Leighton1998-10-221-0/+5
|
* Fixed bug found by John Blair where trim_string wasn'tJeremy Allison1998-10-201-7/+89
| | | | | correctly trimming trailing multibyte code page strings. Jeremy.
* some quite important bug-fixes i missed because i transferred the wrongLuke Leighton1998-10-201-1/+3
| | | | | | | | | | | | | | smb.tgz file from my portable. particularly the call to mem_data followed by a realloc of that data in cli_pipe.c's rpc_read() function. smbd responses now use p->rdata_i which is a faked-up pointer into p->rdata's response data. rdata can be very long; rdata_i is limited to point to no more than max_tsize - 0x18 in length. this will make it an almost trivial task to add the encrypted rpc headers after rdata_i, and mem_buf_copy will cope admirably with rhdr chained to rdata_i chained to auth_verifier etc etc...
* - dce/rpc codeLuke Leighton1998-10-191-16/+4
| | | | | | | | | | | | | | | | | | | - removed debug info in struni2 and unistr2 (security risk) - rpc_pipe function was getting pointer to data then calling realloc *dur* - password check function, the start of "credential checking", user, wks, domain, pass as the credentials (not just user,pass which is incorrect in a domain context) - cli_write needs to return ssize_t not size_t, because total can be -1 if the write fails. - fixed signed / unsigned warnings (how come i don't get those any more when i compile with gcc???) - nt password change added in smbd. yes, jeremy, i verified that the SMBtrans2 version still works.
* removed an incorrect commentAndrew Tridgell1998-10-191-4/+0
|
* Fixed sys_lseek and seek_file calls so all returnsJeremy Allison1998-10-181-2/+3
| | | | | are *checked* :-). Jeremy.
* Re-added code to tell the user how many open files theyJeremy Allison1998-10-161-5/+7
| | | | | have. Needed for server diagnosis purposes... Jeremy.
* - fixed cast warningsAndrew Tridgell1998-10-051-11/+13
| | | | - ignore *.po32 files