コード例 #1
0
        public void SetAuthUserPass(string username, string password)
        {
            if (PasswordAuthFile != null)
            {
                PasswordAuthFile.Close();
                PasswordAuthFile = null;
            }

            PasswordAuthFile = new TemporaryFile("ppw");
            string fileNameAuthOvpn = PasswordAuthFile.Path;
            string fileNameData     = username + "\n" + password + "\n";

            Platform.Instance.FileContentsWriteText(fileNameAuthOvpn, fileNameData);
            Platform.Instance.FileEnsurePermission(fileNameAuthOvpn, "600");
            Platform.Instance.FileEnsureOwner(fileNameAuthOvpn);

            OpenVpnProfileStartup.AppendDirective("auth-user-pass", OpenVpnProfileStartup.EncodePath(fileNameAuthOvpn), "Auth");
        }
コード例 #2
0
ファイル: ConnectionActive.cs プロジェクト: nir94/Eddie
        public void CleanAfterStart()
        {
            if (OvpnFile != null)
            {
                OvpnFile.Close();
                OvpnFile = null;
            }

            if (ManagementPasswordFile != null)
            {
                ManagementPasswordFile.Close();
                ManagementPasswordFile = null;
            }

            if (ProxyAuthFile != null)
            {
                ProxyAuthFile.Close();
                ProxyAuthFile = null;
            }
        }
コード例 #3
0
ファイル: ConnectionActive.cs プロジェクト: nir94/Eddie
        public void InitStart()
        {
            OvpnFile = new TemporaryFile("ovpn");

            Platform.Instance.FileContentsWriteText(OvpnFile.Path, OpenVpnProfileStartup.Get(), Encoding.UTF8);
        }
コード例 #4
0
 public static void Add(TemporaryFile file)
 {
     m_files.Add(file);
 }