Comments (7)
You can probably use ./-
.
from age.
That works indeed. Thanks for the hint!
However, the initial ambiguity described here still makes it rather difficult to script age in a way that I (or rather the user of my script) can throw any valid filename at it with me being sure that it will be indeed interpreted as a file.
Now I have to manually check whether the INPUT argument is -
and replace it with ./-
Also, the same basic issue also applies to the --recipients-file
option too.
from age.
You can do realpath -- -
to get the absolute path of the file on the VFS tree, so that the leading characters must be /
. Ambiguity removed.
from age.
For additional context, originally (during early development) age
did treat -
as a filename. This behaviour was changed in response to a user request for age to follow the general Linux CLI app convention of interpreting -
in filename positions as a marker for stdin or stdout: #143.
from age.
I don't think you can have your cake and eat it too. Making -
be an alias for STDIN/STDOUT as is convention in many *nix tools precludes it working as an actual filename without escaping. This isn't just an issue with age
, and the usual workarounds apply. I think the current behavior is expected and would not want to see it change.
This is even potentially a security issue. Given that -
is supposed to be STDIN, if the logic were to change and a local file were to be preferred over the stream, potentially a script using age could be tricked into using a different input than what the script author intended.
from age.
Many other tools which accept filenames, accept those only at the end of the argument list. Then, they allow to add a separate --
argument to mark everything following it to be an actual real filename. This can be used to e.g. delete a file named -f
with rm -- -f
.
Because of this convention, I proposed that age may understand this --
separator to mark everything that follows as a filename rather than any further options. This would then neatly solve the issue with other potential input filenames, such as --armor
--passphrase
or others.
Interestingly, age
currently seems to accept the --
separator there currently, but chooses to ignore it.
As for using the "inline marker" -
in places where paths are generally expected (such as with --recipient-file
or --identity
), this seems like a general anti-pattern to me since it makes it harder to predictably use age with arbitrary filenames (and avoid it hanging waiting for input that may never arrive). I would have rather loved for these options to have separate names (such as --read-recipients
, --read-identity
, ...), but I guess that ship has sailed...
from age.
Related Issues (20)
- Unhelpful error message on invalid file HOT 1
- Add ScryptIdentity.SetMinWorkFactor and document risk of online decryption oracles HOT 2
- age subprocess unable to read ssh key password from terminal, when called from vim HOT 1
- agessh: ParseIdentity doesn't handle inconsistent Ed25519 return type from ParseRawPrivateKey
- cmd/age-keygen: -y should report error if it fails to parse input HOT 1
- Unable to encrypt/decrypt file using ssh-rsa key
- Remove Bech32 length limitations
- Age v1.1.0 fails to build with "go install" HOT 3
- Weird characters in place of terminal escape sequences on Windows Console
- plugin: add library support for using and providing plugins HOT 4
- cmd/age: print a better error message when plugins are missing HOT 2
- command '/bin/sh -c go install filippo.io/age/cmd/...@latest' returned a non-zero code: 1 HOT 3
- Using the same file as input and output produces a corrupt result without notice. HOT 7
- Latest release spins CPU HOT 4
- c2sp.org/age-plugin returns 404 Not Found HOT 1
- Age terminates too soon on MacOS HOT 5
- Can this method be used to encrypt movie files? HOT 1
- report unexpected HOT 1
- age: error: failed to wrap key for recipient #0: test plugin: write |1: broken pipe HOT 16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from age.