Bug: bctool uses hardcoded location for mkfs.msdos and sys-fs/dosfstools puts the binary in another location. Fix: Alternative 1: (prefered) Make the sys-fs/dosfstools ebuild link the binaries to /sbin where the other mkfs utils are: ln -s /usr/sbin/mkfs.msdos /sbin ln -s /usr/sbin/mkfs.vfat /sbin ln -s /usr/sbin/mkfs.ntfs /sbin Alternative 2: Patch bctool to look in /usr/sbin. Reproducible: Always Steps to Reproduce: 1. emerge bestcrypt dosfstools 2. bctool new -s 10M -t vfat test.jbc -a blowfish 3. bcformat -t vfat -a blowfish test.jbc Actual Results: Error: mkfs.msdos not found Expected Results: bctool should find the mkfs binary and format the container.
base-system: which do you recommend? I can look into patching app-crypt/bestcrypt if necessary.
bctool should be smart enough to search $PATH and fall back to hardcoded paths
I tried this in bcformat.c: if (stat("/sbin/mkfs.msdos", &mkfs_path) == -1 && errno == ENOENT) { command[0]="/usr/sbin/mkfs"; } else { command[0]="/sbin/mkfs"; } For some reason, when I run it I get "execve /usr/sbin/mkfs failed: No such file or directory". Don't know why it is not picking up the .msdos thing...
(In reply to comment #3) > For some reason, when I run it I get "execve /usr/sbin/mkfs failed: No such file > or directory". Don't know why it is not picking up the .msdos thing... Because execve() is being told to run /usr/sbin/mkfs -t vfat <args> not /usr/sbin/mkfs.vfat <args>. The mkfs binary is located in /sbin and will try to run the mkfs.<fstype> when it is called this is why the better approach will be to link in the dosfstool's to the /sbin directory. Not doing so breaks mkfs.
Created attachment 69684 [details] ebuild that links in mkfs.msdos mkfs.vfat mkfs.ntfs to /sbin New ebuild for dosfstools that links in mkfs.msdos mkfs.vfat mkfs.ntfs to /sbin "mkfs -t {vfat,msdos,ntfs}" is currently broken, this fixes it.
This is in no way portage's domain... it's the crypto herd's, leave it assigned to them (they're the ones responsible for it). :)
stop screwing around with the assigned field
Created attachment 69799 [details, diff] bestcrypt-1.6_p1-mkfs-path.diff Mind testing this patch?
Created attachment 69802 [details, diff] bestcrypt-1.6_p1-mkfs-path.diff
(In reply to comment #9) > Created an attachment (id=69802) [edit] > bestcrypt-1.6_p1-mkfs-path.diff > Just to be picky, there is the case of mkfs.ntfs. If you look at line 226 of misc.c: char *env[] = { "PATH=/sbin", NULL}; Would it not be enough to include /usr/sbin in the environment to execve? Cheers Alexander Wigen
That is probably a much better solution. I was trying to mess as little as possible with it, but made a nasty patch. Oh well. I'll give it a try asap...
I think this is fixed in 1.6_p2 as it no longer forces the environment in misc.c. Please confirm.
(In reply to comment #12) > I think this is fixed in 1.6_p2 as it no longer forces the environment in > misc.c. > > Please confirm. I can confirm that this is _NOT_ fixed in 1.6_p2 The steps listed in the initial bug report still produce the same output.
Alexander - I've applied your fix from comment 10. Must of been reading the wrong file before. I had some trouble testing it. SEGVs and the such. Can you please confirm if it works or not. Is this an issue? http://www.jetico.com/linux/bcrypt-help/l_probl.htm#udev my permissions: brw-rw---- 1 root disk 188, 0 Nov 12 20:13 /dev/bcrypt0 brw-rw---- 1 root disk 188, 1 Nov 12 20:13 /dev/bcrypt1 brw-rw---- 1 root disk 188, 10 Nov 12 20:13 /dev/bcrypt10 brw-rw---- 1 root disk 188, 11 Nov 12 20:13 /dev/bcrypt11 brw-rw---- 1 root disk 188, 12 Nov 12 20:13 /dev/bcrypt12 brw-rw---- 1 root disk 188, 13 Nov 12 20:13 /dev/bcrypt13 brw-rw---- 1 root disk 188, 14 Nov 12 20:13 /dev/bcrypt14 brw-rw---- 1 root disk 188, 15 Nov 12 20:13 /dev/bcrypt15 brw-rw---- 1 root disk 188, 2 Nov 12 20:13 /dev/bcrypt2 brw-rw---- 1 root disk 188, 3 Nov 12 20:13 /dev/bcrypt3 brw-rw---- 1 root disk 188, 4 Nov 12 20:13 /dev/bcrypt4 brw-rw---- 1 root disk 188, 5 Nov 12 20:13 /dev/bcrypt5 brw-rw---- 1 root disk 188, 6 Nov 12 20:13 /dev/bcrypt6 brw-rw---- 1 root disk 188, 7 Nov 12 20:13 /dev/bcrypt7 brw-rw---- 1 root disk 188, 8 Nov 12 20:13 /dev/bcrypt8 brw-rw---- 1 root disk 188, 9 Nov 12 20:13 /dev/bcrypt9 if so I'll add a /etc/udev/rules.d files. The init script is really rough. Suggestions welcome.
Created attachment 72755 [details, diff] bestcrypt-1.6_p2-mkfs-path.diff This set's the environment variable (PATH) to search /usr/sbin as well. Note setting the variable to PATH=/sbin:/usr/sbin does not work but PATH=/usr/sbin:/sbin does, why? This patch is tested and works for me.
does it still work for ext2 and other /sbin mkfs filesystems?
(In reply to comment #16) > does it still work for ext2 and other /sbin mkfs filesystems? It works with ext2, ext3 and all filesystems I have mkfs' for in /sbin except cramfs which needs extra parameters. Cheers Alex