Bug 665876

Summary: Mounting encrypted /tmp by /etc/crypttab fails if NetworkManager has no connection
Product: [Fedora] Fedora Reporter: Adalbert Prokop <adalbert.prokop>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: iarlyy, jonathan, notting, plautrba, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-03 16:43:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch for /etc/init.d/functions
none
Init script mounting encrypted /tmp none

Description Adalbert Prokop 2010-12-27 16:24:11 UTC
Description of problem:
A possible entry for encrypted /tmp directory specified in /etc/crypttab does not result in an mounted /tmp if NetworkManager is being used and has no connection.

Version-Release number of selected component (if applicable):
initscripts-9.20.1-1.fc14.i686

How reproducible:
Use NetworkManager instead of the network subsystem
# chkconfig network off
# chkconfig NetworkManager on

Prepare encrypted /tmp directory:
# file: /etc/crypttab
tmp /dev/disk/by-id/scsi-SATA_Maxtor_6Y080L0_Y23QEQDE-part9 /dev/urandom cipher=aes-cbc-essiv:sha256,tmp

# file: /etc/fstab
/dev/mapper/tmp /tmp ext2 noexec,rootcontext=system_u:object_r:tmp_t:s0 0 0

Reboot.
 
Actual results:
The encrypted directory is present as /dev/mapper/tmp but it won't be mounted.

Expected results:
If encrypted /tmp is defined, it should always be present, no matter if the network is present or not.

Additional info:
The only reason why encrypted /tmp works when the network subsystem is used (or NM is online) is the netfs init script which does mounts all automount definitions from the fstab. If the network subsystem is not used and NM is offline the netfs script exits early and does not mount /tmp.

I've create two independent patches as proposals for a fix.
One attempt is to automount all entries from fstab after an encryption mapping has been created.
The other is an init script which checks if encrypted tmp is used but not mounted and mounts it. I'll attach them to this bug.

Comment 1 Adalbert Prokop 2010-12-27 16:25:00 UTC
Created attachment 470859 [details]
Patch for /etc/init.d/functions

Comment 2 Adalbert Prokop 2010-12-27 16:26:03 UTC
Created attachment 470860 [details]
Init script mounting encrypted /tmp

Comment 3 Bill Nottingham 2011-01-03 16:43:33 UTC
This is a manifestation of a different, older, issue.

*** This bug has been marked as a duplicate of bug 250881 ***