]> err.no Git - util-linux/commitdiff
libblkid: fix the default cache file path
authorKarel Zak <kzak@redhat.com>
Tue, 29 Sep 2009 09:08:32 +0000 (11:08 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 30 Nov 2009 13:10:24 +0000 (14:10 +0100)
The blkid_get_cache_filename() can returns BLKID_CONFIG_FILE instead
BLKID_CACHE_FILE. Yeah, pretty stupid typo.

Fortunately, this brown-paper-bag bug is invisible in almost all cases,
because the default path is returned by blkid_read_config().  The bug
can be visible only when blkid_read_config() returns NULL -- it means
on parses or malloc error.

Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/cache.c

index acdf96ddebcc21c05f7d4dc372c6dfb4f67b9066..19941ff069cb81a32ba23ed295044ce4a152d0bf 100644 (file)
@@ -110,7 +110,7 @@ char *blkid_get_cache_filename(struct blkid_config *conf)
        else {
                struct blkid_config *c = blkid_read_config(NULL);
                if (!c)
-                       filename = blkid_strdup(BLKID_CONFIG_FILE);
+                       filename = blkid_strdup(BLKID_CACHE_FILE);
                else {
                        filename = c->cachefile;  /* already allocated */
                        c->cachefile = NULL;