libpriv/core: fix tmpdir making logic
Even if we're already initialized, we still need to create the subdir requested. This would cause relabeling to fail because we try to create the "relabel" subdir, which never actually gets created. Closes: #993 Approved by: cgwalters
This commit is contained in:
parent
80de17623f
commit
e78807143f
@ -405,14 +405,16 @@ rpmostree_context_ensure_tmpdir (RpmOstreeContext *self,
|
|||||||
const char *subdir,
|
const char *subdir,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
if (self->tmpdir.initialized)
|
if (!self->tmpdir.initialized)
|
||||||
return TRUE;
|
{
|
||||||
|
if (!glnx_mkdtemp ("rpmostree-core-XXXXXX", 0700, &self->tmpdir, error))
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
g_assert (self->tmpdir.initialized);
|
||||||
|
|
||||||
if (!glnx_mkdtemp ("rpmostree-core-XXXXXX", 0700,
|
|
||||||
&self->tmpdir, error))
|
|
||||||
return FALSE;
|
|
||||||
if (!glnx_shutil_mkdir_p_at (self->tmpdir.fd, subdir, 0755, NULL, error))
|
if (!glnx_shutil_mkdir_p_at (self->tmpdir.fd, subdir, 0755, NULL, error))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user