Red Hat Bugzilla – Bug 868330
ecryptfs-migrate-home fails when run under sudo
Last modified: 2013-08-02 03:30:03 EDT
Created attachment 630057 [details]
When ecryptfs-migrate-home is run under sudo, it fails with the error message:
mount: mount(2) failed: No such file or directory
Oct 19 15:05:32 cooper kernel: [145335.386171] Could not find key with description: [3ef50ccbb36702dd]
Oct 19 15:05:32 cooper kernel: [145335.386181] process_request_key_err: No key
Oct 19 15:05:32 cooper kernel: [145335.386186] Could not find valid key in user session keyring for sig specified in mount option: [3ef50ccb
Oct 19 15:05:32 cooper kernel: [145335.386190] One or more global auth toks could not properly register; rc = [-2]
Oct 19 15:05:32 cooper kernel: [145335.386195] Error parsing options; rc = [-2]
This is because under sudo the session keyring is inherited from the UID that called sudo:
[root@cooper martin]# keyctl show
323396226 --alswrv 1004 -1 keyring: _uid_ses.1004
510177860 --alswrv 1004 -1 \_ keyring: _uid.1004
298885694 --als-rv 1004 1004 \_ user: e17bce6f437104df
1006539220 --als-rv 1004 1004 \_ user: b2875fdadcef9521
However, ecryptfs-add-passphrase (which is called by ecryptfs-setup-private before mounting) inserts the mount key into root's user keyring.
The kernel searches the mount key in the session keyring, not in the user keyring, and fails.
The attached patch illustrates a possible solution to the problem. Running with root privileges, ecryptfs-setup-private can attach to root's keyring before mounting, and the mount command will succeed.
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora
'version' of '17'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version prior to Fedora 17's end of life.
Bug Reporter: Thank you for reporting this issue and we are sorry that
we may not be able to fix it before Fedora 17 is end of life. If you
would still like to see this bug fixed and are able to reproduce it
against a later version of Fedora, you are encouraged change the
'version' to a later Fedora version prior to Fedora 17's end of life.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.
If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version.
Thank you for reporting this bug and we are sorry it could not be fixed.
the fix was released
F17-updates has ecryptfs-utils-103-1.fc17 > ecryptfs-utils-100-6.fc17