*
*/
typedef int (*smbc_add_cached_srv_fn) (SMBCCTX * c, SMBCSRV *srv,
- char * server, char * share,
- char * workgroup, char * username);
+ const char * server, const char * share,
+ const char * workgroup, const char * username);
/**@ingroup callback
* @return pointer to SMBCSRV on success. NULL on failure.
*
*/
-typedef SMBCSRV * (*smbc_get_cached_srv_fn) (SMBCCTX * c, char * server,
- char * share, char * workgroup, char * username);
+typedef SMBCSRV * (*smbc_get_cached_srv_fn) (SMBCCTX * c, const char * server,
+ const char * share, const char * workgroup,
+ const char * username);
/**@ingroup callback
* This function is only used if the external cache is not enabled
*/
static int smbc_add_cached_server(SMBCCTX * context, SMBCSRV * new,
- char * server, char * share,
- char * workgroup, char * username)
+ const char * server, const char * share,
+ const char * workgroup, const char * username)
{
struct smbc_server_cache * srvcache = NULL;
* returns server_fd on success, -1 on error (not found)
* This function is only used if the external cache is not enabled
*/
-static SMBCSRV * smbc_get_cached_server(SMBCCTX * context, char * server,
- char * share, char * workgroup, char * user)
+static SMBCSRV * smbc_get_cached_server(SMBCCTX * context, const char * server,
+ const char * share, const char * workgroup, const char * user)
{
struct smbc_server_cache * srv = NULL;
*/
SMBCSRV *smbc_server(SMBCCTX *context,
- char *server, char *share,
+ const char *server, const char *share,
char *workgroup, char *username,
char *password)
{
int auth_called = 0;
struct cli_state c;
struct nmb_name called, calling;
- char *p, *server_n = server;
+ char *p;
+ const char *server_n = server;
fstring group;
pstring ipenv;
struct in_addr ip;
if (!context || !context->internal ||
!context->internal->_initialized) {
- fprintf(stderr, "no valid context\n");
+ DEBUG(4, ("no valid context\n"));
errno = EINVAL;
return NULL;
}
if (!fname) {
- fprintf(stderr, "no valid fname\n");
+ DEBUG(4, ("no valid fname\n"));
errno = EINVAL;
return NULL;
}
if (smbc_parse_path(context, fname, server, share, path, user, password)) {
- fprintf(stderr, "no valid path\n");
+ DEBUG(4, ("no valid path\n"));
errno = EINVAL;
return NULL;
}
- fprintf(stderr, "parsed path: fname='%s' server='%s' share='%s' path='%s'\n", fname, server, share, path);
+ DEBUG(4, ("parsed path: fname='%s' server='%s' share='%s' path='%s'\n", fname, server, share, path));
if (user[0] == (char)0) fstrcpy(user, context->user);
if (server[0] == (char)0) {
struct in_addr server_ip;
- fprintf(stderr, "empty server\n");
+ DEBUG(4, ("empty server\n"));
if (share[0] != (char)0 || path[0] != (char)0) {
- fprintf(stderr, "share %d path %d\n", share[0], path[0]);
+ DEBUG(4,("share %d path %d\n", share[0], path[0]));
errno = EINVAL;
if (dir) {
SAFE_FREE(dir->fname);
slprintf(context->netbios_name, 16, "smbc%s%d", context->user, pid);
}
}
- DEBUG(0,("Using netbios name %s.\n", context->netbios_name));
+ DEBUG(1,("Using netbios name %s.\n", context->netbios_name));
if (!context->workgroup) {
context->workgroup = strdup("samba");
}
}
- DEBUG(0,("Using workgroup %s.\n", context->workgroup));
+ DEBUG(1,("Using workgroup %s.\n", context->workgroup));
/* shortest timeout is 1 second */
if (context->timeout > 0 && context->timeout < 1000)