rnp icon indicating copy to clipboard operation
rnp copied to clipboard

Incorrect user home folder on Windows

Open maxirmx opened this issue 1 year ago • 2 comments

Description

Incorrect user home folder on Windows

Expected Behavior

When Windows native environment (not MSys, not cygwin) is used user home folder is defined by USERPROFILE environment variable

Actual Behavior

rnp and rnp tests always use HOME

Practically it means that:

  1. rnp cli tests (Python tests) can be executed in MSys environment only because gpg follows HOME/USERPROFILE convention and thus is not compatible with RNP
  2. when rnp is executed in native Windows environment it creates key rings not in user home folder but elsewhere (empty string is used as HOME which probably means current folder -- may be wrong)

maxirmx avatar Nov 17 '23 14:11 maxirmx

I propose to use SHGetFolderPath() with CSIDL_PROFILE argument to get the Windows user home directory.

antonsviridenko avatar Nov 27 '23 19:11 antonsviridenko

@antonsviridenko Thanks for the suggestion! You are welcome to make PR implementing this :)

ni4 avatar Nov 27 '23 20:11 ni4