#include <sys/statvfs.h>
#include <stdint.h>
#include <fcntl.h>
+#include <time.h>
#include <utime.h>
#define SMBC_BASE_FD 10000 /* smallest file descriptor returned */
*/
typedef enum smbc_smb_encrypt_level
{
+ SMBC_ENCRYPTLEVEL_DEFAULT = -1,
SMBC_ENCRYPTLEVEL_NONE = 0,
SMBC_ENCRYPTLEVEL_REQUEST = 1,
SMBC_ENCRYPTLEVEL_REQUIRE = 2
const char * username);
/**@ingroup callback
- * Check if a server is still good
+ * Remove a cached server
*
* @param c pointer to smb context
*
void
smbc_setPort(SMBCCTX *c, uint16_t port);
+/** Get whether to enable POSIX extensions if available */
+smbc_bool
+smbc_getOptionPosixExtensions(SMBCCTX *c);
+/** Set whether to enable POSIX extensions if available */
+void
+smbc_setOptionPosixExtensions(SMBCCTX *c, smbc_bool b);
/***********************************
* Getters and setters for OPTIONS *
/**
* @brief Set the 'client min protocol' and the 'client max protocol'.
*
- * IMPORTANT: This overrrides the values 'client min protocol' and 'client max
+ * IMPORTANT: This overrides the values 'client min protocol' and 'client max
* protocol' set in the smb.conf file!
*
* @param[in] c The smbc context to use.
* @param shutdown_ctx If 1, all connections and files will be closed even if they are busy.
*
*
- * @return Returns 0 on succes. Returns 1 on failure with errno set:
+ * @return Returns 0 on success. Returns 1 on failure with errno set:
* - EBUSY Server connections are still used, Files are open or cache
* could not be purged
* - EBADF context == NULL
/**@ingroup misc
* Initialize the samba client library.
*
- * Must be called before using any of the smbclient API function
- *
- * @param fn The function that will be called to obtaion
- * authentication credentials.
- *
- * @param debug Allows caller to set the debug level. Can be
- * changed in smb.conf file. Allows caller to set
- * debugging if no smb.conf.
- *
- * @return 0 on success, < 0 on error with errno set:
- * - ENOMEM Out of memory
- * - ENOENT The smb.conf file would not load
- *
+ * @deprecated use smbc_init_context()
+ * @see smbc_init_context()
*/
-
+DEPRECATED_SMBC_INTERFACE
int smbc_init(smbc_get_auth_data_fn fn, int debug);
/**@ingroup misc
*
* @param fd Open file handle from smbc_open() or smbc_creat()
*
- * @param buf Pointer to buffer to recieve read data
+ * @param buf Pointer to buffer to receive read data
*
* @param bufsize Size of buf in bytes
*
struct smbc_dirent* smbc_readdir(unsigned int dh);
/**@ingroup directory
- * Works similar as smbc_readdir but returns more information about file.
+ * Works similar as smbc_readdir() but returns more information about file.
*
* @param dh Valid directory as returned by smbc_opendir()
*
const struct libsmb_file_info *smbc_readdirplus(unsigned int dh);
/**@ingroup directory
- * Works similar as smbc_readdirplus as well as fills up stat structure if
+ * Works similar as smbc_readdirplus() as well as fills up stat structure if
* provided.
*
* @param dh Valid directory as returned by smbc_opendir()
*
* @return The current location in the directory stream or -1
* if an error occur. The current location is not
- * an offset. Becuase of the implementation, it is a
+ * an offset. Because of the implementation, it is a
* handle that allows the library to find the entry
* later.
* - EBADF dh is not a valid directory handle
* @see smbc_telldir()
*
*
- * @todo In what does the reture and errno values mean?
+ * @todo In what does the return and errno values mean?
*/
int smbc_lseekdir(int fd, off_t offset);
* permissions of
*
* @param mode The permissions to set:
- * - Put good explaination of permissions here!
+ * - Put good explanation of permissions here!
*
* @return 0 on success, < 0 on error with errno set:
* - EPERM The effective UID does not match the owner
* - ENOMEM Insufficient was available.
* - ENOENT file or directory does not exist
*
- * @todo Actually implement this fuction?
+ * @todo Actually implement this function?
*
* @todo Are errno values complete and correct?
*/
* required to hold the attribute value will be returned,
* but nothing will be placed into the value buffer.
*
- * @return 0 on success, < 0 on error with errno set:
+ * @return size on success, < 0 on error with errno set:
* - EINVAL The client library is not properly initialized
* or one of the parameters is not of a correct
* form
* @param fname The URL of the print share to print to?
*
* @returns A file handle for the print file if successful.
- * Returns -1 if an error ocurred and errno has the values
+ * Returns -1 if an error occurred and errno has the values
* - EINVAL fname was NULL or smbc_init not called.
* - all errors returned by smbc_open
*
* @param srv pointer to server to remove
*
* @return On success, 0 is returned. 1 is returned if the server could not
- * be removed. Also useable outside libsmbclient.
+ * be removed. Also usable outside libsmbclient.
*/
int smbc_remove_unused_server(SMBCCTX * context, SMBCSRV * srv);
#endif
/**@ingroup misc
- * Set the users credentials globally so they can be used for DFS
- * referrals. Probably best to use this function in the smbc_get_auth_data_fn
- * callback.
- *
- * @param workgroup Workgroup of the user.
- *
- * @param user Username of user.
- *
- * @param password Password of user.
+ * @deprecated This interface has been deprecated use
+ * smbc_set_credentials_with_fallback() instead.
*
- * @param use_kerberos Whether to use Kerberos
- *
- * @param signing_state One of these strings (all equivalents on same line):
- * "off", "no", "false"
- * "on", "yes", "true", "auto"
- * "force", "required", "forced"
+ * @see smbc_set_credentials_with_fallback()
*/
-
+DEPRECATED_SMBC_INTERFACE
void
smbc_set_credentials(const char *workgroup,
const char *user,
smbc_bool use_kerberos,
const char *signing_state);
-/*
- * Wrapper around smbc_set_credentials.
- * Used to set correct credentials that will
- * be used to connect to DFS target share
- * in libsmbclient
+/**@ingroup misc
+ *
+ * Set the users credentials globally so they can be used for DFS
+ * referrals. Probably best to use this function in the smbc_get_auth_data_fn
+ * callback.
+ *
+ * @param ctx The smb context.
+ *
+ * @param workgroup Workgroup of the user.
+ *
+ * @param user Username of user.
+ *
+ * @param password Password of user.
*/
-
void
smbc_set_credentials_with_fallback(SMBCCTX *ctx,
const char *workgroup,
*
* @param lock_mutex
* Lock a mutex. This function should expect three parameters: plock,
- * lock_type, and location. The mutex aassociated with identifier plock
+ * lock_type, and location. The mutex associated with identifier plock
* should be locked if lock_type is 1, and unlocked if lock_type is 2. The
* location parameter can be used for debugging, as it contains the
* compiler-provided __location__ of the call.