From: LaMont Jones Date: Fri, 14 May 2010 11:07:14 +0000 (-0600) Subject: Merge remote branch 'origin/master' into HEAD X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cbdfd84fde6159d7778e70618fbbc8df219cafe;p=util-linux Merge remote branch 'origin/master' into HEAD Conflicts: lib/fsprobe.c mount/lomount.c --- 3cbdfd84fde6159d7778e70618fbbc8df219cafe diff --cc mount/lomount.c index 90bc92c0,6130be1d..db6d5326 --- a/mount/lomount.c +++ b/mount/lomount.c @@@ -989,9 -915,7 +991,9 @@@ main(int argc, char **argv) int showdev = 0; int ro = 0; int pfd = -1; + int keysz = 0; + int hash_pass = 1; - unsigned long long off, slimit; + uintmax_t off = 0, slimit = 0; struct option longopts[] = { { "all", 0, 0, 'a' }, { "set-capacity", 0, 0, 'c' }, @@@ -1017,10 -938,7 +1019,8 @@@ textdomain(PACKAGE); capacity = delete = find = all = 0; - off = 0; - slimit = 0; assoc = offset = sizelimit = encryption = passfd = NULL; + keysize = NULL; progname = argv[0]; if ((p = strrchr(progname, '/')) != NULL) diff --cc mount/mount.c index 464ca54f,969e81fc..26a8afed --- a/mount/mount.c +++ b/mount/mount.c @@@ -209,8 -201,8 +210,9 @@@ static int opt_nofail = 0 static const char *opt_loopdev, *opt_vfstype, *opt_offset, *opt_sizelimit, *opt_encryption, *opt_speed, *opt_comment, *opt_uhelper; +static const char *opt_keybits, *opt_nohashpass; + static int is_readonly(const char *node); static int mounted (const char *spec0, const char *node0); static int check_special_mountprog(const char *spec, const char *node, const char *type, int flags, char *extra_opts, int *status); @@@ -1099,9 -1116,24 +1128,24 @@@ loop_check(const char **spec, const cha *type = opt_vfstype; } - *loop = ((*flags & MS_LOOP) || *loopdev || opt_offset || opt_sizelimit || opt_encryption); + *loop = ((*flags & MS_LOOP) || *loopdev || opt_offset || opt_sizelimit || opt_encryption || opt_keybits); *loopfile = *spec; + /* Automatically create a loop device from a regular file if a filesystem + * is not specified or the filesystem is known for libblkid (these + * filesystems work with block devices only). + * + * Note that there is not a restriction (on kernel side) that prevents regular + * file as a mount(2) source argument. A filesystem that is able to mount + * regular files could be implemented. + */ + if (!*loop && (!*type || strcmp(*type, "auto") == 0 || + fsprobe_known_fstype(*type))) { + struct stat st; + if (stat(*loopfile, &st) == 0) + *loop = S_ISREG(st.st_mode); + } + if (*loop) { *flags |= MS_LOOP; if (fake) {