summaryrefslogtreecommitdiffstats
path: root/source/libsmb
Commit message (Collapse)AuthorAgeFilesLines
* s3/libsmb: Fix typo in error message.Karolin Seeger2009-08-101-1/+1
| | | | | | | | | Thanks to Herb Lewis <hlewis [at] panasas.com> for noticing! Was commit 095f66b0 in master. Karolin (cherry picked from commit 0839aeb2c583272b041c5a3ebe762c33bc8245f4)
* s3-credentials: protect netlogon_creds_server_step() against NULL creds.Guenther Deschner2009-06-021-0/+4
| | | | | | | Found by SCHANNEL torture tests. Guenther (cherry picked from commit c578c66569eed3ae19b42c9787399eb70b935e0a)
* When doing a cli_ulogoff don't invalidate the cnum, invalidate the vuid.Jeremy Allison2009-04-171-1/+1
| | | | | Jeremy. (cherry picked from commit 72f55ca71c2d9b4c24866b7e1418fa4c17948db6)
* [Bug 6228] SMBC_open_ctx failure due to path resolve failure doesn't set errnoDerrell Lipman2009-03-303-1/+15
| | | | | | | | | | | | | Fixed. It turns out there were a number of places where cli_resolve_path() was called and the error path upon that function failing did not set errno. There were a couple of places the failure handling code did set errno to ENOENT, so I made them all consistent, although I think better errno choices for this condition exist, e.g. EHOSTUNREACH. Derrell (cherry picked from commit f4e68b09a6ba30d968bccfad8bf6b67b4456b111)
* s3: parse_packet can return NULL which is then dereferenced in ↵Tim Prouty2009-03-271-0/+4
| | | | | | match_mailslot_name (cherry picked from commit d097e3f918853cf642c4a51f6ed3a4d8c85d283e)
* Fix two memleaks in the encryption codeVolker Lendecke2009-03-271-1/+2
| | | | | | | | | | | ntlmssp_seal_packet creates its own signature data blob, which we then have to free. Jeremy, please check and merge appropriately (Yes, I'm asking you to do the janitor work, I want you to *look* at this :-)) Volker (cherry picked from commit 525af716cd52500a4e3dccf9eeb9ea85f86be7ca)
* s3:dsgetdcname: use parentheses in if condition to make negation clearBjörn Jacke2009-03-271-1/+1
| | | | | | Signed-off-by: Günther Deschner <gd@samba.org> (cherry picked from commit 87b428e424e2e3cca975ecd0efed327e72950a1d) (cherry picked from commit ca58d12b6513beb40c14fcab2758cf21af0179f3)
* s3-krb5: Fix Coverity #722 (RESOURCE_LEAK).Günther Deschner2009-03-271-12/+18
| | | | | | | Guenther (cherry picked from commit 1524abd8bf12d82e1fb0063585fc9a465fc7bf9c) (cherry picked from commit 3517388b5d5439ffe3f9629aaf826fa1dfbb4ba7) (cherry picked from commit 5ce5a9bea994d7db3d352d0800333d0fd0b833df)
* s3:libsmb: fix smb signing for fragmented trans/trans2/nttrans requestsStefan Metzmacher2009-03-271-23/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Before we send the secondary requests we need to remove the old mid=>seqnum mapping and reset cli->mid and make the new mid=>seqnum mapping "persistent". The bug we had in cli_send_trans was this: The first cli_send_smb() incremented cli->mid and the secondary requests used the incremented mid, but as cli->outbuf still had the correct mid, we send the correct mid to the server. The real problem was that the cli_send_smb() function stored the seqnum under the wrong mid. cli_send_nttrans() was totally broken and now follows the same logic as cli_send_trans(). The good thing is that in practice the problem is unlikely to happen, because max_xmit is large enough to avoid secondary requests. metze (cherry picked from commit 880fbc4e8cd67de73c4bcda94489eb1e1422a04b) (cherry picked from commit 70466990b4b7c68ae95dbbcf741cd3f41f2dd0b3) (cherry picked from commit d01cca5e3ddb925696d49a1ea728013ec1032372) (cherry picked from commit 6c13360e195189f7afc70c5fda6ef27f46145b0b)
* Allow DFS client paths to work when POSIX pathnames have beenJeremy Allison2009-03-271-2/+12
| | | | | | selected (we need to path in pathname /that/look/like/this). Jeremy. (cherry picked from commit 0c11c2deee7ab9d281df6df91b793b7f1c1764a4)
* Fix a malloc/talloc mismatch when cli_initialise() failsVolker Lendecke2009-03-271-1/+1
| | | | (cherry picked from commit 20d378eebfcaca53f456f0fbae39d46031729de7)
* Gah, typo :-(. Sorry.Jeremy Allison2009-03-271-1/+1
| | | | (cherry picked from commit 301b23cf22ce1db04781b85954155fc93f4caee3)
* Fix coverity CID-602. Possible use of uninitialized var.Jeremy Allison2009-03-271-1/+1
| | | | | Jeremy. (cherry picked from commit 3b9874721ee8585e45b60246105fa380db132ac2)
* Don't miss an absolute pathname as a kerberos keytab path. From Glenn Machin ↵Jeremy Allison2009-03-271-0/+5
| | | | | | | <gmachin@sandia.gov>. Jeremy. (cherry picked from commit 9974c09608d61244133eea8615c37184b0cac57b)
* Probably fixes a crash during name resolution when log level >= 10Ted Percival2009-03-271-1/+1
| | | | | | and libc segfaults if printf is passed NULL for a "%s" arg (eg. Solaris). (cherry picked from commit 268be70cecd5025b0512372cff572095be763af1)
* Fix a valgrind error when the socket diesVolker Lendecke2009-01-291-2/+3
| | | | | | Don't reference anything that might have been deleted in the async_req_error call. (cherry picked from commit 8e7d0cf27cf9eb18be497d13bd0dbbe1d76b97a0)
* Determine case sensitivity based on file system attributes.Derrell Lipman2009-01-283-11/+78
| | | | | | | | | | | - Most of the time, we can determine from the file system we're connecting to whether it supports case sensitivity. In those cases, we now set the internal case sensitivity flag automatically. For those cases where the request to retrieve file system attributes fails, we'll use the user-specified option value. Derrell (cherry picked from commit ded86426c222b11b9c2e8d8e4cae5ed0eff19edd)
* [Bug 6022] smbc_urlencode and smbc_urldecode were not exportedDerrell Lipman2009-01-282-5/+5
| | | | | | | | | | | - Since the revamp of libsmbclient, there has still been an external declaration for smbc_urlencode and smbc_urldecode in libsmbclient.h, yet those functions were renamed and made private. The two choices were to remove the function names from libsmbclient.h or to make them public again. The reported requested that they be public. This commit makes it so. Derrell (cherry picked from commit 91d30b8a3406d01b5fca97a96ad5964703813f0e)
* Treat file names in POSIX-like case-sensitive fashion by defaultDerrell Lipman2009-01-283-1/+23
| | | | | | | | | | | | | | | | *** THIS COMMIT CAUSES A CHANGE OF DEFAULT BEHAVIOR IN libsmbclient!!! *** - libsmbclient now calls cli_set_case_sensitive() for a new CLI. By default, it requests case-sensitive, but the old behavior of case-insensitive can be requested with smbc_setOptionCaseSensitive(context, False); The change of behavior is considered a bug fix, as it was previously possible to accidentally overwrite a file that had the same case-insensitive name but a different case-sensitive name as a previously-existing file, while creating a new file. Derrell (cherry picked from commit ac4baafeb8d74bf1db7f2ce84b2bc3abdef90337)
* Fix a segfault if ? is there but the options are NULL. This is the case if ↵Andreas Schneider2009-01-281-1/+1
| | | | | | SMBC_parse_path is called by SMBC_stat_ctx. (cherry picked from commit d9f66f3e3d9af9c3323029207e62391f382632e9)
* s3:libsmb: handle the smb signing states the same in the krb5 and ntlmssp casesStefan Metzmacher2009-01-281-16/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | SMB signing works the same regardless of the used auth mech. We need to start with the temp signing ("BSRSPYL ") and the session setup response with NT_STATUS_OK is the first signed packet. Now we set the krb5 session key if we got the NT_STATUS_OK from the server and then recheck the packet. All this is needed to make the fallback from krb5 to ntlmssp possible. This commit also resets the cli->vuid value to 0, if the krb5 auth didn't succeed. Otherwise the server handles NTLMSSP packets as krb5 packets. The restructuring of the SMB signing code is needed to make sure the krb5 code only starts the signing engine on success. Otherwise the NTLMSSP fallback could not initialize the signing engine (again). metze (cherry picked from commit 7d9fd64f38aa5821b38c1223cf87979fc87bfb71) (cherry picked from commit 8e29070ccd0b5103af2e6da75644169f46700313) (cherry picked from commit 38b297f99ec166e5c40ba33774222b37b45b4fec)
* Fix bug #6021 - smbclient du command does not recuse properlyJeremy Allison2009-01-281-1/+2
| | | | | Jeremy. (cherry picked from commit f21a6d66f0bde933e5bf8cf673fc380e5dd52793)
* Attempt to fix bug 5953: Make cli_send_smb_direct_writeX use writevVolker Lendecke2009-01-281-27/+13
| | | | | | | It seems there are SMB servers around which can't cope with the write header being sent in a packet of its own. With writev we keep the advantage of direct writes, giving the kernel the chance to coalesce the write calls. (cherry picked from commit 75b5b7b2664e4d55aa97418f42a415fd88d3d4bd)
* Fix a valgrind errorVolker Lendecke2009-01-281-1/+2
| | | | | | | | | | | Reported by naga_kishore_kommuri@yahoo.com Derrel, please check! Thanks, Volker (cherry picked from commit 3356b95f72e26ede4ab16a12c334be90b8b1a639)
* (Fixed) Final part of fix for bug #5953 - smbclient crashes: cli_list_new ↵Kai Blin2009-01-281-4/+5
| | | | | | segmentation fault (with NAS-BASIC server). (cherry picked from commit b1727bbc7416f1a752cb1aadaff718e66f4a4381)
* Revert "Final part of fix for bug #5953 - smbclient crashes: cli_list_new ↵Jeremy Allison2009-01-281-24/+683
| | | | | | | | | segmentation fault (with NASBASIC server)." Error in commit ! This reverts commit 10e7d6b428c6e44f8b95c2794154dc1bfe4bde2d. (cherry picked from commit bfc4c75c340e3182b5a9572763fcf8c004ec2eed)
* Final part of fix for bug #5953 - smbclient crashes: cli_list_new ↵Kai Blin2009-01-281-683/+24
| | | | | | segmentation fault (with NASBASIC server). (cherry picked from commit 10e7d6b428c6e44f8b95c2794154dc1bfe4bde2d)
* commit b520befe6f51644d20434add9864d7a2fa30aa2eSATOH Fumiyasu2009-01-281-6/+4
| | | | | | | | | | | | | | Author: SATOH Fumiyasu <fumiyas@osstech.co.jp> Date: Wed Dec 17 00:42:25 2008 +0900 libsmbclient: Fix SIGBUS on non-x86 CPUs We must align the struct smbc_dirent in the struct SMBC_internal_data because the struct smbc_dirent has numeric values that require alignment. Signed-off-by: Derrell Lipman <derrell.lipman@unwireduniverse.com> (cherry picked from commit 3f47eb787f5b8499e5580407dc84c904db70b725)
* s3:dsgetdcname: retry with the clients siteStefan Metzmacher2009-01-281-6/+43
| | | | | | | metze (cherry picked from commit 1b7b0e924f3064a9774fd5d46bedc3d342b39ddb) (cherry picked from commit f7a811f2ae3572791035014b6e20410b07ea011e) (cherry picked from commit 3d2fe303830c0c1e425f6279a1625a56a27abd07)
* s3:libsmb/namequery.c: add saf_join_store() functionStefan Metzmacher2009-01-281-3/+65
| | | | | | | | | | | | | | | saf_join_store() should be called after a successful domain join, the affinity to the dc used at join time has a larger ttl, to avoid problems with delayed replication. metze Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Günther Deschner <gd@samba.org> (cherry picked from commit 80e74a27c55c01221091e3eec930c2ac4433c22c) (cherry picked from commit 895c40d03a07182c054a6fd857e7dd6838e698f4) (cherry picked from commit 7b56268b3c9652e3089bd75e4e51dd626fa742a6) (cherry picked from commit 6ee994e2d25d14b31dc9de75264e94a9ac6a09d4)
* s3: libsmb/namequery: fallback to returning all dcs, when none is available ↵Stefan Metzmacher2009-01-281-0/+9
| | | | | | | | | | | | | | | | | in the requested site It could happen that all dcs in a site are unavailable (some sites have only one dc) and then we need to fallback to get all dcs. metze Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Günther Deschner <gd@samba.org> (cherry picked from commit c127367b1dd622eeceb1f47de0a047c297dda222) (cherry picked from commit 0c43f96330f2935805ba4f0f8f858a027a90bc4c) (cherry picked from commit caaf59383ceabdc555f7db098dae0455dea65023) (cherry picked from commit 8321caf35736401d2a0d53cefc5c432d5b9e2bc7)
* Fix bug #5953 - smbclient crashes: cli_list_new segmentation fault.Jeremy Allison2008-12-091-1/+1
| | | | | | Karolin: must be in 3.2-stable. Thanks, Jeremy. (cherry picked from commit 00af69227dbdd6dfd3776b5cb52f479c9c85b697)
* Fix for crash bug freeing a non-malloc'ed buffer if the client sends a ↵Volker Lendecke2008-12-091-0/+7
| | | | | | non-encrypted packet with the crypto state set. (cherry picked from commit c2012ac787c05361c7fa9589bec4f7e5c6482a28)
* Change sockaddr util function names for consistency and to eliminate name ↵Tim Prouty2008-12-095-13/+13
| | | | | | conflicts (cherry picked from commit 10dd8a54ea7ea2cf86de5e20a62912298e0c4acc)
* libsmb: Fix up pointer passed to cli_send_trans in cli_link_internalKai Blin2008-12-091-1/+1
| | | | | | Seems like this one fell victim to the pstring removal. The other callers seem to be fine, even though removing the casts would make the code less confusing. (cherry picked from commit aa26b0aa3d913b09ead97c2c0bbfade0dddcd251)
* fix build warning.Günther Deschner2008-12-091-2/+5
| | | | | | | Guenther (This used to be commit 507660706901a79544d436046127947e4baa7e52) (cherry picked from commit 1939177582867fb54a416f3ea979ebd8d4335885) (cherry picked from commit 3fdf541b282805bc59ade8eb9a66c216f035f714)
* Error return is boolean false, not -1Derrell Lipman2008-12-091-3/+3
| | | | | | | | | | | | | - There were a few places in SMBC_getatr() that returned -1 instead of a boolean. -1 was intended to mean error, but that's what False/false is for, and the usages of this function assume that it returns a boolean false as the error condition. - per Jelmer's request, use false vs. False in new code, even if not making changes globally. Derrell (cherry picked from commit 623391308f3fb26fdc2515baf41bb57ac1e5fc96)
* Fix an uninitialized variable warningVolker Lendecke2008-12-091-0/+2
| | | | | | Not sure if we can ever not get domain and dns_domain, but gcc complained (cherry picked from commit e56b0b947a5c357c4e84b330c38d7a7f569be201) (cherry picked from commit 2e65d8bce755ddfa35bae5ad4c5107db7e18515a)
* Revert "Fix an uninitialized variable warning"Karolin Seeger2008-11-171-2/+0
| | | | This reverts commit 2e65d8bce755ddfa35bae5ad4c5107db7e18515a.
* Fix an uninitialized variable warningVolker Lendecke2008-10-061-0/+2
| | | | | Not sure if we can ever not get domain and dns_domain, but gcc complained (cherry picked from commit e56b0b947a5c357c4e84b330c38d7a7f569be201)
* Fix bug #5751 cannot show ACLs on DFS reported by SATOH Fumiyasu ↵Jeremy Allison2008-09-151-34/+55
| | | | | | | | <fumiyas@osstech.co.jp>. Fix for smbclient and libsmbclient. Jeremy. (cherry picked from commit 71d00ef2888834ebed2a387a111a95bac1d227ad)
* Fix blocker bug 5745 kerberos authentication with (lib)smbclient is broken.Jeremy Allison2008-09-111-8/+13
| | | | | Jeremy. (cherry picked from commit 738729cad0b88a2f453d61d38e1088003afd0a9e)
* Do proper error handling if the socket is closedVolker Lendecke2008-09-081-2/+8
| | | | | | | | | This is a step in fixing bug 5707. Thanks to Igor Galić <i.galic@brainsware.org> for reporting! Volker (cherry picked from commit 1558a5c1977b1f87600ec487238fa8db009f41fd)
* Correct the netsamlogon_clear_cached_user function.Ephi Dror2008-08-281-36/+18
| | | | (cherry picked from commit 85dd9c64ca2ffa31d02ee10a3745fd596e80786e)
* Fix Bug #5710 and make machine account password changing work again.Günther Deschner2008-08-281-23/+52
| | | | | | | | | | When we negotiated NETLOGON_NEG_PASSWORD_SET2 we need to use NetrServerPasswordSet2 to change the machine password. Tested with NT4, W2k, W2k3 and W2k8. Guenther (cherry picked from commit 8ae7040a5e64f1a1d2088aeca1dab90470455d8a)
* Revert "Fix Bug #5710 and make machine account password changing work again."Karolin Seeger2008-08-271-52/+23
| | | | This reverts commit 6d42b1e372b67eba83dbd5200bfb131b74cac180.
* Fix Bug #5710 and make machine account password changing work again.Günther Deschner2008-08-221-23/+52
| | | | | | | | | | When we negotiated NETLOGON_NEG_PASSWORD_SET2 we need to use NetrServerPasswordSet2 to change the machine password. Tested with NT4, W2k, W2k3 and W2k8. Guenther (cherry picked from commit 8ae7040a5e64f1a1d2088aeca1dab90470455d8a)
* Fix length error in wrapping spnego blob. Karoling this needs to be in 3.2.2 ↵samba-3.2.2Igor Mammedov2008-08-191-1/+1
| | | | | | (sorry). (cherry picked from commit e2caa65a698ca7109aa44656ff9399104cf0663b)
* Prevent NT_STATUS 0xF1000000 errors from appearing whenJim McDonough2008-08-141-0/+6
| | | | | | | dos errors are used and there is no error. It should be mapped directly to NT_STATUS_OK. smbclient to older servers didn't work. (cherry picked from commit 43054b199cb2a5f12c8e0c2bb14cf2328a945152)
* Fix bug 5686 - libsmbclient segfaults with more than one SMBCCTX.Jeremy Allison2008-08-131-22/+16
| | | | | | | | | | Here is a patch to allow many subsystems to be re-initialized. The only functional change I made was to remove the null context tracking, as the memory allocated here is designed to be left for the complete lifetime of the program. Freeing this early (when all smb contexts are destroyed) could crash other users of talloc. Jeremy. (cherry picked from commit 4779f1efccc8364fd8b3ba446aa96ba0bddec689)