SE-DBUS updates

Matthew Rickard mjricka at epoch.ncsc.mil
Tue Jul 27 05:51:22 PDT 2004


On Mon, 2004-07-26 at 18:05, Havoc Pennington wrote:
> On Mon, 2004-07-26 at 16:03, Matthew Rickard wrote:
> > For the 
> > >  _dbus_assert_not_reached ("FIXME the avc_context_to_sid() error 
> > >  handling");
> > The only error avc_context_to_sid should fail on is ENOMEM, so I think
> > it should be OK to just return NULL.
> 
> Wouldn't hurt to put in a _dbus_assert (errno == ENOMEM), which also
> acts as a comment indicating that we thought about this.

Good idea.

> 
> > However, in
> > >  _dbus_assert_not_reached ("bus_selinux_init_id doesn't properly
> > >  indicate OOM");
> > it can fail on errors other than ENOMEM (like failing to get the
> > connection context).  How should we handle this?
> 
> Just need to figure out what to do in each case. On ENOMEM usually what
> we want to do is try again. If a connection has no context, then we'd
> want to have a NULL context probably - but we have to be able to
> distinguish no context from OOM. Typically DBusError is used for this.

That sounds like the best way to handle it.

> 
> > I also noticed that rather than using security_context_t for context
> > types you are simply using char* instead.  Is there any particular
> > reason for this (since we do have the SELinux headers available in
> > selinux.c)?
> 
> IIRC there were various spots that assumed it was a char* (copying it
> with strdup, printing it out, assigning NULL to it) so I thought it was
> clearer to just use char* - the type isn't genuinely opaque. Also
> matches the general dbus and glib convention, we never typedef char* to
> anything.

OK, this should be fine then.  Just wanted to make sure we clarified
this.

> Perfect, this is great. Do you want to fix the remaining issues above or
> should I? We can commit after that I think, unless someone else sees
> bugs.

You can go ahead and fix up the last few issues before committing.


Matt


More information about the dbus mailing list