mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 12:25:31 +00:00
sip: provider: Try to create folder for credentials
Otherwise the user could be left unable to save credentials to disk later. Fixes #326
This commit is contained in:
parent
4e76efc5e7
commit
77ec258acc
1 changed files with 10 additions and 0 deletions
|
@ -591,6 +591,7 @@ calls_sip_provider_account_provider_interface_init (CallsAccountProviderInterfac
|
||||||
static void
|
static void
|
||||||
calls_sip_provider_init (CallsSipProvider *self)
|
calls_sip_provider_init (CallsSipProvider *self)
|
||||||
{
|
{
|
||||||
|
g_autofree char *directory = NULL;
|
||||||
const char *filename_env = g_getenv ("CALLS_SIP_ACCOUNT_FILE");
|
const char *filename_env = g_getenv ("CALLS_SIP_ACCOUNT_FILE");
|
||||||
|
|
||||||
self->origins = g_list_store_new (CALLS_TYPE_ORIGIN);
|
self->origins = g_list_store_new (CALLS_TYPE_ORIGIN);
|
||||||
|
@ -602,6 +603,15 @@ calls_sip_provider_init (CallsSipProvider *self)
|
||||||
APP_DATA_NAME,
|
APP_DATA_NAME,
|
||||||
SIP_ACCOUNT_FILE,
|
SIP_ACCOUNT_FILE,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
directory = g_path_get_dirname (self->filename);
|
||||||
|
if (g_mkdir_with_parents (directory, 0750) == -1) {
|
||||||
|
int err_save = errno;
|
||||||
|
g_warning ("Failed to create directory '%s': %d\n"
|
||||||
|
"Can not store credentials persistently!",
|
||||||
|
directory, err_save);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue