First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 107572
Alias:
Product:
Component:
Status: RESOLVED
Resolution: TEST-REQUEST
Assigned To: Crypto team <crypto@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Alexander Wigen <bugzilla@wigen.net>
Add CC:
CC:
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
dosfstools-2.11-r1.ebuild ebuild that links in mkfs.msdos mkfs.vfat mkfs.ntfs to /sbin text/plain Alexander Wigen 2005-10-01 22:54 0000 1.22 KB Details
bestcrypt-1.6_p1-mkfs-path.diff bestcrypt-1.6_p1-mkfs-path.diff patch Marcelo Goes 2005-10-03 11:11 0000 1.30 KB Details | Diff
bestcrypt-1.6_p1-mkfs-path.diff bestcrypt-1.6_p1-mkfs-path.diff patch Marcelo Goes 2005-10-03 11:17 0000 1.53 KB Details | Diff
bestcrypt-1.6_p2-mkfs-path.diff bestcrypt-1.6_p2-mkfs-path.diff patch Alexander Wigen 2005-11-12 08:06 0000 347 bytes Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 107572 depends on: Show dependency tree
Show dependency graph
Bug 107572 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)







View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-09-29 01:56 0000
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.

------- Comment #1 From Marcelo Goes 2005-09-29 11:40:14 0000 -------
base-system: which do you recommend?
I can look into patching app-crypt/bestcrypt if necessary.

------- Comment #2 From SpanKY 2005-09-29 12:48:03 0000 -------
bctool should be smart enough to search $PATH and fall back to hardcoded paths

------- Comment #3 From Marcelo Goes 2005-10-01 15:49:37 0000 -------
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...

------- Comment #4 From Alexander Wigen 2005-10-01 20:56:56 0000 -------
(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. 

------- Comment #5 From Alexander Wigen 2005-10-01 22:54:30 0000 -------
Created an attachment (id=69684) [edit]
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.

------- Comment #6 From Brian Harring 2005-10-01 23:01:06 0000 -------
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). :)

------- Comment #7 From SpanKY 2005-10-03 06:05:46 0000 -------
stop screwing around with the assigned field

------- Comment #8 From Marcelo Goes 2005-10-03 11:11:39 0000 -------
Created an attachment (id=69799) [edit]
bestcrypt-1.6_p1-mkfs-path.diff

Mind testing this patch?

------- Comment #9 From Marcelo Goes 2005-10-03 11:17:57 0000 -------
Created an attachment (id=69802) [edit]
bestcrypt-1.6_p1-mkfs-path.diff

------- Comment #10 From Alexander Wigen 2005-10-03 18:23:44 0000 -------
(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 

------- Comment #11 From Marcelo Goes 2005-10-03 19:21:41 0000 -------
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...

------- Comment #12 From Daniel Black 2005-11-10 11:27:37 0000 -------
I think this is fixed in 1.6_p2 as it no longer forces the environment in 
misc.c. 
 
Please confirm. 

------- Comment #13 From Alexander Wigen 2005-11-11 00:23:50 0000 -------
(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. 

------- Comment #14 From Daniel Black 2005-11-12 02:02:33 0000 -------
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. 

------- Comment #15 From Alexander Wigen 2005-11-12 08:06:10 0000 -------
Created an attachment (id=72755) [edit]
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.

------- Comment #16 From Daniel Black 2005-11-12 16:45:01 0000 -------
does it still work for ext2 and other /sbin mkfs filesystems? 

------- Comment #17 From Alexander Wigen 2005-11-12 18:47:29 0000 -------
(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 

First Last Prev Next    No search results available      Search page      Enter new bug