Description of problem: lvm device not creation does not have the proper owner group and permission. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1. compile lvm2 with DM_DEVICE_UID, DM_DEVICE_GID, DM_DEVICE_MODE different than default. 2. ls -l on the device nodes lvm creates 3. Actual results: Expected results: Additional info:
Are you using udev? If so, its setting will override compiled-in ones.
Thanks for the quick reply and happy holidays. I understand that with udev this is irrelevant. No, I am using it in NetBSD and we don't have devfs. We don't even compile this part of the code, but I thought you would want to put it in just for correctness.
Created attachment 470739 [details] amended patch (umask save/restore addition and restore on error)
Patch was against which old version? Some of this has already changed (and got fixed?) in upstream CVS.
I am working against 2.02.56(1) (2009-11-24). If some of it still applies, please change it and we'll import a new version. Thanks!
Just the control node hunk is still needed - we'll fix that.
Committed upstream (libdevmapper 1.02.61, lvm2 2.02.80).
Though we don't use the "chown(control, DM_DEVICE_UID, DM_DEVICE_GID)" - only root can use the control node, so changing this would be useless.
How access control is defined is up to the kernel implementation of the ioctl commands for the control device node to decide. For example on the NetBSD lvm2 kernel implementation we allow group operator to do inspection operations to the lvm system (and disallow changes for non root users). Please make sure if you are making this change that your kernel implementation of the ioctl() commands does the proper access checking and does not depend on the mode of the device node.
The linux kernel currently requires root for the dm ioctls. The current userspace implementation here assumes the /dev dir is also restricted to root i.e. drwxr-xr-x and trusted.
The fix is in rawhide now (lvm2-2.02.81-1, device-mapper-1.02.61-1).