/usr/lib/os-probes/50mounted-tests uses /var as a temporary directory
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
os-prober (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: os-prober
Apart from the fact that os-prober installs itself under the "/usr" hierarchy, thus making it useless to be run in environments where /usr, /var are separate partitions, it also uses the /var directory as a container for temporary mount-points!!!
file: /usr/lib/
43 tmpmnt=
44 if [ ! -d "$tmpmnt" ]; then
45 mkdir "$tmpmnt"
46 fi
47
48 for type in $types $delaytypes; do
49 if mount -o ro -t "$type" "$partition" "$tmpmnt" 2>/dev/null; then
50 debug "mounted as $type filesystem"
51 for test in /usr/lib/
52 debug "running subtest $test"
53 if [ -f "$test" ] && [ -x "$test" ]; then
54 if "$test" "$partition" "$tmpmnt" "$type"; then
55 debug "os found by subtest $test"
56 if ! umount "$tmpmnt"; then
57 warn "failed to umount $tmpmnt"
58 fi
59 rmdir "$tmpmnt" || true
60 exit 0
61 fi
62 fi
63 done
64 if ! umount "$tmpmnt"; then
65 warn "failed to umount $tmpmnt"
66 fi
67 break
68 fi
69 done
70
71 rmdir "$tmpmnt" || true
As I understand, we should use the "/tmp" directory for this purpose and lines 43-46 should read:
43 tmpmnt=
44 if [ ! -d "$tmpmnt" ]; then
45 mkdir -p "$tmpmnt"
46 fi
Use the "-p" option to mkdir to ensure intermediate directories are also created.