mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
parent
9ae630c73d
commit
5cdcdaee07
1 changed files with 13 additions and 0 deletions
|
@ -177,11 +177,19 @@ gst_registry_binary_cache_init (GstRegistry * registry, const char *location)
|
|||
cache->tmp_location = g_strconcat (location, ".tmpXXXXXX", NULL);
|
||||
cache->cache_fd = g_mkstemp (cache->tmp_location);
|
||||
if (cache->cache_fd == -1) {
|
||||
int ret;
|
||||
GStatBuf statbuf;
|
||||
gchar *dir;
|
||||
|
||||
/* oops, I bet the directory doesn't exist */
|
||||
dir = g_path_get_dirname (location);
|
||||
g_mkdir_with_parents (dir, 0777);
|
||||
|
||||
ret = g_stat (dir, &statbuf);
|
||||
if (ret != -1 && (statbuf.st_mode & 0700) != 0700) {
|
||||
g_chmod (dir, 0700);
|
||||
}
|
||||
|
||||
g_free (dir);
|
||||
|
||||
/* the previous g_mkstemp call overwrote the XXXXXX placeholder ... */
|
||||
|
@ -195,6 +203,11 @@ gst_registry_binary_cache_init (GstRegistry * registry, const char *location)
|
|||
g_slice_free (BinaryRegistryCache, cache);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret = g_stat (cache->tmp_location, &statbuf);
|
||||
if (ret != -1 && (statbuf.st_mode & 0600) != 0600) {
|
||||
g_chmod (cache->tmp_location, 0600);
|
||||
}
|
||||
}
|
||||
|
||||
return cache;
|
||||
|
|
Loading…
Reference in a new issue