Create the directory used for transaction lock if necessary
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 9 Jul 2009 11:40:17 +0000 (14:40 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 21 Jul 2009 06:51:13 +0000 (09:51 +0300)
- otherwise at least rpm --initdb can fail due to transaction locking failing
(cherry picked from commit 17f9073278206a979829fa41ac496476dde1a3ef)

lib/rpmlock.c

index 624ec99..d550407 100644 (file)
@@ -37,6 +37,7 @@ static rpmlock rpmlock_new(const char *rootdir)
        if (t == NULL || *t == '\0' || *t == '%')
            t = xstrdup(RPMLOCK_PATH);
        rpmlock_path = xstrdup(t);
+       (void) rpmioMkpath(dirname(t), 0755, getuid(), getgid());
        t = _free(t);
     }
     if (lock != NULL) {