~wlxing/ecryptfs/lp342398

Viewing all changes in revision 888.

  • Committer: Tyler Hicks
  • Author(s): Jason Xing
  • Date: 2017-06-08 00:19:21 UTC
  • Revision ID: tyhicks@canonical.com-20170608001921-rm497vizkpffmu95
Fix loop in ecryptfs-manager when there are no options (LP: #1695767)

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 enter next
cannot end this command or alter your option.

Explanation for the patch:
Adding several lines to take such a case into consideration, through testing
whether "num_transitions" is set to zero or not we could prevent the infinite
loop. If it is set to zero, it will return -EINVAL because "num_transitions"
means how many options this command could show to users and zero means that
user has no option to choose.

[tyhicks: Print to stderr, adjust error message, and add changelog entry]

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: