aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--cache.c11
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 062aaf7..e4a3727 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,12 +3,14 @@
* Fix crash within gdb, caused by sem_wait() returning with an
error on interrupt. Reported by Dimitrios Apostolou
+ * Fix spurious cache entries remaining after renaming a directory
+
2007-02-28 Miklos Szeredi <miklos@szeredi.hu>
* Don't set DISPLAY environment variable to "", because it breaks
ssh-askpass. Make nodelaysrv_workaround default to off, because
with this change it may have security implications.
-
+
2007-02-19 Miklos Szeredi <miklos@szeredi.hu>
* OpenSSH sftp-server can read requests faster, than it processes
diff --git a/cache.c b/cache.c
index d17e735..ab378a3 100644
--- a/cache.c
+++ b/cache.c
@@ -116,9 +116,20 @@ static void cache_invalidate_dir(const char *path)
pthread_mutex_unlock(&cache.lock);
}
+static int cache_del_children(const char *key, void *val_, const char *path)
+{
+ (void) val_;
+ if (strncmp(key, path, strlen(path)) == 0)
+ return TRUE;
+ else
+ return FALSE;
+}
+
static void cache_do_rename(const char *from, const char *to)
{
pthread_mutex_lock(&cache.lock);
+ g_hash_table_foreach_remove(cache.table, (GHRFunc) cache_del_children,
+ (char *) from);
cache_purge(from);
cache_purge(to);
cache_purge_parent(from);