|
From: <kma...@us...> - 2007-02-08 15:33:29
|
Revision: 2230
http://svn.sourceforge.net/selinux/?rev=2230&view=rev
Author: kmacmillan
Date: 2007-02-08 07:13:49 -0800 (Thu, 08 Feb 2007)
Log Message:
-----------
rollback previous accidental commit
Modified Paths:
--------------
trunk/libselinux/src/matchpathcon.c
trunk/policycoreutils/semodule_deps/semodule_deps.c
Modified: trunk/libselinux/src/matchpathcon.c
===================================================================
--- trunk/libselinux/src/matchpathcon.c 2007-02-08 14:59:08 UTC (rev 2229)
+++ trunk/libselinux/src/matchpathcon.c 2007-02-08 15:13:49 UTC (rev 2230)
@@ -443,7 +443,7 @@
static int process_line(const char *path, const char *prefix, char *line_buf,
int pass, unsigned lineno)
{
- int len, regerr, ret;
+ int items, len, regerr, ret;
char *buf_p, *ptr;
char *regex, *type, *context;
const char *reg_buf;
@@ -460,42 +460,42 @@
if (*buf_p == '#' || *buf_p == 0)
return 0;
+ items = 0;
regex = strtok_r(buf_p, " \t", &ptr);
- if (!regex) {
+ if (regex)
+ items += 1;
+ type = strtok_r(NULL, " \t", &ptr);
+ if (type)
+ items += 1;
+ context = strtok_r(NULL, " \t", &ptr);
+ if (context)
+ items += 1;
+
+ if (items < 2) {
myprintf("%s: line %d is missing fields, skipping\n", path,
lineno);
- return 0;
- } else {
- regex = strdup(regex);
- if (!regex) {
- return -1;
- }
+ return 0;
+ } else if (items == 2) {
+ /* The type field is optional. */
+ context = type;
+ type = NULL;
}
- type = strtok_r(NULL, " \t", &ptr);
- if (!type) {
- myprintf("%s: line %d is missing fields, skipping\n", path,
- lineno);
- return 0;
- } else {
+ regex = strdup(regex);
+ if (!regex) {
+ return -1;
+ }
+ if (type) {
type = strdup(type);
if (!type) {
ret = -1;
goto finish;
}
}
-
- context = strtok_r(NULL, " \t", &ptr);
+ context = strdup(context);
if (!context) {
- /* The type field is optional. */
- context = type;
- type = NULL;
- } else {
- context = strdup(context);
- if (!context) {
- ret = -1;
- goto finish;
- }
+ ret = -1;
+ goto finish;
}
reg_buf = regex;
Modified: trunk/policycoreutils/semodule_deps/semodule_deps.c
===================================================================
--- trunk/policycoreutils/semodule_deps/semodule_deps.c 2007-02-08 14:59:08 UTC (rev 2229)
+++ trunk/policycoreutils/semodule_deps/semodule_deps.c 2007-02-08 15:13:49 UTC (rev 2230)
@@ -16,7 +16,7 @@
* of avrule_blocks - even in an ABI safe way - seems undesirable.
*/
#include <sepol/module.h>
-#include <sepol/errcodes.h>
+#include <sepol/errno.h>
#include <sepol/policydb/policydb.h>
#include <getopt.h>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|