firebird icon indicating copy to clipboard operation
firebird copied to clipboard

GBAK doesn't handle escaped path (and most likely filenames) on WIndows

Open TommiPrami opened this issue 1 year ago • 2 comments

We encountered customer case where user name, and therefore appdata-path contains & character.

In batch files etc it must be escaped as ^&, now in out script otherwise works, but GBAK fails to escaped path.

I (for my surprise) have not found easy workaround that would work. (for our script). So would be nice if support for these escapes would be added into the Firebird command line applications.

List of escapes: https://www.robvanderwoude.com/escapechars.php

Need only add escaping support on those characters that are legal characters in the file names and paths (Maybe just): %^& Which easily breaks the batch scripts.

-Tee-

TommiPrami avatar Mar 26 '24 07:03 TommiPrami

Please provide a reproducible case that demonstrates the problem. You're now only describing a problem in prose, without demonstrating the actual problem, which makes it hard to infer what the real problem is.

As an aside, on the face of it, it sounds like a problem in your batch file, because gbak itself isn't a batch file and so gbak doesn't have to follow escaping rules that applies to batch files.

mrotteveel avatar Mar 26 '24 10:03 mrotteveel

Escaping is not task for application it is done by command processor.

aafemt avatar Mar 26 '24 11:03 aafemt

Please provide a reproducible case that demonstrates the problem. You're now only describing a problem in prose, without demonstrating the actual problem, which makes it hard to infer what the real problem is.

As an aside, on the face of it, it sounds like a problem in your batch file, because gbak itself isn't a batch file and so gbak doesn't have to follow escaping rules that applies to batch files.

Easy to test, just use gbak with path that contains &-character. I try to make reproducible case.

TommiPrami avatar Jan 21 '25 06:01 TommiPrami

Escaping is not task for application it is done by command processor.

I think that this is just not the case. At least on windows, If I remember, I'll try to remember to build test case.

TommiPrami avatar Jan 21 '25 06:01 TommiPrami