k3b usage as non-root/non-wheel user:
First of all, the k3b port expects you to be using a SCSI drive, so if you've a SCSI drive, you probably will not need this step, but for all of us IDE people, there's ATAPICAM, for which the following line must be compiled into the kernel
Code:
device atapicam # ATAPI/CAM device
You must also have ATAPI for CD drives, and SCSI stuff still in your kernel. if you're using GENERIC currently, everything else is already in the kernel.
atapicam is also loadable as a kernel module, atapicam.ko! To use this method instead of recompiling your kernel, add the following to /boot/loader.conf
Code:
atapicam_load="YES"
Also, you should edit your /etc/fstab file, and add all of your CD drives with their ATAPI/CAM device names... Essentially, the easiest way to do this is copy your /dev/acd0 line, paste it to the end of the file, and change it to cd0.
e.g.
Code:
/dev/acd0 /cdrom cd9660 ro,noauto 0 0
/dev/cd0 /cdrom cd9660 ro,noauto 0 0
Now, starting k3b now wouldn't be a help, and you'd get two error messages as it started telling you that both cdrecord and cdrdao are set to run with root privileges, and that you can fix it with K3bSetup, which I've never been able to find, and don't think is used with FreeBSD. However, these two commands will do the trick.
Code:
chmod 4711 /usr/local/bin/cdrecord
chmod 4711 /usr/local/bin/cdrdao
Note: If burning (Video, and I'd assume any DVD without an ISO) DVDs, you must also set /usr/local/bin/growisofs as suid as well
These will set both programs to use the suid of root despite the user who runs them, and thereby give them root priveledges...
At this particular moment, k3b will start wihtout error! But unfortunately, it won't detect any drives either. which means you're SOL, right? Not quite!
This is the part I actually had to figure out without help, so I'm proud of me. From the console output of k3b, it seems that while root can do as it likes, the normal user has no permission to access the devices that ATAPICAM uses. which can be fixed easily enough with...
Code:
chmod 666 /dev/xpt0
chmod 666 /dev/pass0
NOTE: They only require 666, because they do not need root privileges, as do cdrecord and cdrdao.
NOTE2: These permissions will reset after rebooting, so you must add the following to /etc/devfs.conf so the permissions are set properly at boot
NOTE3: If you have more that one CD/DVD drive (i.e acd0, acd1, acd2) that are going through atapicam (i.e cd0, cd1, cd2), you will also have multiple pass devices. make sure permissions are set to 0666 for all of them. There should still only be xpt0 however.
NOTE4: One thing recommended by the k3b port is to add 'devd_enable="YES"' to /etc/rc.conf... it seems like a good idea to me
... It helps give permanence to the changes in /etc/devfs.conf
Code:
perm xpt0 0666
perm pass0 0666
There! Your k3b should be working perfectly as a normal, non-root, non-wheel user!