From 771c9d9d647190e64fd782eea8671564aef2382d Mon Sep 17 00:00:00 2001 From: Jessie Broke <18238304+jessiebroke@users.noreply.github.com> Date: Fri, 27 Sep 2024 20:11:15 -0400 Subject: [PATCH] change perms for eth.key to read-only and full-control for current user in Windows --- scripts/windows/run-client.bat | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/scripts/windows/run-client.bat b/scripts/windows/run-client.bat index dde0588..e1923e7 100644 --- a/scripts/windows/run-client.bat +++ b/scripts/windows/run-client.bat @@ -3,7 +3,10 @@ setlocal enabledelayedexpansion call utils.bat -if not defined LOCALIP ( +:: Check if LOCALIP is provided as an argument +if "%1" neq "" ( + set "LOCALIP=%1" +) else if not defined LOCALIP ( call :get_ip LOCALIP ) echo LOCAL IP: %LOCALIP% @@ -17,6 +20,18 @@ if not exist eth.key ( exit /b 1 ) +:: Set proper permissions for eth.key +echo Setting proper permissions for eth.key... +icacls eth.key /reset +icacls eth.key /inheritance:r +icacls eth.key /grant:r %USERNAME%:(R,F) +icacls eth.key /remove "Authenticated Users" "BUILTIN\Users" +icacls eth.key +if errorlevel 1 ( + echo Failed to set permissions for eth.key. Please run this script as administrator. + exit /b 1 +) + :: Set variables set "VERSION=v0.1.4" set "OS=windows" @@ -59,4 +74,4 @@ exit /b goto :break ) :break -exit /b +exit /b \ No newline at end of file