summaryrefslogtreecommitdiffstats
path: root/source/libsmb/clientgen.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix up some of the SMB signing code:Andrew Bartlett2002-06-161-2/+1
| | | | | | | | | | | | | The problem was that *all* packets were being signed, even packets before signing was set up. (This broke the session request). This fixes it to be an 'opt in' measure - that is, we only attempt to sign things after we have got a valid, non-guest session setup as per the CIFS spec. I've not tested this against an MS server, becouse my VMware is down, but at least it doesn't break the build farm any more. Andrew Bartlett
* Fix spelling typo.Jeremy Allison2002-06-141-2/+2
| | | | Jeremy.
* More of SMB signing for client - not yet finished (should be harmless).Jeremy Allison2002-06-141-9/+14
| | | | Jeremy.
* Move client_receive_smb to clientgen.c as a static, as proposed by Elrond.Andrew Bartlett2002-05-181-0/+35
| | | | | | | | | (only function that used it was unused, and this helps bring TNG and HEAD closer) Its also cleaner. Andrew Bartlett
* This removes --with-ssl from Samba.Andrew Bartlett2002-05-171-4/+0
| | | | | | | | | | | | | | | | | This option was badly maintained, useless and confused our users and distirbutors. (its SSL, therfore it must be good...) No windows client uses this protocol without help from an SSL tunnel. I can't see any reason why setting up a unix-side SSL wrapper would be any more difficult than the > 10 config options this mess added to samba in any case. On the Samba client end, I think the LIBSMB_PROG hack should be sufficient to start stunnel on the unix side. We might extend this to take %i and %p (IP and port) if there is demand. Andrew Bartlett
* Another comment fix for mirmirAndrew Bartlett2002-03-011-1/+1
|
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Name another talloc.Andrew Bartlett2002-01-281-1/+1
|
* Same fix as went into 2.2 (I'm waiting for jerry to finish some code).Jeremy Allison2002-01-111-1/+1
| | | | Jeremy.
* prevent a memory leak of cli structuresAndrew Tridgell2001-11-271-1/+7
|
* Add a new torture test to extract a NT->DOS error map from an NT member of aAndrew Bartlett2001-11-251-0/+7
| | | | | | | | | samba domain. The PDC must be running a special authenticaion module that spits out NT errors based on username. Andrew Bartlett
* One more patch from Tom Jansen. Hope I didn't break the tree :-)Richard Sharpe2001-11-211-0/+7
|
* Close the socket and set the file descriptor to -1 if there was a socketTim Potter2001-11-141-0/+9
| | | | error in cli_receive_smb() and cli_send_smb().
* Removed the "reestablish" code. Tridge - scream if this was needed....Jeremy Allison2001-11-141-9/+2
| | | | Jeremy.
* Parionia to ensure people don't install libsmb based programs setuid root.Andrew Bartlett2001-10-311-0/+6
| | | | | | | libsmb has not been written to be setuid, with things like LIBSMB_PROG allowing all sort of fun and games. Andrew Bartlett
* a quick fix to get rpcclient working again. This just disablesAndrew Tridgell2001-10-221-1/+4
| | | | | | | NTLMSSP in cli_establish_connection() What we really need to do is kill off the pwd_cache code. It is horrible, and assumes the challenge comes in the negprot reply.
* added basic NTLMSSP support in smbd. This is still quite rough, andAndrew Tridgell2001-10-171-1/+1
| | | | | | loses things like username mapping. I wanted to get this in then discuss it a bit to see how we want to split up the existing session setup code
* added NTLMSSP authentication to libsmb. It seems to work well so I have ↵Andrew Tridgell2001-10-121-4/+1
| | | | enabled it by default if the server supports it. Let me know if this breaks anything. Choose kerberos with the -k flag to smbclient, otherwise it will use SPNEGO/NTLMSSP/NTLM
* initial kerberos/ADS/SPNEGO support in libsmb and smbclient. ToAndrew Tridgell2001-10-111-3/+9
| | | | | | | | | | activate you need to: - install krb5 libraries - run configure - build smbclient - run kinit to get a TGT - run smbclient with the -k option to choose kerberos auth
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-4/+0
|
* move to SAFE_FREE()Simo Sorce2001-09-171-11/+5
|
* converted smbd to use NTSTATUS by defaultAndrew Tridgell2001-08-271-0/+3
| | | | | | | | | | | | | | | | major changes include: - added NSTATUS type - added automatic mapping between dos and nt error codes - changed all ERROR() calls to ERROR_DOS() and many to ERROR_NT() these calls auto-translate to the client error code system - got rid of the cached error code and the writebmpx code We eventually will need to also: - get rid of BOOL, so we don't lose error info - replace all ERROR_DOS() calls with ERROR_NT() calls but that is too much for one night
* fixed handling of 139/445 in clientsAndrew Tridgell2001-08-241-4/+2
|
* A rewrite of the error handling in the libsmb client code. I've separatedTim Potter2001-08-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | out the error handling into a bunch of separate functions rather than all being handled in one big function. Fetch error codes from the last received packet: void cli_dos_error(struct cli_state *cli, uint8 *eclass, uint32 *num); uint32 cli_nt_error(struct cli_state *); Convert errors to UNIX errno values: int cli_errno_from_dos(uint8 eclass, uint32 num); int cli_errno_from_nt(uint32 status); int cli_errno(struct cli_state *cli); Detect different kinds of errors: BOOL cli_is_dos_error(struct cli_state *cli); BOOL cli_is_nt_error(struct cli_state *cli); BOOL cli_is_error(struct cli_state *cli); This also means we now support CAP_STATUS32 as we can decode and understand NT errors instead of just DOS errors. Yay! Ported a whole bunch of files in libsmb to use this new API instead of the just the DOS error.
* Fixed another possible memleak in cli_initialise()Tim Potter2001-08-061-0/+6
|
* Cleaned up error handling in cli_initialise() to fix a memleak found byTim Potter2001-08-061-10/+14
| | | | Claudia Moroder <claudiamoroder@st-ulrich.suedtirol.net>
* added a oplock break handler hook to the client code, this allows for more ↵Andrew Tridgell2001-06-181-47/+7
| | | | complete testing of oplocks from smbtorture and would also be essential if a client app ever really did want to use oplocks properly
* Zero fnum when initialising a cli_state.Tim Potter2001-05-041-0/+2
|
* the unicode conversion of our client code is complete enough to beAndrew Tridgell2001-02-211-12/+1
| | | | | | enabled by default you can disable it by setting the environment variable CLI_FORCE_ASCII
* - neater setting of bccAndrew Tridgell2001-02-201-0/+7
| | | | - converted cli_rename and cli_unlink
* initial client side unicode support (needed for netapp filer)Andrew Tridgell2001-02-201-1/+17
| | | | | | | | | | | | | | | I've currently got this code disabled by default as it is incomplete. You enable it by setting a USE_UNICODE environment variable. Once the support is complete this check will be removed and the CAP_UNICODE capability bit will be the sole determination of whether the client library code uses unicode right now I have converted session_setup and tconx. I will do more fns over the next few days. see clistr.c for the new client side string interface. Luckily it tends to make the code smaller and neater while adding unicode support.
* Fixed memory leaks in lsa_XX calls. Fixed memory leaks in smbcacls. MergedJeremy Allison2000-12-151-2/+2
| | | | | | in fixes from appliance-head and 2.2. Fixed multiple connection.tdb open problem. Jeremy.
* Ok - fixed a bug in our levelII oplock code. We need to break a level II onJeremy Allison2000-11-161-1/+10
| | | | | | | | | 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.
* Ok - this is a *BIG* change - but it fixes the problems with static stringsJeremy Allison2000-07-271-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | in the RPC code. This change was prompted by trying to save a long (>256) character comment in the printer properties page. The new system associates a TALLOC_CTX with the pipe struct, and frees the pool on return of a complete PDU. A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx code, and is freed in the main loop. This code works with insure, and seems to be free of memory leaks and crashes (so far) but there are probably the occasional problem with code that uses UNISTRxx structs on the stack and expects them to contain storage without doing a init_unistrXX(). This means that rpcclient will probably be horribly broken. A TALLOC_CTX also needed associating with the struct cli_state also, to make the prs_xx code there work. The main interface change is the addition of a TALLOC_CTX to the prs_init calls - used for dynamic allocation in the prs_XXX calls. Now this is in place it should make dynamic allocation of all RPC memory on unmarshall *much* easier to fix. Jeremy.
* first pass at merging rpcclient from TNG to HEAD. You can get aGerald Carter2000-07-031-0/+17
| | | | | | | | | | semi-connection and a rpcclient prompt, but no functionality there yet. Will be a few more days on that. These files changed only with the addition of some support functions from TNG --jerry
* Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison2000-05-021-1/+1
| | | | | of doing a system call every time we want to just get our pid. Jeremy.
* split clientgen.c into several partsAndrew Tridgell2000-04-251-3061/+3
| | | | | the next step is splitting out the auth code, to make adding lukes NTLMSSP support easier
* finally got sick of the "extern int Client" code and the stupidAndrew Tridgell2000-04-111-7/+16
| | | | | | | | | | | | | | | | 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.
* Fix from christoph.pfisterer@rwg.de for large directory listing to OS/2Jeremy Allison2000-03-201-2/+2
| | | | | server. Jeremy.
* client/client.c:Jeremy Allison2000-02-251-3/+7
| | | | | | | libsmb/clientgen.c: Fixes for Win2k smbclient browsing. Other fixes implement smbpasswd -x user to delete users. Also allows swat to do the same. Jeremy.
* lib/system.c: Fixed gcc warnings.Jeremy Allison2000-02-231-2/+2
| | | | | | nmbd/nmbd_processlogon.c: Use "True" and "False" instead of 1 and 0. Others - preparing for multiple pdu write code. Jeremy.
* Not enough args to DEBUG statement.Tim Potter2000-02-151-1/+1
|
* Ooops. Fixed stupid typo with missing ! in cli error code.Jeremy Allison2000-02-141-1/+1
| | | | Jeremy.
* Correct for for core dump in smbpasswd with cli_errstr().Jeremy Allison2000-02-091-8/+22
| | | | Jeremy.<F4>plit the test for NetBIOS name being *SMBSERVER.
* Defensive programming for cli_error().Jeremy Allison2000-02-091-1/+7
| | | | Jeremy.
* fixed a formatting errorAndrew Tridgell2000-01-161-1/+1
|
* damn, Solaris already has a "enum lock_type"Andrew Tridgell2000-01-141-1/+1
| | | | changed it to "enum brl_type"
* we now pass all byte range locking testsAndrew Tridgell2000-01-141-4/+3
| | | | | the last piece was to use a smb timeout slightly larger than the locking timeout in bloking locks to prevent a race
* the lock routines now take a enumerated type for read/write locks, andAndrew Tridgell2000-01-131-4/+4
| | | | | | | | we now don't pass the lock type at all for unlocks. I was surprised to discover that NT totally ignores the lock type in unlocks. It unlocks a matching write lock if there is one, otherwise it removes the first matching read lock.
* I'm currently designing a new locking system (using a tdb database!)Andrew Tridgell2000-01-101-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that will make us match NT semantics exactly and do away with the horrible fd multiplexing in smbd. this is some diag stuff to get me started. - added the ability to do read or write locks in clientgen.c - added a LOCK4 test to smbtorture. This produces a report on the server and its locking capabilities. For example, NT4 gives this: the same process cannot set overlapping write locks the same process can set overlapping read locks a different connection cannot set overlapping write locks a different connection can set overlapping read locks a different pid cannot set overlapping write locks a different pid can set overlapping read locks the same process can set the same read lock twice the same process cannot set the same write lock twice the same process cannot override a read lock with a write lock the same process can override a write lock with a read lock a different pid cannot override a write lock with a read lock the same process cannot coalesce read locks this server does strict write locking this server does strict read locking whereas Samba currently gives this: the same process can set overlapping write locks the same process can set overlapping read locks a different connection cannot set overlapping write locks a different connection can set overlapping read locks a different pid can set overlapping write locks a different pid can set overlapping read locks the same process can set the same read lock twice the same process can set the same write lock twice the same process can override a read lock with a write lock the same process can override a write lock with a read lock a different pid can override a write lock with a read lock the same process can coalesce read locks this server does strict write locking this server does strict read locking win95 gives this - I don't understand why! the same process cannot set overlapping write locks the same process cannot set overlapping read locks a different connection cannot set overlapping write locks a different connection cannot set overlapping read locks a different pid cannot set overlapping write locks a different pid cannot set overlapping read locks the same process cannot set the same read lock twice the same process cannot set the same write lock twice the same process cannot override a read lock with a write lock the same process cannot override a write lock with a read lock a different pid cannot override a write lock with a read lock the same process cannot coalesce read locks this server does strict write locking this server does strict read locking