From 94f3a07b20019a7d412bb1b5caa4f5ce153732a9 Mon Sep 17 00:00:00 2001 From: pacien Date: Sat, 20 Jan 2024 00:20:12 +0100 Subject: config: make all generated files accessible to the user Permissions mode 0600 was preventing even the user from accessing the configuration files. This makes the permissions more open. The private key files should nevertheless be protected from other apps by the permissions on the parent directory. Password protection for the private key is also recommended in general. GitHub: fixes #122 --- .../activities/configure/tools/GenerateConfigToolDialogFragment.kt | 7 +++++-- .../activities/configure/tools/JoinNetworkToolDialogFragment.kt | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'app/src/main/java/org/pacien/tincapp/activities') diff --git a/app/src/main/java/org/pacien/tincapp/activities/configure/tools/GenerateConfigToolDialogFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/configure/tools/GenerateConfigToolDialogFragment.kt index 96e39ba..c152d54 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/configure/tools/GenerateConfigToolDialogFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/configure/tools/GenerateConfigToolDialogFragment.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2024 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,6 +23,8 @@ import kotlinx.android.synthetic.main.configure_tools_dialog_network_generate.vi import org.pacien.tincapp.R import org.pacien.tincapp.commands.Tinc import org.pacien.tincapp.commands.TincApp +import org.pacien.tincapp.context.AppPaths +import org.pacien.tincapp.utils.makePublic /** * @author pacien @@ -47,5 +49,6 @@ class GenerateConfigToolDialogFragment : ConfigurationToolDialogFragment() { .thenCompose { Tinc.init(netName, nodeName) } .thenCompose { TincApp.removeScripts(netName) } .thenCompose { TincApp.generateIfaceCfgTemplate(netName) } - .thenCompose { TincApp.setPassphrase(netName, newPassphrase = passphrase) }) + .thenCompose { TincApp.setPassphrase(netName, newPassphrase = passphrase) } + .thenApply { AppPaths.confDir(netName).makePublic() }) } diff --git a/app/src/main/java/org/pacien/tincapp/activities/configure/tools/JoinNetworkToolDialogFragment.kt b/app/src/main/java/org/pacien/tincapp/activities/configure/tools/JoinNetworkToolDialogFragment.kt index 25bdb15..f00b961 100644 --- a/app/src/main/java/org/pacien/tincapp/activities/configure/tools/JoinNetworkToolDialogFragment.kt +++ b/app/src/main/java/org/pacien/tincapp/activities/configure/tools/JoinNetworkToolDialogFragment.kt @@ -1,6 +1,6 @@ /* * Tinc App, an Android binding and user interface for the tinc mesh VPN daemon - * Copyright (C) 2017-2018 Pacien TRAN-GIRARD + * Copyright (C) 2017-2024 Pacien TRAN-GIRARD * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,7 +27,9 @@ import kotlinx.android.synthetic.main.configure_tools_dialog_network_join.view.* import org.pacien.tincapp.R import org.pacien.tincapp.commands.Tinc import org.pacien.tincapp.commands.TincApp +import org.pacien.tincapp.context.AppPaths import org.pacien.tincapp.databinding.ConfigureToolsDialogNetworkJoinBinding +import org.pacien.tincapp.utils.makePublic /** * @author pacien @@ -78,5 +80,6 @@ class JoinNetworkToolDialogFragment : ConfigurationToolDialogFragment() { .thenCompose { TincApp.removeScripts(netName) } .thenCompose { TincApp.generateIfaceCfg(netName) } .thenCompose { TincApp.setPassphrase(netName, newPassphrase = passphrase) } + .thenApply { AppPaths.confDir(netName).makePublic() } ) } -- cgit v1.2.3