All of lore.kernel.org
 help / color / mirror / Atom feed
* fix setfiles segfault caused by libselinux-1.22
@ 2005-04-04 13:08 Andreas Steinmetz
  2005-04-04 15:30 ` Stephen Smalley
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Steinmetz @ 2005-04-04 13:08 UTC (permalink / raw)
  To: selinux

[-- Attachment #1: Type: text/plain, Size: 292 bytes --]

setfiles does reset user defined functions by calling the related setup
function with NULL as argument. Instead of resetting to the default
these setup functions did set up NULL as the function pointer. Fix attached.
-- 
Andreas Steinmetz                       SPAMmers use robotrap@domdv.de

[-- Attachment #2: libselinux-1.22.diff --]
[-- Type: text/plain, Size: 617 bytes --]

--- libselinux-1.22.orig/src/matchpathcon.c	2005-04-04 15:01:14.000000000 +0200
+++ libselinux-1.22/src/matchpathcon.c	2005-04-04 15:01:23.000000000 +0200
@@ -29,7 +29,10 @@
 
 void set_matchpathcon_printf(void (*f)(const char *fmt, ...))
 {
-	myprintf = f;
+	if (f)
+		myprintf = f;
+	else
+		myprintf = &default_printf;
 }
 
 static int default_invalidcon(const char *path, unsigned lineno, char *context)
@@ -45,7 +48,10 @@
 
 void set_matchpathcon_invalidcon(int (*f)(const char *p, unsigned l, char *c))
 {
-	myinvalidcon = f;
+	if (f)
+		myinvalidcon = f;
+	else
+		myinvalidcon = &default_invalidcon;
 }
 
 /*

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-04 15:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-04 13:08 fix setfiles segfault caused by libselinux-1.22 Andreas Steinmetz
2005-04-04 15:30 ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.