All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Gyurdiev <ivg2@cornell.edu>
To: Karl MacMillan <kmacmillan@tresys.com>
Cc: selinux <selinux@tycho.nsa.gov>, selinux-dev <selinux-dev@tresys.com>
Subject: Re: [PATCH] fix warnings in selinux-usr
Date: Sat, 06 May 2006 14:56:07 -0400	[thread overview]
Message-ID: <445CF147.1000300@cornell.edu> (raw)
In-Reply-To: <1146845884.2208.15.camel@jackjack.columbia.tresys.com>

Karl MacMillan wrote:
> Steve,
>
> Attached is a patch that fixes many warnings that have crept into the
> selinux-usr code over time, making it difficult to ascertain whether
> code changes have introduced new warnings.
>   
record_policydb_table_t SEMANAGE_PORT_POLICYDB_RTABLE = {

 	.add         = NULL, 
-	.modify      = sepol_port_modify,
+	.modify      = (record_policydb_table_modify_t)sepol_port_modify,
 	.set         = NULL, 
-	.query       = sepol_port_query,
-        .count       = sepol_port_count,
-	.exists      = sepol_port_exists,
-	.iterate     = sepol_port_iterate,
+	.query       = (record_policydb_table_query_t)sepol_port_query,
+        .count       = (record_policydb_table_count_t)sepol_port_count,
+	.exists      = (record_policydb_table_exists_t)sepol_port_exists,
+	.iterate     = (record_policydb_table_iterate_t)sepol_port_iterate,
 };


The semanage <--> sepol record key/data are not necessarily identical, 
and that's why warnings occur on query, modify, etc... 
Changing the type to void* removes the warning, without fixing the 
potential problem. The cast is marked unsafe, because it is unsafe. A 
better solution would be to add conversion functions from semanage 
key/record to sepol key/record and vice versa.

--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.

  reply	other threads:[~2006-05-06 18:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-05 16:18 [PATCH] fix warnings in selinux-usr Karl MacMillan
2006-05-06 18:56 ` Ivan Gyurdiev [this message]
2006-05-08 12:26   ` Karl MacMillan
2006-05-08 22:40     ` Ivan Gyurdiev
2006-05-09 12:32       ` Karl MacMillan
2006-05-08 12:49 ` Stephen Smalley
2006-05-08 13:13   ` Karl MacMillan
2006-05-08 15:16     ` Karl MacMillan
2006-05-08 15:50       ` 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=445CF147.1000300@cornell.edu \
    --to=ivg2@cornell.edu \
    --cc=kmacmillan@tresys.com \
    --cc=selinux-dev@tresys.com \
    --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.