]> 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>
Tue, 29 Sep 2009 11:30:56 +0000 (13:30 +0200)
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 7f983ed761e8c284e09547b6ae665505c8081586..e71176b507cde5b127f52d859025f3b7416f9eb0 100644 (file)
@@ -134,7 +134,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;