ecryptfs-manager runs into infinite loop if user doesn't install openssl and selects the third option

Bug #1695767 reported by Jason Xing
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
eCryptfs
Fix Committed
Undecided
Unassigned

Bug Description

Reproduce case:
1) User doesn't install openssl.
2) Run ecryptfs-manager and make selection 3.
It goes in the infinite loop...which means whatever selection you choose cannot end this command or alter your option.

Details in code:
Please look at src/libecryptfs/decision_graph.c From line 558 ti line 597 (see http://bazaar.launchpad.net/~ecryptfs/ecryptfs/trunk/view/head:/src/libecryptfs/decision_graph.c#L558):
It will prompt user to enter the selection which is set to "val" variable and then run into "else" portion instead of "if" portion. However, "node->num_transitions" which was set to zero before causes the terrible result (infinite loop): it will skip for loop and test if the "valid_val" is 0. If not, go back to get_value part (line 558) and do it one more time.

Reason:
1) User doesn't install openssl module.
2) The developers of ecryptfs-manager doesn't take such case into consideration.

Quote from Tyler (see https://bugs.launchpad.net/ecryptfs/+bug/878239/comments/3):
"> Option 3 allows to generate a new public/private key pair, but asks for
> a key type without giving the slightest hint about what type choices
> there are.

That's because you don't have the OpenSSL key module installed. The
ecryptfs-manager prompts should take this into account, but they don't.
Please consider filing a separate bug about this."

Because of that, I'm opening this bug report!

Related branches

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

I'm assigning this to me...Any advice and comments are welcome!

Changed in ecryptfs:
assignee: nobody → Jason Xing (wlxing)
status: New → Confirmed
Revision history for this message
Jason Xing (wlxing) wrote :

It has something to do with bug 878239.

Changed in ecryptfs:
status: Confirmed → In Progress
Jason Xing (wlxing)
summary: - ecryptfs-manager runs into dead loop if user doesn't install openssl and
- selects the third option
+ ecryptfs-manager runs into infinite loop if user doesn't install openssl
+ and selects the third option
description: updated
Revision history for this message
Jason Xing (wlxing) wrote :

I'm done with that patch.

The first attachment is the original outputs if you run ecryptfs-manager and then select 3.
The second attachment is the outputs after writing the patch in decision_graph.c to prevent infinite loop. It will prompt user with error message.

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

Committed to lp:ecryptfs as r888. Thanks for the fix!

Changed in ecryptfs:
status: In Progress → Fix Committed
Jason Xing (wlxing)
Changed in ecryptfs:
assignee: Jason Xing (wlxing) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.