From: LaMont Jones Date: Mon, 6 Sep 2010 20:13:57 +0000 (-0600) Subject: Merge remote branch 'origin/master' X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eb3eeb38b6129c7236e9661e12f49bf8e42c085f;p=util-linux Merge remote branch 'origin/master' Conflicts: mount/lomount.c --- eb3eeb38b6129c7236e9661e12f49bf8e42c085f diff --cc mount/lomount.c index db6d5326,03aae4b2..00107d67 --- a/mount/lomount.c +++ b/mount/lomount.c @@@ -972,14 -908,9 +977,15 @@@ usage(FILE *f) " -p | --pass-fd read passphrase from file descriptor \n" " -r | --read-only setup read-only loop device\n" " --show print device name (with -f )\n" + " -N | --nohashpass Do not hash the given password (Debian hashes)\n" + " -k | --keybits specify number of bits in the hashed key given\n" + " to the cipher. Some ciphers support several key\n" + " sizes and might be more efficient with a smaller\n" + " key size. Key sizes < 128 are generally not\n" + " recommended\n" " -v | --verbose verbose mode\n\n")); - exit(1); + + exit(f == stderr ? EXIT_FAILURE : EXIT_SUCCESS); } int @@@ -1048,13 -972,11 +1054,16 @@@ main(int argc, char **argv) case 'f': find = 1; break; + case 'h': + usage(stdout); + break; case 'j': assoc = optarg; + case 'k': + keysize = optarg; + break; + case 'N': + hash_pass = 0; break; case 'o': offset = optarg; @@@ -1144,11 -1066,9 +1153,11 @@@ res = show_loop(device); else { if (passfd && sscanf(passfd, "%d", &pfd) != 1) - usage(); + usage(stderr); + if (keysize && sscanf(keysize,"%d",&keysz) != 1) - usage(); ++ usage(stderr); do { - res = set_loop(device, file, off, slimit, encryption, pfd, &ro); + res = set_loop(device, file, off, slimit, encryption, pfd, &ro, keysz, hash_pass); if (res == 2 && find) { if (verbose) printf(_("stolen loop=%s...trying again\n"),