summaryrefslogtreecommitdiffstats
path: root/source/client/clientutil.c
Commit message (Collapse)AuthorAgeFilesLines
* HPUX fix. This looks like a big change but isn't actually, most of theJeremy Allison1998-12-101-6/+6
| | | | | | | | | | | | | | | | changes are bzero -> memset as the compiler on HPUX is very picky about bzero (probably a strange define). The significant changes are in configure.in, to fix the HPUX shadow.h problem and also move the large file support to the correct place. passdb/pass_check.c: Added includes for KRB5, DCE and AFS if requested in autoconf. tests/trapdoor.c: Fix to use setresuid and setresgid if defined. The rest of the changes are bzero -> memset. Jeremy.
* client/clientutil.c: Changed workgroup to "" for smbmount (only codeJeremy Allison1998-12-031-1/+1
| | | | | | | | | that still uses clientutil.c). passdb/passdb.c: Changed dos_mkdir to mkdir. Changed fchmod to chmod for some UNIX's that don't have fchmod. passdb/smbpass.c: Added test for uid with leading '-'. smbd/ipc.c: Added fix for invalid info level from Scott Moomaw <scott@bridgewater.edu>. Jeremy.
* - modified resolve_name() to take a name_typeAndrew Tridgell1998-10-041-1/+1
| | | | | | - cleaned up resolve_name() (split into separate functions for each resolver) - if can't find local master then use #1B name - support listing of foreign workgroups in /smb/
* Got very strict about the differences and uses ofJeremy Allison1998-09-291-9/+8
| | | | | | | uid_t, gid_t and vuid. Added sys_getgroups() to get around the int * return problem. Set correct datatypes for all uid, gid and vuid variables. Jeremy.
* Fixed problems found in lint pass over the old code by <cpeterso@microsoft.com>.Jeremy Allison1998-09-281-3/+18
| | | | | These were the problems that still existed in the 2.0 branch. Jeremy.
* allow smbclient to connect to IPC$ as an IPC serviceAndrew Tridgell1998-08-301-2/+0
|
* merge from the autoconf2 branch to the main branchAndrew Tridgell1998-07-291-6/+4
|
* Added SSL support from Christian Starkjohann <cs@obdev.at>Jeremy Allison1998-06-161-0/+13
| | | | | | | This patch may not yet compile with -DUSE_SSL enabled, further Makefile changes may be needed. But it was important to get this code in place before I go off to USENIX. Jeremy.
* client.c: Made -L do a null-session share unless -U user is specified.Jeremy Allison1998-06-151-94/+105
| | | | | | clientutil.c: Fixed NT session to add NT password. groupname.c: Added lookup function. Jeremy.
* clientutil.c: Don't core dump if no controlling terminal available for password.Jeremy Allison1998-06-011-0/+3
| | | | | | | passdb.c: lib/rpc/include/rpc_misc.h: First cut at automatic uid/gid to rid mapping. We can change this at a later date to make more bits available if neccessary. Jeremy.
* This is a security audit change of the main source.Jeremy Allison1998-05-121-21/+21
| | | | | | | | | | | | | | | | | | 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.
* This looks like a big change but really isn't.Jeremy Allison1998-04-251-9/+9
| | | | | | | | | | | It is changing the global variables "myname" and "myworkgroup" to "global_myname" and "global_myworkgroup" respectively. This is to make it very explicit when we are messing with a global (don't ask - it makes the domain client code much clearer :-). Jeremy.
* Changes to allow Samba to be compiled with -Wstrict-prototypesJeremy Allison1998-04-131-1/+1
| | | | | | with gcc. (Not a big change although it looks like it :-). Jeremy.
* Adding the same change as was added to 1.9.18 branch to add theJeremy Allison1998-03-161-32/+2
| | | | | | | | | | | | | | | | | | | | | | | "name resolve order" parameter. source/Makefile: Re-ordered link for name resolve order code. source/clientgen.c: source/clientutil.c: Added calls to resolve_name(). source/includes.h: Added HPUX zombie fix. source/loadparm.c: Added new name resolve order parameter. source/namequery.c: Re-wrote to include parsing of lmhosts file, new resolve_name() function requested by John. source/nmbd.c: Tell resolve_name not to do WINS lookups if we are the WINS server. source/nmbd_lmhosts.c: Call lmhosts parsing functions in namequery.c source/password.c: Call resolve_name() to lookup security=server name. source/reply.c: source/time.c: source/trans2.c: "fake directory create times" fix from Jim Hague - hague@research.canon.com.au. source/util.c: Removed isalnum() test in Get_Hostname() that seems to cause problems on many systems. Jeremy.
* -N option still prompted for password in smbclient -L usageHerb Lewis1998-02-261-1/+3
|
* Sometime after 1.9.17p5 smbclient stopped being able to doJeremy Allison1998-02-141-2/+4
| | | | | | | | | | | | | NetBIOS name lookups by broadcast and instead only does DNS. With the belief that this was not what was intended (I think it happened in the clientutil.c cleanup) I have added that capability back to smbclient by adding the #define USENMB into clientutil.c, and adding the required namequery.o into the object lists for smbclient and smbmount (as they now need it to link). If this was done intentionally let me know and I'll back this out. Jeremy.
* This is *not* a big change (although it looks like one).Jeremy Allison1998-01-221-1/+1
| | | | | | | This is merely updating the Copyright statements from 1997 to 1998. It's a once a year thing :-). NO OTHER CHANGES WERE MADE. Jeremy.
* Makefile: Added new codepage - 866.Jeremy Allison1998-01-161-1/+1
| | | | | | | | | charset.c: Supporting code for codepage 866. clientutil.c: Fix compile bug in little-used #define. includes.h: Supporting code for codepage 866. make_smbcodepage.c: Supporting code for codepage 866. pcap.c: Fix bug for lpstat. Jeremy.
* Added 3 commands:Volker Lendecke1998-01-051-27/+35
| | | | | | | | smbmount: This is a stripped down smbclient that communicates with the Linux 2.1.x kernel to supply authenticated smb connections for smbfs mount points. smbmnt/smbumount: setuid commands that do the actual smb mount system call after having done the appropriate security checks
* client.c:Jeremy Allison1997-12-201-9/+9
| | | | | | | | | | | | | | | | clientgen.c: clientutil.c: clitar.c: Changed usage of receive_smb to new function client_receive_smb except for one use of receive_smb in client.c. This is the receive_smb used to discard packets received whilst in a keyboard wait state. util.c: Created new function client_receive_smb that ignores session keepalives just as the old receive_smb used to do. Created internal function read_smb_length_return_keepalive that is used internally by the changed receive_smb call. Changed read_smb_len to not use an internal buffer - it is never called with a null buffer so such code is redundant. Jeremy.
* fix a bug that sometimes prevented smbclient from connecting withAndrew Tridgell1997-12-141-1/+3
| | | | protocol < LANMAN1
* This is it ! The mega-merge of the JRA_NMBD_REWRITE branchJeremy Allison1997-12-131-4/+7
| | | | | | | | back into the main tree. For the cvs logs of all the files starting nmbd_*.c, look in the JRA_NMBD_REWRITE branch. That branch has now been discontinued. Jeremy.
* added code that _uses_ arcfour. arcfour itself, or anything remotelyLuke Leighton1997-11-031-1/+4
| | | | | | | like it, has *not* been added. this is the client and server side of the SAM Logon NT and LM OWF password obfuscation (rc4 with the long-term session key).
* convert the credentials code back to uchar[8] from uint32[2]Andrew Tridgell1997-11-021-3/+3
| | | | This should fix the byte order problems (maybe!)
* client.c clientutil.c proto.hLuke Leighton1997-11-011-5/+8
| | | | | | | | | | | | | | | | | rpc_pipes/ntclientlsa.c rpc_pipes/ntclientnet.c rpc_pipes/ntclientpipe.c : added extra argument to cli_call_api() to allow specifying the length of the \PIPE\ name. it appears that, like when the name of the pipe is NULL and OS-2 requires two extra bytes _after_ the NULL name, that NT requires two bytes after the NULL-terminated name "\PIPE\". these two bytes vary, but values seen so far are: 0x72 0x70; 0x63 0x65; 0x44 0x65; 0x4E 0x00. there appears not to be much logic to this. purpose unknown. ntclient.c: put Set Named Pipe Handle State call directly after SMBopenX call.
* a simple SMB torture tester. This will allow us to evaluate lockingAndrew Tridgell1997-11-011-154/+0
| | | | techniques more accurately.
* fix some casting errors in smbencrypt and some multiply-defined errorsAndrew Tridgell1997-10-261-1/+1
| | | | | | in clientutil.c (Luke, you can't just copy a global variable declaration from one file to another, you need to declare one of them extern)
* The browse synchronisation code in nmbsync.c now uses the clientgen.cAndrew Tridgell1997-10-261-4/+5
| | | | | | | | | | | | code, which means we don't have to link with a fake getpass routine and we don't have a whole pile of global variables that really have nothing to do with nmbd and were there to keep the client code happy. The code should function identically to what it did before (hopefully it was correct) The only thing that now uses the horrible clientutil.c code is smbclient.
* playing about, trying to SMBopenX a \PIPE\NETLOGON (should be a SMBopen)Luke Leighton1997-10-231-5/+7
| | | | and then send a LSA_REQ_CHAL down it.
* Makefile client.c clientutil.c clitar.c nmbsync.c :Luke Leighton1997-10-221-241/+292
| | | | | | | | | | | | | | | | | | | | | redid the split that i did a year ago, taking the functions in client.c out into clientutil.c. guess what? we could now do encrypted password NetServerEnum2 calls in nmbd, if we wanted to. i can now use cli_call_api() to send to different pipes. i hope. pipenetlog.c: allow adding to users group _and_ to admin group. if adding to guest group, don't allow adding to users or admin as well. smb.h : added some pipe #defines (\PIPE\NETLOGON \PIPE\srvsvc ...) proto.h : usual.
* some cleanups in the clientutil.c code.Andrew Tridgell1997-10-211-30/+35
| | | | | | | I'm actually hoping to remove this module completely once we convert nmbd to using the new (much cleaner) clientgen.c smbclient now also reports if it connects as a guest user
* bracket some macrosAndrew Tridgell1997-10-091-1/+1
| | | | | | | | change MAX_PASSWORD_LENGTH to MAX_PASS_LEN to prevent conflict on some systems add #ifdef around soft link dependent code (for systems that don't have soft links)
* a bit of bounds checkingAndrew Tridgell1997-10-041-0/+12
|
* Adding Andrews buffer overflow fixes into the main branch.Jeremy Allison1997-09-261-10/+11
| | | | Jeremy (jallison@whistle.com)
* This commit does 3 main things:Andrew Tridgell1997-09-141-6/+0
| | | | | | | | | | | | | | | | | | | | | | | 1) put the encryption code in by default, with no #ifdef. It is still disabled by default so you need to add "encrypt passwords = yes" in smb.conf but at least all binaries will have it. 2) cleanup the kanji code so it compiles with no warnings 3) get rid of lots of uses of ugly non-portable C code. The main offender being things like "register" but also remove uses of the "const" keyword as there are compilers out there that don't support it and even those that do often complain about its usage. Users don't like warnings :-( There is still some work to do. We need to replace the md4 code with our own implementation. The current code (from rfc1186) is PD but is not very portable. The new RFC (rfc1320) is more portable but adds copyright restrictions. I'll do a from-scratch MD4 soon. We also need to test that what I've implemented is portable. It should be, but I'm too tired right now to test it on anything other than intel linux.
* includes.h: Make sure REPLACE_GETPASS are wrapped with #ifdefs.Jeremy Allison1997-08-281-0/+6
| | | | | | | nmbsync.c: Make sure REPLACE_GETPASS is defined before including includes.h clientutil.c: Catch null passwords. Fixes for a nmbd crash bug found by Herb Lewis @ SGI. Jermey(jallison@whistle.com)
* client.c: Minor change to cast parameters for DEC unix.Samba Release Account1997-07-301-2/+2
| | | | | | | | | | | | | clientutil.c: Minor change to cast parameters for DEC unix. ipc.c: Fixes to parameterise the stuff John wants. loadparm.c: Fixes to parameterise the stuff John wants. nameannounce.c: Fixes to parameterise the stuff John wants. namedbwork.c: Fixes to parameterise the stuff John wants. nameserv.h: Fixes to parameterise the stuff John wants. proto.h: Fixes to parameterise the stuff John wants. smb.h: Fixes to parameterise the stuff John wants. util.c: tidy. Jeremy (jallison@whistle.com)
* 'The mother of all checkins' :-). Jeremy Allison (jallison@whistle.com)Samba Release Account1997-05-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wed May 7 1997: Update for 1.9.17alpha1 release - 'browsefix release' designed to make browsing across subnets work. byteorder.h: Updated copyright to 1997. charcnv.c: Updated copyright to 1997. charset.c Updated copyright to 1997. charset.h Updated copyright to 1997. client.c Updated copyright to 1997. clientutil.c Updated copyright to 1997. dir.c Updated copyright to 1997. fault.c Updated copyright to 1997. includes.h Updated copyright to 1997. interface.c Updated copyright to 1997. ipc.c Updated copyright to 1997. kanji.c Updated copyright to 1997. kanji.h Updated copyright to 1997. loadparm.c Updated copyright to 1997. locking.c Updated copyright to 1997. mangle.c Updated copyright to 1997. message.c Updated copyright to 1997. nameannounce.c Made use of WINS subnet explicit. Added reset_announce_timer() so announcement can be made immediately when we become a master. Expanded code to do sync with dmb. namebrowse.c Removed redundent checks for AM_MASTER in sync code. Made use of WINS subnet explicit. namedbname.c Made use of WINS subnet explicit. namedbresp.c Made use of WINS subnet explicit. namedbserver.c Made use of WINS subnet explicit. namedbsubnet.c Explicitly add workgroup to WINS subnet when we become a dmb. Made use of WINS subnet explicit. namedbwork.c Made use of WINS subnet explicit. Removed redundent check_work_servertype() function. nameelect.c Explicitly add workgroup to WINS subnet when we become a master browser. Made use of WINS subnet explicit. namelogon.c Updated copyright to 1997. namepacket.c Updated copyright to 1997. namequery.c Updated copyright to 1997. nameresp.c Made use of WINS subnet explicit. Made nmbd fail if configured as master browser and one exists already. nameserv.c Made use of WINS subnet explicit. Remove redundent logon server and domain master code. nameserv.h Add emumerate subnet macros. nameservreply.c Made use of WINS subnet explicit. nameservresp.c Updated copyright to 1997. namework.c Made use of WINS subnet explicit. Updated code to add sync browser entries to add subnet parameter. nmbd.c Added sanity check for misconfigured nmbd. nmblib.c Updated copyright to 1997. nmblookup.c Updated copyright to 1997. nmbsync.c Removed redundent AM_ANY_MASTER check. params.c Updated copyright to 1997. password.c Updated copyright to 1997. pipes.c Updated copyright to 1997. predict.c Updated copyright to 1997. printing.c Updated copyright to 1997. proto.h Changed protos for new nmbd code. quotas.c Updated copyright to 1997. replace.c Updated copyright to 1997. reply.c Updated copyright to 1997. server.c Updated copyright to 1997. shmem.c Updated copyright to 1997. smb.h Updated copyright to 1997. smbencrypt.c Updated copyright to 1997. smbpasswd.c Updated copyright to 1997. smbrun.c Updated copyright to 1997. status.c Updated copyright to 1997. system.c Updated copyright to 1997. testparm.c Updated copyright to 1997. testprns.c Updated copyright to 1997. time.c Updated copyright to 1997. trans2.c Updated copyright to 1997. trans2.h Updated copyright to 1997. uid.c Updated copyright to 1997. username.c Updated copyright to 1997. util.c Updated copyright to 1997. version.h Changed to 1.9.17alpha1.
* - add timeouts to connect() for password server connections. ThisAndrew Tridgell1996-08-221-2/+2
| | | | makes multiple password servers practical.
* - added "netbios name" option in smb.conf to make controlling the nameAndrew Tridgell1996-08-191-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | that samba uses possible - added "socket address" option to allow virtual SMB servers (on systems with IP aliasing line Linux) - disabled FAST_SHARE_MODES by default in Linux as older Linux boxes can't do shared writeable mappings. We really need autoconf ... - added new option types in loadparm so a string type can be specified ot be uppercase only, this is used for the workgroup and netbios name options - auto-create the lock directory if it doesn't exist in shared mem startup - get rid of announce_backup() - change a few comments in nmbd code - rewrote the chaining code completely. Hopefully it will handle any depth chains now. - added LPRng support
* - changed some debug levels in clientutil.cAndrew Tridgell1996-06-051-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - added dir_check_ftype() to clean up the file type checking a bit - added check for libc version >= 5 for setfsuid() for Linux - moved the AM_MASTER() and related macros to nameserv.h - added proper defines for the various netbios announce types - don't call the announce_backup() code, as I'm pretty sure its wrong it sent ANN_GetBackupListReq packets as broadcasts, they are supposed to be used only by clients to the master browser to find a list of available backup servers to remote a netserverenum to, I don't think nmbd should ever send one. - fixed a bug in the browse list writing - minor debug cleanups - put in the code to discard our own broadcasts (it won't work for multi-homed hosts though) - changed ELECTION_VERSION to 1 so we can be beaten by a NT 3.51 server by lowering the os level. - only do sync_browse_lists() if we are the master browser, otherwise we'll cause network overload - don't call tell_become_backup() as it appears to be badly broken, it should only be used when the machine being told has its MAINTAIN_LIST to to auto. Not calling it does no great harm anyway - fix a nasty bug where becomebackup was confused with reset browser! - make setbuffer() not get caught by the auto protototypes
* a huge pile of changes :-)Andrew Tridgell1996-06-041-0/+1029
The biggest thing is the integration of Lukes new nmbd. Its still largely untested, so we will really need some feedback I've also added auto prototype generation and cleaned up a lot of minor things as a result