K3B crashes in new 2.6.x linux kernels

Popular k3b application used for cd/dvd recording stops working after kernel upgrade.
Reason and workarouds descriptions comes here.

Main reason why it happens described by Marc Ballarin in linux-kernel list:

Due to the newly added command filtering, you now need to run cdrecord as root.
Since cdrecord will drop root privileges before accessing the drive,setuid root won't help.
This means you will have to run cdrecord *and* k3b as root!
IMHO it is more secure to simply disable filtering, and run the software as non-root.
This patch restores the behaviour of previous kernels, security issues included:

--- linux-2.6.8/drivers/block/scsi_ioctl.c~ 2004-08-16 14:16:57.000000000 +0200
+++ linux-2.6.8/drivers/block/scsi_ioctl.c 2004-08-16 14:36:22.562908552 +0200
@@ -196 +196 @@
- if (verify_command(file, cmd))
+/* if (verify_command(file, cmd))
@@ -198 +198 @@
-
+*/

The second way does not require kernel re-compilation. Proposed by somebody at the kerneltrap.org:

You can work around this by using sudo. Add users and relevant commands to /etc/sudoers using `visudo' (see sudo and sudoers manpages). eg. in /etc/sudoers:
username ALL=NOPASSWD:/usr/bin/cdrecord,/usr/bin/cdrdao
then in your .bashrc add these aliases:
alias cdrecord='sudo cdrecord'
alias cdrdao='sudo cdrdao'

This allows you to use cdrecord and cdrdao as a user without typing 'sudo' every time or being asked for a password. You'll have to do the same with cdda2wav and cdparanoia if you use those too.

Personally I use k3b with followed Desktop Entry:

[Desktop Entry]
Comment=
Comment[en_US]=
Encoding=UTF-8
Exec=k3b
GenericName=
GenericName[en_US]=
Icon=exec
MimeType=
Name=K3b
Name[en_US]=K3b
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DCOP-ServiceType=
X-KDE-SubstituteUID=true
X-KDE-Username=root

It looks good enough for me and solve all problems

That's it, folks.

Comments

re:

Thanks for this very good and informative articles.

re:

Excellent. Thanks for sharing this informative articles. I found another good articles about linux manual. You can check it out at pdfph.com.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.