Page MenuHome GnuPG

'GPGCONF --list-dirs' command option on-screen displayed results show '%3a' unexpected and unneeded characters in each line displaying a C: drive path instead of simpler expected '...:C:\...' sub-strings with only valid ':' ('colon') characters present
Closed, ResolvedPublic

Description

I hope it's always fine to open this bug here even if 'GPGCONF' command is indeed from GnuPG 2.2.28 that is packaged with Gpg4win 3.1.16.
The effect is that each line shows '...:C%3a\....' instead of expected '...:C:\...'.
Since '0x3A' it's the character code for ':' (colon) character (as per quick check I made in Charmap.exe) it seems that probably due to a typo, a wrong % character has substituted expected '0x', and unluckily this is impacting more displayed text lines.
And here's bitmap showing issue.

Details

Version
2.2.28, 3.1.16

Event Timeline

swimmerm updated the task description. (Show Details)
swimmerm updated the task description. (Show Details)

P.S. Also note that my Gpg4win 3.1.16 installation status is still last T5593 described one.

werner added a subscriber: werner.

That's correct - The output needs to be percent escaped.

werner claimed this task.
swimmerm reopened this task as Open.EditedSep 29 2021, 12:17 AM

Hello Werner,

I'm sorry to reopen but I still believe that what I reported is a bug. Maybe the issue was just adding 1 percent escape in the wrong place or even 1 unneeded percent escape.

Please note that with syntax I reported initially, same command is able to provide in same line 2 contrasting representation of ':' (colon) character for 13 lines, and only the 1st one is displayed correctly. While if for same commend the syntax becomes just a little different 'gpgconf --list-dirs homedir' then there's no wrong 'C%3a\' display error at all and resulting string displayed is 'C:\...' as typically expected.
And I don't believe the same effect might be happening for other language localizations or even other non-Windows platforms, but I've no way to do more checks to be sure.
But just about this I also recalled the other guy, grv87, that also experienced same PATH error I reported in T5593, so if he had another Windows based configuration in another language, then he might even possibly be a good candidate to do a very quick check to see if same issue I reported here can be reproduced again by him.

Thanks in advance for your comprehension.
Regards

28/09 23.24.47 C:\Users\'<myAlias>'>gpgconf --list-dirs
sysconfdir:C%3a\ProgramData\GNU\etc\gnupg
bindir:C%3a\Program Files (x86)\GnuPG\bin
libexecdir:C%3a\Program Files (x86)\GnuPG\bin
libdir:C%3a\Program Files (x86)\GnuPG\lib\gnupg
datadir:C%3a\Program Files (x86)\GnuPG\share\gnupg
localedir:C%3a\Program Files (x86)\GnuPG\share\locale
socketdir:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg
dirmngr-socket:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg\S.dirmngr
agent-ssh-socket:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg\S.gpg-agent.ssh
agent-extra-socket:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg\S.gpg-agent.extra
agent-browser-socket:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg\S.gpg-agent.browser

agent-socket:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg\S.gpg-agent
homedir:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg

28/09 23.25.03 C:\Users\'<myAlias>'>gpgconf --list-dirs homedir
C:\Users\'<myAlias>'\AppData\Roaming\gnupg

28/09 23.25.11 C:\Users\'<myAlias>'>

Also adding another explanatory bitmap

Hello again Werner,

because of your comment inside T5625 about Unicode characters I have reported I can also tell you that also I discovered another secondary effect that impacted same CMD window where I ran all commands documented above.
After some time I left same CMD window inactive (I mean in background but not minimized, simply behind other windows I was using) I decided to run 'mode con' and this was enough to make the windows close immediately but without any error message or real dump creation.

So I just tried to reproduce same issue again in a new CMD window and even if this time it didn't closed but anyway here is what I found (in textual representation 1st, then another bitmap will follow too. Please also note that if see any characters missing from textual side is just dued to font differences while copying charecters among CMD window and this system using 'Segoe UI' Unicode font, while I assume the fact that this time the CMD window didn't self-closed might probably be dued to 1st 'mode con' command I ran that may have probably initialized some internal data structures that 2nd execution of same command also accessed and properly used to point out some differences existing among 1st run and 2nd run, where for instance 'Velocità di ripetizione' (corresponding to 'KeyboardSpeed' registry value inside HKEY_CURRENT_USER\Control Panel\Keyboard key) has disappeared and resulting code page changed too (I never thought that number really even existed and it's also not listed among those officially supported by 'mode <Device> codepage select=<YYY>' command according to MS Windows Command Reference help file that I have and I often use as reference and that I've excerpted in section B) below, and that might even also possibly mean there might have been a switch to displaying UNICODE text rather than some kind of other data corruption around, but that probably only happened in the past when the CMD closed itself) :

A)
29/09 0.34.41 C:\Users\'<myAlias>'>mode con

Stato del dispositivo CON:


Linee:                9900
Colonne:              80
Velocit… ripetizione: 31
Ritardo:              1
Tabella codici:       850

29/09 0.34.46 C:\Users\'<myAlias>'>man
"man" non Š riconosciuto come comando interno o esterno,
un programma eseguibile o un file batch.

29/09 0.34.54 C:\Users\'<myAlias>'>gpgconf --list-dirs
sysconfdir:C%3a\ProgramData\GNU\etc\gnupg
bindir:C%3a\Program Files (x86)\GnuPG\bin
libexecdir:C%3a\Program Files (x86)\GnuPG\bin
libdir:C%3a\Program Files (x86)\GnuPG\lib\gnupg
datadir:C%3a\Program Files (x86)\GnuPG\share\gnupg
localedir:C%3a\Program Files (x86)\GnuPG\share\locale
socketdir:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg
dirmngr-socket:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg\S.dirmngr
agent-ssh-socket:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg\S.gpg-agent.ssh
agent-extra-socket:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg\S.gpg-agent.extra
agent-browser-socket:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg\S.gpg-agent.browser

agent-socket:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg\S.gpg-agent
homedir:C%3a\Users\'<myAlias>'\AppData\Roaming\gnupg

29/09 2.29.07 C:\Users\'<myAlias>'>gpgconf --list-dirs homedir
C:\Users\'<myAlias>'\AppData\Roaming\gnupg

29/09 2.29.14 C:\Users\RobMer>mode con

Stato del dispositivo CON:


Linee:                9900
Colonne:              80
Ritardo:              1
Tabella codici:       65001

29/09 2.29.19 C:\Users\RobMer>

B)

Parameters
Parameter Description
<Device>
Required. Specifies the device for which you want to select a code page. CON is the only valid name for a device.

codepage select=
Required. Specifies which code page to use with the specified device. You can abbreviate codepage select as cp sel.

<YYY>
Required. Specifies the number of the code page to select. The following list shows each code page that is supported and its country/region or language.

437: United States

850: Multilingual (Latin I)

852: Slavic (Latin II)

855: Cyrillic (Russian)

857: Turkish

860: Portuguese

861: Icelandic

863: Canadian-French

865: Nordic

866: Russian

869: Modern Greek

codepage
Required. Displays the numbers of the code pages (if any) that are selected for the specified device.

/status
Displays the numbers of the current code pages selected for the specified device. You can abbreviate /status to /sta. Whether or not you specify /status, mode codepage displays the numbers of the code pages that are selected for the specified device.

/?
Displays help at the command prompt.

As I anticipated here's screenshot I also saved.
P.S. Just in case you might wonder why I tried to execute 'man' not existing command is because I also incorrectly tried to run it 2 days ago when after I tested some GnuPG commands in a CMD window, and again same window self-closed with no error messages or any dump creation and again I'm sure at that time I didn't run 'mode con' before those GnuPG commands (I'm unsure which ones but they probably some were the same I also already reported here). Please also note that making 'Stato del dispositivo CON:' so big was unintended and very likely just an effect of cut & paste I did, so now I'll try to see if I can avoid that effect.

swimmerm renamed this task from 'GPGCONF --list-dirs' command option shows '%3a' unexpected characters string in each line instead of expected single ':' ('colon') character to 'GPGCONF --list-dirs' command option shows 'C%3a\' unexpected characters string in each line instead of expected 'C:\' so with ('colon') character present.Sep 29 2021, 3:26 AM
swimmerm renamed this task from 'GPGCONF --list-dirs' command option shows 'C%3a\' unexpected characters string in each line instead of expected 'C:\' so with ('colon') character present to 'GPGCONF --list-dirs' command option shows 'C%3a\' unexpected characters strings in each line instead of expected 'C:\' so with ('colon') character present.

OK, effect avoided. Only dued to a big sequence of '-' characters that this bug reporting system interpreted as special control code characters for making font bigger.

Sorry, I can't read all your comments about this. The percent escaping is correct and required. If you want to use the output in a script you can get it without percent escaping by using for example

gpgconf --list-dirs sysconfdir

That is also intended. Just to make it complete: If you want to use a Nul instead of a LF as terminaror you can do that by adding the option"-0".

swimmerm reopened this task as Open.EditedSep 30 2021, 9:07 PM

Hello again Werner,

1st of all I'd like to apologize with you because I believe there may have been some misunderstanding between us about this bug and would really like to avoid it.
As I said in another bug I'm still studying about Gpg4win (and GnuPG) and since I still believe I started with best right information sources, I also simply really wanted to slightly improve results using them (if and as much as really possible for me, if I can) and maybe even for some other Italian students.

I'm sorry too you couldn't "read" all my previous comments before, please note that sometime ago I too missed some of them in another bug, but when I tried again to search for them above last sentence added into same bug I noticed a line with a very light pink backgroung saying 'Changes from before your most recent comment are hidden. Show Older Changes' so only after I clicked on 'Show Older Changes' I saw all my previous comments too (URL I've added here is the same I saw initially for this bug, when some comments seemed to be missing, but I guess this just only depends from web interface of this bug reporting system).

Now back to (at least) me trying to avoid any more misunderstandings about this bug.
I didn't understood properly what you meant when you said "... percent escaped" when closing this bug the 1st time, and unluckily also when you said "percent escaping is correct and required" when you closed this bug the 2nd time.
But I was still wondering about it and today (while studying other GnuPG related info) I 1st decided to search 'percent escaping' on WikiPedia, but there I only found 'Percent-encoding' and this probably started to help me to a little better try to somehow understand what you might have meant.
Then I also expanded more my investigation on this bug reporting site via 'Advanced Search' and obviously found more past references of what you more probably really meant (for now I'm mainly only speaking about T2387).
But then I also looked again at your last 29/09 statement and saw again that you also referred to 'gpgconf --list-dirs sysconfdir'.

Well, by itself alone, that reference from you was equivalent to 'gpgconf --list-dirs homedir' mention I also did on Tue 28/09 when I 1st reopened this bug, and also added 2nd .PNG screenshot bitmap during my 1st additional attempt to make intent of this bug clearer by also slightly changing its title (to try to slightly better 'refine' its meaning). But since before you said "... If you want to use the output in a script you can get it without percent escaping by using for example" and after you also added "... If you want to use a Nul instead of a LF as terminaror you can do that by adding the option"-0"" I also tried again but even using 'gpgconf --list-dirs -0'as per your suggestion didn't changed on-screen results, so all those unexpected '...:C%3a\...' were still displayed instead of the simplier expected '...:C:\...' (so just like in 1st .PNG screenshot bitmap I added thus I'm also avoiding to add another one).

Now, since:

  • I'm simply using a CMD window in Windows OS I have for on-screen display of GnuPG v2.2.28 utilities embedded in Gpg4win v3.1.16 (just in case you didn't already knew this, 'cmd.exe' is standard command prompt 'shell' for Windows NT platform based OSes since its v3.1, 1st version, just to make a very simple parallel with other non-Windows platforms, and so its execution always runs windowed just like already shown in all .PNG screenshot bitmaps I've enclosed so far),
  • I'm also not using any script for 'gpgconf --list-dirs' output , but again just only displaying its on-screen result after simple GnuPG command execution in same CMD window I use to execute them,

after I also read T747 and rGd1507b4f95eb contents (for this last in particular I'm also wondering if display error I'm reporting here might possibly just only depend from its translation for Italian language since I'm using it) my question to you is :
Would it please be possible in future to let people with Gpg4win configured for Italian language (just like embedded GnuPG, I guess) also have for 'gpgconf --list-dirs' the same kind of '%3a' string free on-screen displayed results when displaying a 'C:\...' drive path so to have full on-screen UI display consistency with on-screen results already displayed by A) 'gpgconf --list-dirs homedir' (2nd screenshot .PNG bitmap I uploaded) or B) 'gpgconf --list-dirs sysconfdir' ?

Because once again both commands, when run in a CMD window, are already respectively correctly displaying on-screen following (and '%3a' string free) results inside 'C:\...' displayed paths:
A) 'C:\Users\<myAlias>\AppData\Roaming\gnupg',
B) 'C:\ProgramData\GNU\etc\gnupg)'

P.S. Please note you're going to find this bug title slightly changed once again as my attempt to possibly further improve its effectiveness.

swimmerm renamed this task from 'GPGCONF --list-dirs' command option shows 'C%3a\' unexpected characters strings in each line instead of expected 'C:\' so with ('colon') character present to 'GPGCONF --list-dirs' command option on-screen displayed results show '%3a' unexpected characters strings in each line displaying a C: drive path instead of simpler expected 'C:\' string with only ';' ('colon') character present.Sep 30 2021, 9:12 PM
werner edited projects, added Not A Bug; removed Bug Report.
swimmerm renamed this task from 'GPGCONF --list-dirs' command option on-screen displayed results show '%3a' unexpected characters strings in each line displaying a C: drive path instead of simpler expected 'C:\' string with only ';' ('colon') character present to 'GPGCONF --list-dirs' command option on-screen displayed results show '%3a' unexpected characters strings in each line displaying a C: drive path instead of simpler expected ':C:\' string with only valid ':' ('colon') characters present.Oct 2 2021, 12:11 AM

Just adding this note for any future reference needs only (or even message localization reference, since involved text characters strings are also expected to be among Italian language localized messages even if involved strings are not specifically being localized).

For better on-screen display of resulting punctuation in each of the 13 currently wrong displayed lines containing '...:C%3a\...' (so 1 correct ':' (colon) and unexpected '%3a' characters instead of 1 more expected & valid ':' (colon) single character) and that (as of now) should have only displayed correctly '...:C:\...' substring for C: drive based directory paths displayed by each line, a ' ' (empty space) character should be inserted among ':' and following (correctly expected) 'C:\' substring so that on-screen resulting characters would be more correctly 'spaced' as per English and Italian grammar punctuation rules just like in following sub-string example with ' ' correctly placed & added in-between the 2 sub-string displayed sections:
'...: C:\...'.

Just tracking my own additional investigation still about past Werner statement "percent escaping is correct and required" when this bug was closed for 1st time.
Also found interesting past references into rG055f8854d3f4 and rGe064c75b08a5 but only this last seems indeed much more specifically directly involved since it really contains related part of code (common/stringhelp.c) directly involved with this bug report for 'percent escaping' ':' (colon) character with '%3a' string even if sometimes, when possibly un-needlingly done, may even provide users unexpected on-screen displayed results like those I documented in this bug.
Problem now is that to really fully understand why on-screen displayed strings by 'gpgconf --list-dirs' correctly show a ':' (colon) correctly expected character near an unexpected (by end users) '%3a' (percent escaped) string that should just have corresponded with another simple (& user correctly expected) ':' colon character I can only really see to 2 options:
A) reopening this bug once again :-S ;
B) simply opening a new separate one asking for some additional explanations and maybe even to consider some future slight code changes to (at least for Windows OSes) ensure 'gpgconf --list-dirs' directory displayed paths results are more UI consistent with 'gpgconf --list-dirs homedir' or 'gpgconf --list-dirs sysconfdir' displayed ones where displayed C:\... paths always correctly display ':' (colon) instead of '%3a'.
So far this last seems me best viable option also because in same rGe064c75b08a5 I also saw another piece of code (tools/gpgconf-comp.c) with some similar code lines, that apparently (it seems me) if directly referenced (at least only for Windows OSes only, so maybe when a system variable %OS%==Windows_NT exists) instead of current one (common/stringhelp.c) also providing '%3a' 'percent escaping' results, might then have probably also easily avoided '%3a' user unexpected on-screen displayed results only depending by 'percent escaping'.

Just adding this note because a next step I'm also evaluating in my current T5593 configuration status it to temporarily create a new Gpg4win 3.1.16 hybrid configuration by also adding latest GnuPG v2.2.31 to see if all issues I reported here are still present (which is also quite probable).
Also because of T5593 it would just be quite interesting to see if GnuPG v2.2.31 too might experience same T5593 path related error.

swimmerm renamed this task from 'GPGCONF --list-dirs' command option on-screen displayed results show '%3a' unexpected characters strings in each line displaying a C: drive path instead of simpler expected ':C:\' string with only valid ':' ('colon') characters present to 'GPGCONF --list-dirs' command option on-screen displayed results show '%3a' unexpected and unneeded characters in each line displaying a C: drive path instead of simpler expected ':C:\' string with only valid ':' ('colon') characters present.Oct 14 2021, 11:09 PM
swimmerm renamed this task from 'GPGCONF --list-dirs' command option on-screen displayed results show '%3a' unexpected and unneeded characters in each line displaying a C: drive path instead of simpler expected ':C:\' string with only valid ':' ('colon') characters present to 'GPGCONF --list-dirs' command option on-screen displayed results show '%3a' unexpected and unneeded characters in each line displaying a C: drive path instead of simpler expected '...:C:\...' sub-string with only valid ':' ('colon') characters present.
swimmerm renamed this task from 'GPGCONF --list-dirs' command option on-screen displayed results show '%3a' unexpected and unneeded characters in each line displaying a C: drive path instead of simpler expected '...:C:\...' sub-string with only valid ':' ('colon') characters present to 'GPGCONF --list-dirs' command option on-screen displayed results show '%3a' unexpected and unneeded characters in each line displaying a C: drive path instead of simpler expected '...:C:\...' sub-strings with only valid ':' ('colon') characters present.Oct 14 2021, 11:11 PM
swimmerm changed Version from 3.1.16, 2.2.28 to 2.2.28, 3.1.16.