mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-11 07:10:36 +01:00
settings: ensure the keyfile storage directory actually exists
When first trying to write out the connections we need to ensure that the keyfile directory exists, as the /etc/ tree may be either stateless or reset initially. Creating the directory on demand ensures that we have a chance for our writes to actually work. [lkundrak@v3.sk: dropped a comment for what seems obvious, minor style fixes]
This commit is contained in:
parent
4adda2b79a
commit
5c5a553ca6
1 changed files with 4 additions and 0 deletions
|
|
@ -213,6 +213,10 @@ _internal_write_connection (NMConnection *connection,
|
|||
if (!data)
|
||||
return FALSE;
|
||||
|
||||
|
||||
if (!g_file_test (keyfile_dir, G_FILE_TEST_IS_DIR))
|
||||
g_mkdir_with_parents (keyfile_dir, 0755);
|
||||
|
||||
/* If we have existing file path, use it. Else generate one from
|
||||
* connection's ID.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue