From: Ivan Gyurdiev <ivg2@cornell.edu>
To: Ivan Gyurdiev <ivg2@cornell.edu>
Cc: Stephen Smalley <sds@tycho.nsa.gov>,
Joshua Brindle <jbrindle@tresys.com>,
SELinux List <SELinux@tycho.nsa.gov>
Subject: Re: [ SEPOL ] Move more things to newer debug system
Date: Sat, 17 Sep 2005 23:52:16 -0400 [thread overview]
Message-ID: <432CE470.1020400@cornell.edu> (raw)
In-Reply-To: <432CDC23.4010907@cornell.edu>
Ivan Gyurdiev wrote:
>
>> I was thinking that unifying them would be ideal, and the callbacks can
>> decide how they want to filter the results. Just requires that the
>> callbacks be provided with a level indicator in addition to the other
>> arguments that indicates whether it is debug info only or error info.
>> Not unlike syslog(3) or printk(9).
>>
>>
> Which messages would be marked at what levels?
> Example?
Never mind, you already answered that question.
> Offhand, I don't know of an actual debugging user of DEBUG() yet,
> although it seems that the if (state->verbose) printf statements in the
> Tresys code would qualify as potential debugging users. There are also
> "informational" cases, like the printfs in policydb_index_others.
> syslog(3) does have distinct notions of debug, info, warning, error,
> critical, alert, and emergency as its priority values.
I'm not sure we need both a filtering mechanism, and two systems - one
for debugging and one for error reporting. That looks like redundancy
to me. I think we need to choose one debug system, add a filtering
mechanism to it, and convert everything to use it. The filtering
mechanism would then determine what's done with the different types of
messages (which are not too clear at the moment).
There's the issue of global vs per-function-state. I think the second
one wins here, and we'll just have to adjust the shared APIs. We could
create something similar to the semanage handle, which encompasses a
policydb, as well as error handling. I think libsepol should be the
library that manages the policydb object.
There's the issue of multiple errors - I think any error system needs to
support multiple error messages.
Then there's the issue of buffer vs callback. I think callback wins
here. Provided function-local state, there's no reason not to have a
callback. If you want buffering services, you can arrange for that in
the callback. We should add a void* argument to the callback, and keep
that in the state object, passing it at every invocation.
The function name.... is irrelevant if we go with the callback system -
callback can drop the name. I think it's useful, and it should stay.
Callback should look something like this, maybe ?
We can write macros to reduce arguments...
int (*DEBUG_v2) (
void* arg, /* Caller supplied argument */
int level, /* WARN, ERROR, DEBUG ...kind of like MLS
level - notion of rank */
int channel, /* Wine has this...not sure we need it...
similar to MLS category - area of debugging */
const char* fname, /* Function name */
const char* fmt, /* Format string */
...) /* Format arguments */
--
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.
next prev parent reply other threads:[~2005-09-18 3:52 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-12 12:06 [ SEMANAGE ] Stub out user/port functionality Ivan Gyurdiev
2005-09-12 14:14 ` [ SEMANAGE ] Introduce record table Ivan Gyurdiev
2005-09-13 3:55 ` [ SEPOL ] Move more things to newer debug system Ivan Gyurdiev
2005-09-13 19:59 ` Stephen Smalley
2005-09-13 22:26 ` Ivan Gyurdiev
2005-09-13 23:03 ` Joshua Brindle
2005-09-14 3:33 ` Ivan Gyurdiev
2005-09-14 3:37 ` Ivan Gyurdiev
2005-09-14 13:16 ` Stephen Smalley
2005-09-14 14:05 ` Dale Amon
2005-09-14 18:07 ` Stephen Smalley
2005-09-14 23:44 ` Dale Amon
2005-09-14 7:00 ` Luke Kenneth Casson Leighton
2005-09-14 12:11 ` Stephen Smalley
2005-09-14 7:01 ` Luke Kenneth Casson Leighton
2005-09-14 13:00 ` Stephen Smalley
2005-09-14 13:21 ` Joshua Brindle
2005-09-14 13:51 ` Stephen Smalley
2005-09-14 14:45 ` Joshua Brindle
2005-09-14 15:04 ` Stephen Smalley
2005-09-14 15:26 ` info on SELinux support for IPSEC Prakash Saivasan
2005-09-14 18:20 ` Stephen Smalley
2005-09-14 15:33 ` [ SEPOL ] Move more things to newer debug system Joshua Brindle
2005-09-14 15:38 ` Stephen Smalley
2005-09-14 16:06 ` Joshua Brindle
2005-09-14 16:24 ` Stephen Smalley
2005-09-14 17:16 ` Ivan Gyurdiev
2005-09-14 17:21 ` Ivan Gyurdiev
2005-09-14 18:53 ` Stephen Smalley
2005-09-16 13:48 ` Luke Kenneth Casson Leighton
2005-09-14 19:37 ` Ivan Gyurdiev
2005-09-14 19:50 ` Stephen Smalley
2005-09-14 20:01 ` Stephen Smalley
2005-09-14 20:32 ` Ivan Gyurdiev
2005-09-15 7:31 ` Ivan Gyurdiev
2005-09-15 12:22 ` Stephen Smalley
2005-09-15 13:01 ` Stephen Smalley
2005-09-15 15:17 ` Stephen Smalley
2005-09-15 16:03 ` Ivan Gyurdiev
2005-09-16 12:19 ` Stephen Smalley
2005-09-18 3:14 ` Ivan Gyurdiev
2005-09-16 13:45 ` Luke Kenneth Casson Leighton
2005-09-16 13:55 ` Luke Kenneth Casson Leighton
2005-09-18 3:16 ` Ivan Gyurdiev
2005-09-18 3:52 ` Ivan Gyurdiev [this message]
2005-09-18 15:45 ` Ivan Gyurdiev
2005-09-19 12:49 ` Stephen Smalley
2005-09-19 14:05 ` Ivan Gyurdiev
2005-09-19 14:45 ` Stephen Smalley
2005-09-19 16:24 ` Ivan Gyurdiev
2005-09-19 16:49 ` Stephen Smalley
2005-09-19 17:16 ` Ivan Gyurdiev
2005-09-19 18:26 ` Stephen Smalley
2005-09-14 19:57 ` Ivan Gyurdiev
2005-09-14 12:35 ` Stephen Smalley
2005-09-14 15:51 ` Stephen Smalley
2005-09-13 19:43 ` [ SEMANAGE ] Introduce record table Stephen Smalley
2005-09-13 22:15 ` Ivan Gyurdiev
2005-09-13 22:46 ` Ivan Gyurdiev
2005-09-14 15:46 ` Stephen Smalley
2005-09-14 15:45 ` [ SEMANAGE ] Stub out user/port functionality 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=432CE470.1020400@cornell.edu \
--to=ivg2@cornell.edu \
--cc=SELinux@tycho.nsa.gov \
--cc=jbrindle@tresys.com \
--cc=sds@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.