All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Steinmetz <ast@domdv.de>
To: selinux@tycho.nsa.gov
Subject: fix setfiles segfault caused by libselinux-1.22
Date: Mon, 04 Apr 2005 15:08:55 +0200	[thread overview]
Message-ID: <42513C67.7020604@domdv.de> (raw)

[-- 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;
 }
 
 /*

             reply	other threads:[~2005-04-04 13:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-04 13:08 Andreas Steinmetz [this message]
2005-04-04 15:30 ` fix setfiles segfault caused by libselinux-1.22 Stephen Smalley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42513C67.7020604@domdv.de \
    --to=ast@domdv.de \
    --cc=selinux@tycho.nsa.gov \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.