2000-07-06 Theodore Ts'o <tytso@valinux.com>
+ * fsck.c (lookup, load_fs_info, check_all): Use lazy evaluation
+ for calling interpret_device(), since this requires root
+ privileges if the partitions need to be scanned.
+ Otherwise, it's not possible to do non-proot fsck's for
+ removeable devices such as floppies if there are any
+ LABEL= or UUID= entries in /etc/fstab.
+
* badblocks.c (check_mount, main): Check to see if the filesystem
is mounted before doing a read/write or non-destructive
test. This can be overriden using the new -f option.
}
if (!fs)
continue;
- fs->device = interpret_device(fs->device);
if (!filesys_info)
filesys_info = fs;
else
static struct fs_info *lookup(char *filesys)
{
struct fs_info *fs;
+ int try_again = 0;
/* No filesys name given. */
if (filesys == NULL)
return NULL;
for (fs = filesys_info; fs; fs = fs->next) {
+ if (strchr(fs->device, '='))
+ try_again++;
+ if (!strcmp(filesys, fs->device) ||
+ !strcmp(filesys, fs->mountpt))
+ break;
+ }
+
+ if (fs || !try_again)
+ return fs;
+
+ for (fs = filesys_info; fs; fs = fs->next) {
+ fs->device = interpret_device(fs->device);
if (!strcmp(filesys, fs->device) ||
!strcmp(filesys, fs->mountpt))
break;
break;
}
if (fs && !skip_root && !ignore(fs)) {
+ fs->device = interpret_device(fs->device);
fsck_device(fs->device, 1);
fs->flags |= FLAG_DONE;
status |= wait_all();
/*
* Spawn off the fsck process
*/
+ fs->device = interpret_device(fs->device);
fsck_device(fs->device, serialize);
fs->flags |= FLAG_DONE;