Should use "$@" with double-quotes
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
stegosuite (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
stegosuite(1) is a too-simple bash(1) script:
1 #!/bin/bash
2
3 DIRNAME=
4 STEGOSUITEJAR=
5
6 # Setup the classpath
7 if [ ! -f "$STEGOSUITEJAR" ]; then
8 die "Missing required file: $STEGOSUITEJAR"
1st problem, `die' is neither a bash builtin nor an external command;
it does not exist.
9 fi
10
11 STEGOSUITE_
12
13 gtk3_version=`dpkg -s libgtk-3-0|grep '^Version' | cut -d'.' -f2`
14 swt4_version=`dpkg -s libswt-
15
16 # Run with GTK2-fallback if swt<=4.8 and gtk>=3.22
17 if [ \( "$gtk3_version" -ge 22 \) -a \( "$swt4_version" -le 8 \) ]; then
18 env SWT_GTK3=0 java -jar $STEGOSUITE_
19 else
20 java -jar $STEGOSUITE_
21 fi
2nd problem (and the issue I ran into), both on lines 18 and 20,
the $@ should be in double-quotes "$@". Because it is not, you
cannot use a passphrase containing, e.g., spaces; that is, a
command similar to the following does not work:
$ stegosuite -d -e -k 'My *secret* phrase!' -f INPUT -- IMAGE.png
(The `-d' is not necessary, but is useful to see what is going on.)
What precisely happens seems a bit variable — there's also seems
to be a poor command-line parser (3rd problem) — other than it
"doesn't work", sometimes silently (4th problem), and usually
exits with a 0 status (5th problem). And, of course, having a key
on the command-line is rather poor security (6th problem).
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: stegosuite 0.8.0-1
ProcVersionSign
Uname: Linux 4.15.0-99-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.14
Architecture: amd64
CurrentDesktop: KDE
Date: Thu May 14 19:19:47 2020
InstallationDate: Installed on 2016-10-07 (1315 days ago)
InstallationMedia: Kubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
PackageArchitec
SourcePackage: stegosuite
UpgradeStatus: Upgraded to bionic on 2018-08-18 (635 days ago)
Hi, thanks a lot for this bug report. I found it by chance. All your mentioned issues have been resolved with the new version 0.9.0-1. It just arrived in the lunar repos. You can try it out here: https:/ /launchpad. net/ubuntu/ +source/ stegosuite/ 0.9.0-1/ +build/ 24622575
For the command-line parser I switch from the old libcommons-cli to the newer super cool libpicocli.
Thanks again for your bug report!
I think the bug can be closed now.