Ticket #11799 (closed defect: fixed)
ext2 filesystem non-unique directories can be created
|Reported by:||Quozl||Owned by:||Quozl|
|Component:||ofw - open firmware||Version:||Development firmware|
|Action Needed:||no action||Verified:||no|
|Deployments affected:||Blocked By:|
It is possible to create multiple directories of the same name on an ext2 filesystem. Probably also ext3 and ext4.
$mkdir should do an early successful exit if the directory already exists rather than create a duplicate.
ok mkdir int:\test ok mkdir int:\test ok mkdir int:\test ok mkdir int:\test
e2fsck -f /dev/mmcblk0p1 e2fsck 1.41.12 (17-May-2010) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Duplicate entry 'test' found. Marking / (2) to be rebuilt. Pass 3: Checking directory connectivity Pass 3A: Optimizing directories Entry 'test' in / (2) has a non-unique filename. Rename to te~0<y>? yes Entry 'test' in / (2) has a non-unique filename. Rename to te~1<y>? yes Entry 'test' in / (2) has a non-unique filename. Rename to te~2<y>? yes Pass 4: Checking reference counts Pass 5: Checking group summary information Boot: ***** FILE SYSTEM WAS MODIFIED ***** Boot: 70/16384 files (10.0% non-contiguous), 29339/65536 blocks