vdev icon indicating copy to clipboard operation
vdev copied to clipboard

udev rules to vdev ACLs compiler

Open jcnelson opened this issue 9 years ago • 5 comments

Create and document a script that compiles udev rules into vdev ACL definitions.

jcnelson avatar Dec 13 '14 07:12 jcnelson

do you mean you just need a udev rule parser or is there a specific format to convert them to?

GravisZro avatar Dec 24 '14 10:12 GravisZro

I need a way to translate a udev rules file into one or more vdev-specific files, to ease migrating from udev to vdev. At the time of this writing (and I apologize that this is currently undocumented), vdev uses ini-style files to describe ACLs to apply and actions to take when a device appears or disappears. They're completely different from udev rules files.

As much as I would have liked to, I couldn't use udev's rules format for vdev because:

  • it isn't expressive enough to do per-process access control (something vdev will need to do)
  • it suffers from mission creep (example: why do rules files need flow-control with GOTO?), requiring a complex parser implementation in vdev
  • since udev is a moving target, it would be hard to keep a vdev-specific re-implementation of udev's rules parser consistent with upstream (and since I plan to dual-license vdev under something BSD-ish, I would need to make clean-room re-implementation, not a fork).

jcnelson avatar Dec 24 '14 17:12 jcnelson

ok... while i didnt actually make it write out to an ini format (not sure exactly how you want it), i did make a udev rules file parser from scratch. it should be easy to make it do what you like, the default behavior just prints the rules after they are parsed. here: http://adaptivetime.com/udev_parser.tar.gz do whatever you like with it.

GravisZro avatar Dec 25 '14 07:12 GravisZro

Hey, this is great! Thank you so much! I can definitely use this as a starting point for converter tool.

In the quite likely event that your code gets incorporated into a tool in the master branch, can you please let me know:

  • if you would be willing to license your code under the ISC license?
  • how you would like to be named in the CONTRIBUTORS file, or any subsequent credits listing? If you'd prefer to talk privately, please feel free to email me.

Thanks!

jcnelson avatar Dec 27 '14 18:12 jcnelson

the ISC license is fine and sure, just list me as "Gravis". i've been working on a wikicode parser so this was a cakewalk. :)

GravisZro avatar Dec 27 '14 20:12 GravisZro