tests: use the "nobody" user's group as the default group id
[coreutils/ericb.git] / tests / mv / vfat
blob32452e1f80e8cd181b03c7ee4be327c24de9d6d9
1 #!/bin/sh
2 # This is just for the record.
3 # This test is not run.
5 # Copyright (C) 2003, 2009 Free Software Foundation, Inc.
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 exit 0
22 cat <<\EOF
24 Prior to 5.0.91, ...
26 The problem:
27 On a VFAT file system with coreutils-5.0.90, `mv FOO foo' removes the
28 sole copy of the file named by both the source and destination arguments.
30 Demonstrate the problem, as root:
32 cd /tmp \
33 && dd if=/dev/zero of=1 bs=8192 count=50 \
34 && mkdir mnt && mkfs -t vfat 1 \
35 && mount -oloop 1 mnt && cd mnt \
36 && printf something important > foo \
37 && mv foo FOO
38 test -f FOO && echo PASS-1 || echo FAIL-1
39 ln foo bar
40 mv foo FOO
41 test -f FOO && echo PASS-2 || echo FAIL-2
43 And in case you actually do the above, you can do this to clean up:
45 cd /tmp && umount /tmp/mnt && rm -r 1 mnt
47 Hey! Can't create hard links on vfat.
48 The above `ln' evokes an `operation not permitted' failure.
50 This demonstrates the same thing with file system type `umsdos'
51 No hard links:
53 cd /tmp \
54 && dd if=/dev/zero of=1 bs=8192 count=50 \
55 && mkdir mnt && mkfs -t msdos 1 \
56 && mount -t umsdos -oloop 1 mnt && cd mnt \
57 && printf something important > foo \
58 && mv foo FOO
59 test -f FOO && echo PASS-1 || echo FAIL-1
60 ln foo bar
61 mv foo FOO
62 test -f FOO && echo PASS-2 || echo FAIL-2
64 EOF