Bug#314985: pmount: doesn't work with kernel 2.6.12

2005-06-20 Thread Martin Pitt
Hi!

Daniel Bayer [2005-06-19 22:46 +0200]:
 I just updated to kernel 2.6.12 and now I can't mount my usb
 harddrive with pmount anymore because it is not marked as removeable
 in /sys:
 | [EMAIL PROTECTED]:/ $ cat /sys/block/sdb/removable 
 | 0
 | [EMAIL PROTECTED]:/ $ 
 
 My usbstick still works fine:
 | [EMAIL PROTECTED]:/ $ cat /sys/block/sda/removable 
 | 1
 | [EMAIL PROTECTED]:/ $
 
 I don't know if this is intended by the kernel folk or if it is
 just a bug, but maybe you should consider detecting removeable media
 similar like hal does in /etc/udev/scripts/device-removable.sh.

In fact I already do, if a device is attached to USB or FireWire, it
is also permitted to be mounted. What does

  pmount -d /dev/sdbX

say? (With X being an appropriate partition number of course)

Martin
-- 
Martin Pitt Debian GNU/Linux Developer
[EMAIL PROTECTED]  [EMAIL PROTECTED]
http://www.piware.de http://www.debian.org


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#314985: pmount: doesn't work with kernel 2.6.12

2005-06-20 Thread Daniel Bayer
Hello,

On Mon, Jun 20, 2005 at 08:40:52AM +0200, Martin Pitt wrote:
 Daniel Bayer [2005-06-19 22:46 +0200]:
  I just updated to kernel 2.6.12 and now I can't mount my usb
  harddrive with pmount anymore because it is not marked as removeable
  in /sys:
  | [EMAIL PROTECTED]:/ $ cat /sys/block/sdb/removable 
  | 0
  | [EMAIL PROTECTED]:/ $ 
  
  My usbstick still works fine:
  | [EMAIL PROTECTED]:/ $ cat /sys/block/sda/removable 
  | 1
  | [EMAIL PROTECTED]:/ $
  
  I don't know if this is intended by the kernel folk or if it is
  just a bug, but maybe you should consider detecting removeable media
  similar like hal does in /etc/udev/scripts/device-removable.sh.
 
 In fact I already do, if a device is attached to USB or FireWire, it
 is also permitted to be mounted. What does
 
   pmount -d /dev/sdbX
 
 say? (With X being an appropriate partition number of course)

It seems it only looks for /sys/.../removable:
| [EMAIL PROTECTED]:~ $ LC_MESSAGES=C pmount -d /dev/sda1
| resolved /dev/sda1 to device /dev/sda1
| mount point to be used: /media/sda1
| no iocharset given, current locale encoding is UTF-8
| locale encoding uses UTF-8, setting iocharset to 'utf8'
| Cleaning lock directory /var/lock/pmount/_dev_sda1
| device_whitelist: checking /etc/pmount.allow...
| device_whitlisted(): nothing matched, returning 0
| find_sysfs_device: looking for sysfs directory for device 8:1
| find_sysfs_device: checking whether /dev/sda1 is on /sys/block/sda (8:0)
| find_sysfs_device: major device numbers matchfind_sysfs_device: minor device 
numbers do not match, checking partitions...find_sysfs_device: checking whether 
device /dev/sda1 matches partition 8:0
| find_sysfs_device: checking whether device /dev/sda1 matches partition 8:1
| find_sysfs_device: - partition matches, belongs to block device 
/sys/block/sda
| device_removable: corresponding block device for /dev/sda1 is /sys/block/sda
| get_blockdev_attr: value of /sys/block/sda/removable == 0
| Error: device /dev/sda1 is not removable
| policy check failed
| [EMAIL PROTECTED]:~ $ 


Daniel


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#314985: pmount: doesn't work with kernel 2.6.12

2005-06-20 Thread Daniel Bayer
Hello,

after some digging I think I found the problem in the function
sysfs_get_device_parent() of libsysfs1. If called by pmount it alway
returns NULL.

I think this is because it tries to get the parent by removing the
last part of the pathname. To make sure that it really gets a device
it checks for the presence of /detach_state. But there is no file
called detach_state in my entire /sys! Maybe this is somehow related
to http://lkml.org/lkml/2005/5/17/234 .

And here for reference the code libsysfs is executing
(sysfs_device.c:610):
| /*
|  * All devices have the detach_state attribute - validate here
|  */
| safestrcat(ppath, /detach_state);
| if ((sysfs_path_is_file(ppath)) != 0) {
|   dprintf(Device at %s does not have a parent\n, dev-path);
|   return NULL;
| }


Daniel


signature.asc
Description: Digital signature


Bug#314985: pmount: doesn't work with kernel 2.6.12

2005-06-19 Thread Daniel Bayer
Package: pmount
Version: 0.8-2
Severity: normal

Hello,

I just updated to kernel 2.6.12 and now I can't mount my usb
harddrive with pmount anymore because it is not marked as removeable
in /sys:
| [EMAIL PROTECTED]:/ $ cat /sys/block/sdb/removable 
| 0
| [EMAIL PROTECTED]:/ $ 

My usbstick still works fine:
| [EMAIL PROTECTED]:/ $ cat /sys/block/sda/removable 
| 1
| [EMAIL PROTECTED]:/ $

I don't know if this is intended by the kernel folk or if it is
just a bug, but maybe you should consider detecting removeable media
similar like hal does in /etc/udev/scripts/device-removable.sh.

TIA


Daniel


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]