diff --exclude-from=exclude --exclude=sepolgen-1.0.10 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/audit2why/audit2why.c policycoreutils-2.0.29/audit2why/audit2why.c --- nsapolicycoreutils/audit2why/audit2why.c 2007-07-16 14:20:41.000000000 -0400 +++ policycoreutils-2.0.29/audit2why/audit2why.c 2007-10-08 08:37:08.000000000 -0400 @@ -137,6 +137,8 @@ /* Process the audit messages. */ while (getline(&buffer, &len, stdin) > 0) { size_t len2 = strlen(buffer); + char *begin, *end, *search_buf; + int slen = 0; if (buffer[len2 - 1] == '\n') buffer[len2 - 1] = 0; @@ -179,6 +181,7 @@ } *p++ = 0; + search_buf = p; /* Get scontext and convert to SID. */ while (*p && strncmp(p, SCONTEXT, sizeof(SCONTEXT) - 1)) p++; @@ -188,11 +191,14 @@ continue; } p += sizeof(SCONTEXT) - 1; - scon = p; + begin = p; while (*p && !isspace(*p)) p++; - if (*p) - *p++ = 0; + end = p; + slen=end - begin; + scon = calloc(slen+1, 1); + strncpy(scon, begin, slen); + rc = sepol_context_to_sid(scon, strlen(scon) + 1, &ssid); if (rc < 0) { fprintf(stderr, @@ -201,6 +207,10 @@ continue; } + free(scon); + /* start searching at the beginning again */ + p = search_buf; + /* Get tcontext and convert to SID. */ while (*p && strncmp(p, TCONTEXT, sizeof(TCONTEXT) - 1)) p++; @@ -210,11 +220,15 @@ continue; } p += sizeof(TCONTEXT) - 1; - tcon = p; + + begin = p; while (*p && !isspace(*p)) p++; - if (*p) - *p++ = 0; + end = p; + slen=end - begin; + tcon = calloc(slen+1, 1); + strncpy(tcon, begin, slen); + rc = sepol_context_to_sid(tcon, strlen(tcon) + 1, &tsid); if (rc < 0) { fprintf(stderr, @@ -222,6 +236,9 @@ TCONTEXT, tcon, lineno); continue; } + free(tcon); + /* start searching at the beginning again */ + p = search_buf; /* Get tclass= and convert to value. */ while (*p && strncmp(p, TCLASS, sizeof(TCLASS) - 1)) @@ -232,12 +249,17 @@ continue; } p += sizeof(TCLASS) - 1; - tclassstr = p; + begin = p; while (*p && !isspace(*p)) p++; - if (*p) - *p = 0; + + end = p; + slen=end - begin; + tclassstr = calloc(slen+1, 1); + strncpy(tclassstr, begin, slen); + tclass = string_to_security_class(tclassstr); + free(tclassstr); if (!tclass) { fprintf(stderr, "Invalid %s%s on line %u, skipping...\n", diff --exclude-from=exclude --exclude=sepolgen-1.0.10 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/Makefile policycoreutils-2.0.29/Makefile --- nsapolicycoreutils/Makefile 2007-07-16 14:20:43.000000000 -0400 +++ policycoreutils-2.0.29/Makefile 2007-10-08 08:36:41.000000000 -0400 @@ -1,4 +1,4 @@ -SUBDIRS=setfiles semanage load_policy newrole run_init restorecond secon audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand semodule_deps setsebool po +SUBDIRS=setfiles semanage load_policy newrole run_init restorecond secon audit2allow audit2why scripts sestatus semodule_package semodule semodule_link semodule_expand semodule_deps setsebool po gui all install relabel clean indent: @for subdir in $(SUBDIRS); do \ diff --exclude-from=exclude --exclude=sepolgen-1.0.10 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/restorecond/restorecond.c policycoreutils-2.0.29/restorecond/restorecond.c --- nsapolicycoreutils/restorecond/restorecond.c 2007-07-16 14:20:41.000000000 -0400 +++ policycoreutils-2.0.29/restorecond/restorecond.c 2007-10-08 08:36:41.000000000 -0400 @@ -210,9 +210,10 @@ } if (fsetfilecon(fd, scontext) < 0) { - syslog(LOG_ERR, - "set context %s->%s failed:'%s'\n", - filename, scontext, strerror(errno)); + if (errno != EOPNOTSUPP) + syslog(LOG_ERR, + "set context %s->%s failed:'%s'\n", + filename, scontext, strerror(errno)); if (retcontext >= 0) free(prev_context); free(scontext); @@ -225,8 +226,9 @@ if (retcontext >= 0) free(prev_context); } else { - syslog(LOG_ERR, "get context on %s failed: '%s'\n", - filename, strerror(errno)); + if (errno != EOPNOTSUPP) + syslog(LOG_ERR, "get context on %s failed: '%s'\n", + filename, strerror(errno)); } free(scontext); close(fd); diff --exclude-from=exclude --exclude=sepolgen-1.0.10 --exclude=gui --exclude=po -N -u -r nsapolicycoreutils/semanage/seobject.py policycoreutils-2.0.29/semanage/seobject.py --- nsapolicycoreutils/semanage/seobject.py 2007-10-07 21:46:43.000000000 -0400 +++ policycoreutils-2.0.29/semanage/seobject.py 2007-10-08 08:36:41.000000000 -0400 @@ -139,7 +139,7 @@ translations = fd.readlines() fd.close() except IOError, e: - raise ValueError(_("Unable to open %s: translations not supported on non-MLS machines: %s") % (self.filename, e) ) + raise ValueError(_("Unable to open %s: translations not supported on non-MLS machines") % (self.filename) ) self.ddict = {} self.comments = [] @@ -236,9 +236,6 @@ if rc < 0: semanage_handle_destroy(self.sh) raise ValueError(_("Could not establish semanage connection")) - def deleteall(self): - raise ValueError(_("Not yet implemented")) - class loginRecords(semanageRecords): def __init__(self, store = ""):