| Summary: | bctool uses hardcoded location for mkfs.msdos | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Alexander Wigen <bugzilla> |
| Component: | New packages | Assignee: | Crypto team [DISABLED] <crypto+disabled> |
| Status: | RESOLVED TEST-REQUEST | ||
| Severity: | major | ||
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
ebuild that links in mkfs.msdos mkfs.vfat mkfs.ntfs to /sbin
bestcrypt-1.6_p1-mkfs-path.diff bestcrypt-1.6_p1-mkfs-path.diff bestcrypt-1.6_p2-mkfs-path.diff |
||
|
Description
Alexander Wigen
2005-09-29 01:56:01 UTC
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 |