Skip to contentSkip to conversation

patch

DISCUSSION Ryan Senior 2 participants 2 messages Aug 14, 2001 – Aug 15, 2001 SELinux security module

lore
Share & tools
lore
#0 lore raw

I "applied" the patch, but it didn't apply properly.

The following is what I get:

(Stripping trailing CRs from patch.)
patching file initpolicy.conf
Hunk #1 FAILED at 1775.
Hunk #2 FAILED at 1813.
Hunk #3 FAILED at 2090.
3 out of 3 hunks FAILED -- saving rejects to file initpolicy.conf.rej

I am far from an expert at using patch, in fact aside from patching the kernel, I haven't used patch much at all. If you need, I could also paste in what the .rej file says.

Any assistance is appreciated,

Ryan

--
You have received this message because you are subscribed to the selinux list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#1 lore raw
Quoted 1 line · Ryan Senior

patching file initpolicy.conf

The patch is for the kernel-2.4/security/policy_parse.y file, so it shouldn't be modifying initpolicy.conf at all. I've attached a version of the patch that should be easier to apply. Assuming that you save it to ~/parser.patch, apply it as follows:

cd slinux
patch -p1 < ~/parser.patch

It should say: patching file kernel-2.4/security/policy_parse.y.

Then do 'cd kernel-2.4; make' to rebuild the checkpolicy program. You should then be able to compile the policy configuration.

--
Stephen D. Smalley, NAI Labs
[email protected]

Index: slinux/kernel-2.4/security/policy_parse.y

kernel-2.4/security/policy_parse.y renamed from kernel-2.4/security/policy_parse.y:1.1 +1 -3
diff -u slinux/kernel-2.4/security/policy_parse.y:1.1 slinux/kernel-2.4/security/policy_parse.y:1.2
@@ -1775,7 +1775,6 @@
 {
 	char *id;
 	class_datum_t *cladatum;
-	type_datum_t *datum;
 	perm_datum_t *perdatum;
 	ebitmap_t stypes, ttypes, tclasses;
 	access_vector_t *avp;
@@ -1814,7 +1813,7 @@
 	hiclass = 0;
 	while ((id = queue_remove(id_queue))) {
 		cladatum = hashtab_search(policydbp->p_classes.table, id);
-		if (!datum) {
+		if (!cladatum) {
 			sprintf(errormsg, "unknown class %s used in rule", id);
 			yyerror(errormsg);
 			goto bad;
@@ -2091,7 +2090,6 @@
 		if (ret) {
 			yyerror("hash table overflow");
 			free(role);
-			free(id);
 			free(role_id);
 			return -1;
 		}