--- /dev/null
+
+# HG changeset patch
+# User Vincent Wagelaar <vincent@ricardis.tudelft.nl>
+# Date 1189265963 -7200
+# Node ID 5532758d3763bd2803a67686ccba9a7475148bc3
+# Parent 2ac3b0b1df1d13338544e26ff60473ccce75b803
+Add debug for write
+
+--- a/fusesmb.c Fri Sep 07 02:26:00 2007 +0200
++++ b/fusesmb.c Sat Sep 08 17:39:23 2007 +0200
+@@ -628,6 +628,7 @@ static int fusesmb_write(const char *pat
+ char smb_path[MY_MAXPATHLEN] = "smb:/";
+
+ strcat(smb_path, stripworkgroup(path));
++ debug("%s: size: %zd; offset: %lld", path, size, offset);
+
+ int tries = 0; //For number of retries before failing
+ ssize_t ssize; //Returned by ctx->read
+
--- /dev/null
+
+# HG changeset patch
+# User Vincent Wagelaar <vincent@ricardis.tudelft.nl>
+# Date 1195499691 -3600
+# Node ID bfe5900f95a82b60a488a75d73451e3130c8b9c5
+# Parent 36cbf3b25cb6712e00b517c0ee98177096ddf83e
+Free wg when context init fails patch by Evgeniy Dushistov
+
+--- a/cache.c Mon Nov 19 20:01:08 2007 +0100
++++ b/cache.c Mon Nov 19 20:14:51 2007 +0100
+@@ -286,13 +286,14 @@ static void *workgroup_listing_thread(vo
+
+ hash_t *ip_cache = hash_create(HASHCOUNT_T_MAX, NULL, NULL);
+ if (NULL == ip_cache)
+- return NULL;
+-
++ {
++ goto out;
++ }
+ stringlist_t *servers = sl_init();
+ if (NULL == servers)
+ {
+ fprintf(stderr, "Malloc failed\n");
+- return NULL;
++ goto out;
+ }
+ SMBCCTX *ctx = fusesmb_cache_new_context(&cfg);
+ SMBCFILE *dir;
+@@ -377,7 +378,9 @@ use_popen:
+ hash_destroy(ip_cache);
+ sl_free(servers);
+ smbc_free_context(ctx, 1);
+- return 0;
++out:
++ free(wg);
++ return NULL;
+ }
+
+
+@@ -552,6 +555,7 @@ int main(int argc, char *argv[])
+ cache_servers(ctx);
+ smbc_free_context(ctx, 1);
+ options_free(&opts);
++ config_free(&cfg);
+ if (argc == 1)
+ {
+ unlink(pidfile);
+
--- /dev/null
+
+# HG changeset patch
+# User Vincent Wagelaar <vincent@ricardis.tudelft.nl>
+# Date 1195499953 -3600
+# Node ID e5ab49358d539ecd07fb959e0d47c1d507c24d44
+# Parent bfe5900f95a82b60a488a75d73451e3130c8b9c5
+Add more debug statements
+
+--- a/fusesmb.c Mon Nov 19 20:14:51 2007 +0100
++++ b/fusesmb.c Mon Nov 19 20:19:13 2007 +0100
+@@ -362,6 +362,7 @@ static int fusesmb_opendir(const char *p
+ return 0;
+ SMBCFILE *dir;
+ char smb_path[MY_MAXPATHLEN] = "smb:/";
++ debug("%s", path);
+ strcat(smb_path, stripworkgroup(path));
+ pthread_mutex_lock(&ctx_mutex);
+ dir = ctx->opendir(ctx, smb_path);
+@@ -698,6 +699,7 @@ static int fusesmb_release(const char *p
+ static int fusesmb_release(const char *path, struct fuse_file_info *fi)
+ {
+ (void)path;
++ debug("%s", path);
+ pthread_mutex_lock(&rwd_ctx_mutex);
+ #ifdef HAVE_LIBSMBCLIENT_CLOSE_FN
+ rwd_ctx->close_fn(rwd_ctx, (SMBCFILE *)fi->fh);
+@@ -723,7 +725,7 @@ static int fusesmb_mknod(const char *pat
+ // return -EACCES;
+ if (slashcount(path) <= 3)
+ return -EACCES;
+-
++ debug("%s", path);
+ strcat(smb_path, stripworkgroup(path));
+ pthread_mutex_lock(&ctx_mutex);
+ if ((file = ctx->creat(ctx, smb_path, mode)) == NULL)
+@@ -769,10 +771,9 @@ static int fusesmb_unlink(const char *fi
+ static int fusesmb_unlink(const char *file)
+ {
+ char smb_path[MY_MAXPATHLEN] = "smb:/";
+-
++ debug("%s", file);
+ if (slashcount(file) <= 3)
+ return -EACCES;
+-
+ strcat(smb_path, stripworkgroup(file));
+ pthread_mutex_lock(&ctx_mutex);
+ if (ctx->unlink(ctx, smb_path) < 0)
+@@ -787,7 +788,7 @@ static int fusesmb_rmdir(const char *pat
+ static int fusesmb_rmdir(const char *path)
+ {
+ char smb_path[MY_MAXPATHLEN] = "smb:/";
+-
++ debug("%s", path);
+ if (slashcount(path) <= 3)
+ return -EACCES;
+
+@@ -806,7 +807,7 @@ static int fusesmb_mkdir(const char *pat
+ static int fusesmb_mkdir(const char *path, mode_t mode)
+ {
+ char smb_path[MY_MAXPATHLEN] = "smb:/";
+-
++ debug("%s", path);
+ if (slashcount(path) <= 3)
+ return -EACCES;
+
+@@ -866,6 +867,7 @@ static int fusesmb_utime(const char *pat
+
+ static int fusesmb_chmod(const char *path, mode_t mode)
+ {
++ debug("%s", path);
+ if (slashcount(path) <= 3)
+ return -EPERM;
+
+@@ -943,7 +945,7 @@ static int fusesmb_rename(const char *pa
+ {
+ char smb_path[MY_MAXPATHLEN] = "smb:/",
+ new_smb_path[MY_MAXPATHLEN] = "smb:/";
+-
++ debug("from: %s, to: %s", path, new_path);
+ if (slashcount(path) <= 3 || slashcount(new_path) <= 3)
+ return -EACCES;
+
+
--- /dev/null
+
+# HG changeset patch
+# User Vincent Wagelaar <vincent@ricardis.tudelft.nl>
+# Date 1189308755 -7200
+# Node ID 43fc6b1b85482441810521998ddcc50775114c17
+# Parent 5532758d3763bd2803a67686ccba9a7475148bc3
+Fix problem with rewinddir on shares
+
+--- a/fusesmb.c Sat Sep 08 17:39:23 2007 +0200
++++ b/fusesmb.c Sun Sep 09 05:32:35 2007 +0200
+@@ -474,6 +474,11 @@ static int fusesmb_readdir(const char *p
+ else
+ {
+ pthread_mutex_lock(&ctx_mutex);
++ if (0 > ctx->lseekdir(ctx, (SMBCFILE *)fi->fh, 0))
++ {
++ pthread_mutex_unlock(&ctx_mutex);
++ return -errno;
++ }
+ while (NULL != (pdirent = ctx->readdir(ctx, (SMBCFILE *)fi->fh)))
+ {
+ if (pdirent->smbc_type == SMBC_DIR)
+
--- /dev/null
+
+# HG changeset patch
+# User Vincent Wagelaar <vincent@ricardis.tudelft.nl>
+# Date 1195498868 -3600
+# Node ID 36cbf3b25cb6712e00b517c0ee98177096ddf83e
+# Parent 00de6cb760f4a5e292148c7c5522536fc0c48b54
+sv is uninitialized fix by Evgeniy Dushistov
+
+--- a/smbctx.c Tue Sep 18 21:59:31 2007 +0200
++++ b/smbctx.c Mon Nov 19 20:01:08 2007 +0100
+@@ -29,6 +29,7 @@ static int nmblookup(const char *ip_serv
+ static int nmblookup(const char *ip_server, char *output, size_t outputsize)
+ {
+ char ipcmd[1024] = "nmblookup -A ";
++ *output = '\0';
+ strcat(ipcmd, ip_server);
+ FILE *pipe = popen(ipcmd, "r");
+ if (NULL == pipe)
+@@ -174,7 +175,7 @@ static void fusesmb_cache_auth_fn(const
+ {
+ (void)workgroup;
+ (void)wgmaxlen;
+- char sv[1024];
++ char sv[1024] = "";
+
+ /* Don't authenticate for workgroup listing */
+ if (NULL == server || server[0] == '\0')
+