Merge lp:~wlxing/ecryptfs/lp1449253 into lp:ecryptfs

Proposed by Jason Xing
Status: Merged
Merge reported by: Tyler Hicks
Merged at revision: not available
Proposed branch: lp:~wlxing/ecryptfs/lp1449253
Merge into: lp:ecryptfs
Diff against target: 42 lines (+16/-1)
2 files modified
doc/manpage/ecryptfs-mount-private.1 (+3/-1)
src/utils/ecryptfs-mount-private (+13/-0)
To merge this branch: bzr merge lp:~wlxing/ecryptfs/lp1449253
Reviewer Review Type Date Requested Status
Tyler Hicks Approve
Jason Xing (community) Needs Resubmitting
Review via email: mp+325310@code.launchpad.net

Description of the change

* Fix "ecryptfs-mount-private -h requests password instead of printing short usage message". if user add parameters to ecryptfs-mount-private, it will print the usage information.
* Also, update the manpage for ecryptfs-mount-private

To post a comment you must log in.
Revision history for this message
Tyler Hicks (tyhicks) wrote :

Thanks for the patch!

Just a few nitpicks:

1) Please remove the initial newline in the echo command

2) There shouldn't be a newline after "usage:"

3) The test for $1 being not zero length isn't technically correct. Try this
   command to see why:

   $ ecryptfs-mount-private "" -h

   I think this is the test that you want:

   if [ "$#" -ne 0 ]; then
   ...

Thanks!

review: Needs Fixing
lp:~wlxing/ecryptfs/lp1449253 updated
889. By Jason Xing

src/utils/ecryptfs-mount-private, doc/manpage/ecryptfs-mount-private.1: ecryptfs-mount-private -h prints short usage message (LP: #1449253)

Revision history for this message
Jason Xing (wlxing) wrote :

Thanks for your instructions!!!

I tested it as you said. It requests the passphrase not prompts user usage information. But your code is what I want! Thanks again!

review: Needs Resubmitting
Revision history for this message
Tyler Hicks (tyhicks) wrote :

Looks good to me!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'doc/manpage/ecryptfs-mount-private.1'
2--- doc/manpage/ecryptfs-mount-private.1 2013-01-24 22:34:19 +0000
3+++ doc/manpage/ecryptfs-mount-private.1 2017-06-08 15:12:34 +0000
4@@ -3,11 +3,13 @@
5 ecryptfs-mount-private \- interactive eCryptfs private mount wrapper script.
6
7 .SH SYNOPSIS
8-\fBecryptfs-mount-private\fP
9+\fBecryptfs-mount-private\fP [\-h|\-\-help]
10
11 .SH DESCRIPTION
12 \fBecryptfs-mount-private\fP is a wrapper script for the \fBmount.ecryptfs_private\fP utility that will interactively prompt for the user's login password, if necessary.
13
14+The only valid options are \-h or \-\-help. If specified, the usage information will be printed.
15+
16 .SH FILES
17 \fI~/.Private\fP - underlying directory containing encrypted data
18
19
20=== modified file 'src/utils/ecryptfs-mount-private'
21--- src/utils/ecryptfs-mount-private 2011-12-13 20:51:40 +0000
22+++ src/utils/ecryptfs-mount-private 2017-06-08 15:12:34 +0000
23@@ -18,6 +18,19 @@
24 TEXTDOMAIN="ecryptfs-utils"
25 MESSAGE=`gettext "Enter your login passphrase:"`
26
27+usage() {
28+echo "usage: ecryptfs-mount-private [OPTION]
29+Interactive eCryptfs private mount wrapper.
30+
31+ -h, --help Show usage information
32+"
33+ exit 1;
34+}
35+
36+if [ "$#" -ne 0 ]; then
37+ usage
38+fi
39+
40 if [ -f $HOME/.ecryptfs/wrapping-independent ]; then
41 # use a wrapping passphrase different from the login passphrase
42 WRAPPING_PASS="INDEPENDENT"

Subscribers

People subscribed via source and target branches