Problem mit capability's und Kernel 2.6

Jürgen Braun <[email protected]>
Newsgroups gmane.linux.dazuko.devel
Message-ID <[email protected]>
Hi

Da ich es nicht geschafft hab, meinen bind9 mit einem geladenen dazuko 
zu starten (Fehlermeldung auf Debian sarge: named: capset failed: 
Operation not permitted.) hab ich ein bischen experimentiert und bin auf 
folgendes gekommen. Wieso nicht einfach dem dazuko die capabilities des 
default-moduls mitgeben? Für Kernel 2.6.5 musste ich dazu einfach das
static struct security_operations dazuko_ops folgendermasen abändern:

static struct security_operations dazuko_ops = {
	.inode_permission =		dazuko_inode_permission,
	.ptrace =			cap_ptrace,
	.capget =			cap_capget,
	.capset_check =			cap_capset_check,
	.capset_set =			cap_capset_set,
	.capable =			cap_capable,
	.netlink_send =			cap_netlink_send,
	.netlink_recv =			cap_netlink_recv,

	.bprm_compute_creds =		cap_bprm_compute_creds,
/* Obige Zeile kommt aus Kernel 2.6.5 */

/*	.bprm_apply_creds =		cap_bprm_apply_creds, */
/* Obile Zeile kommt aus Kernel 2.6.6 */

	.bprm_set_security =		cap_bprm_set_security,
	.bprm_secureexec =		cap_bprm_secureexec,
	.inode_setxattr =		cap_inode_setxattr,
	.inode_removexattr =		cap_inode_removexattr,
	.task_post_setuid =		cap_task_post_setuid,
	.task_reparent_to_init =	cap_task_reparent_to_init,
	.syslog =                       cap_syslog,
	.vm_enough_memory =             cap_vm_enough_memory,
};

Die entspechenden Zeilen hab ich einfach aus security/capability.c 
kopiert. Man beachte die Änderungen von 2.6.5 zu 2.6.6. Damit jetzt 
dazuko.ko geladen werden kann muss das Modul commoncap.ko geladen sein. 
Das bekommt man wenn die Frage "Default Linux Capabilities" in der 
Kernelconfig mit M beantwortet wird. Mit dem so geänderten Modul kann 
ich sowohl meinen bind9 starten als auch den antivir laufen lassen.


Jürgen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.