DaemonForums  

Go Back   DaemonForums > Miscellaneous > Guides

Guides All Guides and HOWTO's.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 10th May 2008
Nirbo Nirbo is offline
Real Name: Nicholas Kirby
Fdisk Soldier
 
Join Date: May 2008
Location: Edmonton, Alberta, Canada
Posts: 68
Default k3b as non-privileged user

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!

Last edited by Carpetsmoker; 10th May 2008 at 07:02 AM. Reason: Fix title, bbcode, and spelling
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New FreeBSD user. I need help! rowebil FreeBSD Installation and Upgrading 2 9th March 2009 08:01 PM
user permission... lumiwa FreeBSD General 12 30th September 2008 02:28 AM
dd+user=trouble graudeejs FreeBSD Security 4 26th September 2008 03:48 PM


All times are GMT. The time now is 04:10 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick