summaryrefslogtreecommitdiffstats
path: root/examples/libsmbclient
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug 5686 - libsmbclient segfaults with more than one SMBCCTX.Jeremy Allison2008-08-122-0/+21
| | | | | | | | | 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.
* Remove test changes added in error.Jeremy Allison2008-07-241-6/+1
| | | | Jeremy.
* Use sys_getgrnam not getgrnam. Pointed out by Herb.Jeremy Allison2008-07-241-2/+7
| | | | Jeremy.
* Add krb5 support for the testbrowse example.Andreas Schneider2008-06-242-1/+15
| | | | | | | Signed-off-by: Andreas Schneider <anschneider@suse.de> Signed-off-by: Derrell Lipman <derrell.lipman@unwireduniverse.com> (cherry picked from commit 84b1ea39a4f27ebcf06a2bafed78396c7353df0e) (cherry picked from commit c7d963191e1858000752ff57eac1501777f0ebda)
* man pages: Move 'smbsh' man page to the examples directory.Karolin Seeger2008-06-173-0/+475
| | | | | | | | | | smbsh.c is located in the examples directory. It does not make sense to install a man page without installing the tool itself. This fixes bug #4724. Karolin (cherry picked from commit 797ed744b15c94fa4831d9796b40bb0ab5df55b7)
* Missed a few 'deprecated' markersDerrell Lipman2008-03-031-1/+1
|
* Continued revamping of libsmbclient.Derrell Lipman2008-03-032-3/+3
| | | | | | | | | | | | | - James suggested using gcc's "deprecated" attribute to mark the context structure fields to generate warnings. This creates a scenario with the best of all worlds. I'm able to move to an organization that more easily allows future enhancements, while avoiding any mandatory changes by applications. Thanks, James! - Updated WHATSNEW.txt so that it accurately reflects the current state of affairs. Derrell
* Remove use of deprecated functionDerrell Lipman2008-03-025-8/+8
|
* Additional revamped libsmbclient documentationDerrell Lipman2008-03-011-13/+4
| | | | | | | | - Ensured that all public functions have documentation in libsmbclient.h - Reformatted for "proper" indentation - Re-added temporarily-disabled alternate authentication function capability Derrell
* Initial revamp of the libsmbclient interface.Derrell Lipman2008-03-013-14/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The libsmbclient interface has suffered from difficulty of improvement and feature enrichment without causing ABI breakage. Although there were a number of issues, the primary ones were: (a) the user of the library would manually manipulate the context structure members, meaning that nothing in the context structure could change other than adding stuff at the end; (b) there were three methods of setting options: setting bits in a flags field within the context structure, setting explicit options variables within an options structure in the context structure, and by calling the smbc_option_set() function; (c) the authentication callback did not traditionally provide enough information to the callee which required adding an option for a callback with a different signature, and now there are requests for even more information at the callback, requiring yet a third signature and option to set it (if we implement that feature). This commit provides a reorganization of the code which fixes (a) and (b). The context structure is now entirely opaque, and there are setter and getter functions for manipulating it. This makes maintaining ABI consistency much, much easier. Additionally, the options setting/getting has been unified into a single mechanism using smbc_option_set() and smbc_option_get(). Yet to be completed is a refactoring of the authentication callback (c). The test programs in examples/libsmbclient have been modified (if necessary; some applications require no changes at all) for the new API and a few have been minimally tested. Derrell
* add a test program for the new ftruncate functionalityDerrell Lipman2008-02-262-0/+87
|
* Add a program to test repeated calls to smbc_getxattr().Derrell Lipman2008-01-172-0/+67
|
* Add some additional libsmbclient test programs.Derrell Lipman2008-01-173-1/+158
| | | | | | | testwrite: create or truncate a file and write to it. teststat3: compare the results from smbc_stat() and smbc_fstat() Derrell
* Modify testread example to loop using same context.Derrell Lipman2008-01-161-42/+34
| | | | | | | | | | | There's been a problem seen where open/read/close a number of times causes open failures eventually. This program has been modified to create the context once and then loop requesting file names to open/read/close. This program also demonstrates the current error in cli_read() where it returns an error instead of length 0 upon end of file. Derrell
* Replace GetTimeOfDay() with gettimeofday() in example program.Derrell Lipman2008-01-161-3/+2
| | | | | GetTimeOfDay() seems to no longer be exported. For the smbsh example, just use the native gettimeofday() for now.
* Add a (very!) trivial cache to the example authentication callback.Derrell Lipman2008-01-161-1/+21
|
* Fix smbc_listxattr() and friends (bug #5189)Derrell Lipman2008-01-131-1/+26
| | | | | | | | | | When the capability of using full names for DOS attributes was added, a bug was introduced which caused the wrong number of bytes to be returned. This patch to smbc_listxattr_ctx() fixes the problem. Thanks to Jack Schmidt for this patch. Derrell
* Fix compile and linking errors since last this code was testedDerrell Lipman2008-01-133-2/+3
|
* Remove unused string.Günther Deschner2008-01-101-2/+2
| | | | Guenther
* Fix build warning for libsmbclient example.Günther Deschner2008-01-091-0/+2
| | | | Guenther
* r24388: - ACL retrieval provided incomplete information because the buffer ↵Derrell Lipman2007-10-101-4/+6
| | | | | | | | | | | | | | | | | | | | | | | pointer was incremented too far in some circumstances. In these cases, only the first of multiple concatenated strings would be seen. - Working on bug 4649 pertaining to delete an ACL, this fixes the reported crash. It appears to have been an incomplete switchover from malloc to talloc, as the memory was still being freed with SAFE_FREE. Deleting ACLs still doesn't work. Although a valid request is sent to the server and a SUCCESS response is returned, the method that's used in libsmbclient for deleting ACLs seems to be incorrect. In looking at the samba4 torture tests, it appears that we should be turning on the INHERIT flag if we want to delete the ACL. (I could use some assistance on the proper flags to send, from anyone familiar with this stuff.) - Apply patch from SATOH Fumiyasu to fix bug 4750. smbc_telldir_ctx() was not returning a value useful to smbc_lseekdir_ctx(). Derrell
* r23785: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-1010-20/+10
|
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-1010-10/+10
| | | | Jeremy.
* r22914: - Fixes bug 4599. A missing <code>if</code> statement forced ↵Derrell Lipman2007-10-102-0/+83
| | | | | | | | | | | | subseqeuent attempts to set attributes to fail. - I also noticed that missing attributes were setting an invalid return string by getxattr(), e.g. if there was not group, the return string had "GROUP:;" instead of excluding the GROUP attribute entirely as it should. The big problem with the way it was, is that the string could not then be passed to setxattr() and parsed.
* r22130: - Ensure that the libsmbclient example programs link with the ↵Derrell Lipman2007-10-101-10/+11
| | | | | | | libsmbclient library that's part of the current tree, not with whatever happens to have been previously installed.
* r18012: Should fix bug 4018.Derrell Lipman2007-10-101-0/+1
| | | | | NetApp filers expect paths in Open AndX Request to have a leading slash. Windows clients send the leading slash, so we should too.
* r18011: Should fix bug 3835.Derrell Lipman2007-10-101-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Jeremy: requires your eyes... If the remote connection timed out while cli_list() was retrieving its list of files, the error was not returned to the user, e.g. via smbc_opendir(), so the user didn't have a way to know to set the timeout longer and try again. This problem would occur when a very large directory is being read with a too-small timeout on the cli. Jeremy, although there were a couple of areas that needed to be handled, I needed to make one change that you should bless, in libsmb/clientgen.c. It was setting cli->smb_rw_error = smb_read_error; but smb_read_error is zero, so this had no effect. I'm now doing cli->smb_rw_error = READ_TIMEOUT; instead, and according to the OP, these (cumulative) changes (in a slightly different form) solve the problem. Please confirm this smb_rw_error change will have no other adverse effects that you can see. Derrell
* r18009: Fixes bug 4026.Derrell Lipman2007-10-101-2/+13
| | | | | | | | | | | | | | | | | | | | | This completes the work Jeremy began last week, disambiguating the meaning of c_time. (In POSIX terminology, c_time means "status Change time", not "create time".) All uses of c_time, a_time and m_time have now been replaced with change_time, access_time, and write_time, and when creation time is intended, create_time is used. Additionally, the capability of setting and retrieving the create time have been added to the smbc_setxattr() and smbc_getxattr() functions. An example of setting all four times can be seen with the program examples/libsmbclient/testacl with the following command line similar to: testacl -f -S "system.*:CREATE_TIME:1000000000,ACCESS_TIME:1000000060,WRITE_TIME:1000000120,CHANGE_TIME:1000000180" 'smb://server/share/testfile.txt' The -f option turns on the new mode which uses full time names in the attribute specification (e.g. ACCESS_TIME vs A_TIME).
* r16550: Fix bug 3866. Thanks for the report!Derrell Lipman2007-10-101-2/+2
| | | | | | | | | | | | | | | | | Although I've never met a computer or compiler that produced pointers to functions which are a different size than pointers to data, I suppose they probably exist. Assigning a pointer to a function is technically illegal in C anyway. Change casts of the option_value based on the option_name to use of variable argument lists. For binary compatibility, I've maintained but deprecated the old behavior of debug_stderr (which expected to be passed a NULL or non-NULL pointer) and added a new option debug_to_stderr which properly expects a boolean (int) parameter. Derrell
* r14664: r13868@cabra: derrell | 2006-03-22 17:04:30 -0500Derrell Lipman2007-10-102-3/+49
| | | | | | | | Implement enhancement request 3505. Two additional features are added here. There is now a method of saving an opaque user data handle in the smbc_ context, and there is now a way to request that the context be passed to the authentication function. See examples/libsmbclient/testbrowse.c for an example of using these features.
* r12852: r12150@cabra: derrell | 2006-01-11 13:21:14 -0500Derrell Lipman2007-10-101-30/+15
| | | | Although RTLD_NEXT was not working properly a number of years ago, it seems to be now. Replace dlopen(/lib/libc...) with direct use of RTLD_NEXT
* r12759: r12128@cabra: derrell | 2006-01-07 15:34:01 -0500Derrell Lipman2007-10-1010-287/+479
| | | | Incorporate a number of changes suggested by David Collier-Brown Thanks, David!
* r12757: r12126@cabra: derrell | 2006-01-03 15:21:36 -0500Derrell Lipman2007-10-101-2/+11
| | | | added flag to not request authentication information
* r12579: r12122@cabra: derrell | 2005-12-29 12:03:00 -0500Derrell Lipman2007-10-101-1/+1
| | | | allow for arbitrary option value types
* r12576: r12115@cabra: derrell | 2005-12-29 11:16:03 -0500Derrell Lipman2007-10-101-12/+34
| | | | bug (enhancement) #2651: add option to log debug messages to stderr instead of stdout
* r12468: r12033@cabra: derrell | 2005-12-24 21:03:45 -0500Derrell Lipman2007-10-101-0/+72
| | | | actually add the new test program
* r12467: r12029@cabra: derrell | 2005-12-24 20:25:59 -0500Derrell Lipman2007-10-102-1/+6
| | | | add another libsmbclient test program
* r12225: r11729@cabra: derrell | 2005-12-13 22:59:45 -0500Derrell Lipman2007-10-101-1/+1
| | | | | | | | | | | | | 1. Fix a crash bug which should have reared its ugly head ages ago, but for some reason, remained dormant until recently. The bug pertained to libsmbclient doing a structure assignment of a cli after having opened a pipe. The pipe open code makes a copy of the cli pointer that was passed to it. If the cli is later copied (and that cli pointer that was saved is no longer valid), the pipe code will cause a crash during shutdown or when the copied cli is closed. 2. The 'type' field in enumerated shares was not being set correctly with the new RPC-based mechanism for enumerating shares.
* r12098: r10797@cabra: derrell | 2005-12-06 12:09:00 -0500Derrell Lipman2007-10-102-0/+219
| | | | fixed another memory leak and reverted an (incorrect) fix from yesterday
* r12080: r10673@cabra: derrell | 2005-12-05 13:22:34 -0500Derrell Lipman2007-10-101-75/+163
| | | | | | Correct some memory and file descriptor leaks. This should fix bugs 3257, 3267 and 3273.
* r11130: r10092@cabra: derrell | 2005-10-17 15:29:03 -0400Derrell Lipman2007-10-101-0/+74
| | | | let's now actually add the new test file
* r11129: r10090@cabra: derrell | 2005-10-17 15:26:27 -0400Derrell Lipman2007-10-101-1/+6
| | | | added example to read a file and test download time
* r7168: Updating file times from libsmbclient was not working for win98. ↵Derrell Lipman2007-10-101-48/+3
| | | | | | | | | | | | | | Although the function that was being used to set attributes is a core protocol function (SMBsetatr = 0x09), it does not appear to work on win98. As a temporary measure, when file times are to be set, this version opens the file and uses SMBsetattrE = 0x22 instead. (The other advantage of this function over the original one is that it supports setting access time as well as modification time.) The next step, the proper solution if it can be made to work, is to write functions that use TRANS2_SET_PATH_INFO instead.
* r7156: file was missing; svn isn't smart enough to even notify me. sigh.Derrell Lipman2007-10-101-0/+52
|
* r7153: add better test facilities to testutimeDerrell Lipman2007-10-101-5/+5
|
* r6501: correct deprecated lvalue casts in testsuite/libsmbclientDerrell Lipman2007-10-101-1/+2
|
* r6157: 'editorial changes' to example codeDerrell Lipman2007-10-101-1/+2
|
* r6151: additional examples/tests for libsmbclientDerrell Lipman2007-10-104-12/+179
|
* r6149: Fixes bugs #2498 and 2484.Derrell Lipman2007-10-105-208/+16
| | | | | | | | | | | | | | | | | | 1. using smbc_getxattr() et al, one may now request all access control entities in the ACL without getting all other NT attributes. 2. added the ability to exclude specified attributes from the result set provided by smbc_getxattr() et al, when requesting all attributes, all NT attributes, or all DOS attributes. 3. eliminated all compiler warnings, including when --enable-developer compiler flags are in use. removed -Wcast-qual flag from list, as that is specifically to force warnings in the case of casting away qualifiers. Note: In the process of eliminating compiler warnings, a few nasties were discovered. In the file libads/sasl.c, PRIVATE kerberos interfaces are being used; and in libsmb/clikrb5.c, both PRIAVE and DEPRECATED kerberos interfaces are being used. Someone who knows kerberos should look at these and determine if there is an alternate method of accomplishing the task.
* r6126: added utility for testing smbc_stat()Derrell Lipman2007-10-103-11/+130
|