Files hardlinked to others may be set to zero size
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux (Ubuntu) |
Expired
|
Medium
|
Unassigned |
Bug Description
Install Ubuntu 12.04, then upgrade to the latest kernel-image. Create a filesystem like:
mkdir orig
move various picture files into "orig", then do
ln orig/* .
now you'll have a directory with the original files in "orig" and hardlinked copies in "."
Next start up digikam, work on these hardlinked pictures: change them, add or delete comments, upload them ...
Next step: run
find . -size 0
You'll find all pictures you've worked on in "orig" to show up with size 0!
The original data contained in these is lost. No recover. The files are actually of zero size! It is not only digicam, but others to: as soon as a file is read, and then overwritten, all not opened hardlinked files show zero size. Only the one file you've opened keeps its size and holds data.
I've found this behaviour with:
- digikam
- rsync
- kate
I am assuming the kernel not korrectly handling hardlinks under certain circumstances.
Only possible workaround at the moment: do not use hardlinks! Copy files!
The bug may be used to zero out configuration files and, if they are empty gain access to things no access was granted, if you do
ln /etc/configfile /home/user/
then work on /home/user/
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: bash 4.2-2ubuntu2
Uname: Linux 3.4.10 x86_64
ApportVersion: 2.0.1-0ubuntu13
Architecture: amd64
Date: Mon Sep 17 12:29:14 2012
InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
ProcEnviron:
LANGUAGE=de_DE:en
TERM=screen-bce
PATH=(custom, user)
LANG=de_DE.UTF-8
SHELL=/bin/bash
SourcePackage: bash
UpgradeStatus: Upgraded to precise on 2012-07-16 (62 days ago)
modified.
modified.
mtime.conffile.
mtime.conffile.
---
ApportVersion: 2.0.1-0ubuntu13
Architecture: amd64
DistroRelease: Ubuntu 12.04
InstallationMedia: Xubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
Package: linux (not installed)
ProcEnviron:
LANGUAGE=de_DE:en
TERM=screen-bce
PATH=(custom, no user)
LANG=de_DE.UTF-8
SHELL=/bin/bash
Tags: precise
Uname: Linux 3.4.11 x86_64
UnreportableReason: The running kernel is not an Ubuntu kernel
UpgradeStatus: Upgraded to precise on 2012-07-16 (63 days ago)
UserGroups: pkcs11
affects: | bash (Ubuntu) → ubuntu |
affects: | ubuntu → linux (Ubuntu) |
tags: | added: apport-collected |
description: | updated |
This is true for all 3.2.x, 3.3.x, 3.4.x kernels. I didn't test the 3.5.x series, nor 3.6.x series