[systemd-devel] [PATCH] dbus-manager: don't allow enabling if unit is masked

Lennart Poettering lennart at poettering.net
Wed Oct 8 04:51:58 PDT 2014


On Tue, 07.10.14 08:23, Jan Synacek (jsynacek at redhat.com) wrote:

> Lennart Poettering <lennart at poettering.net> writes:
> > On Mon, 06.10.14 13:21, Jan Synacek (jsynacek at redhat.com) wrote:
> >
> > Hmm with this change in place we'd have different behaviour for the
> > cases where systemctl executes the operation client-side, and when it
> > goes via the bus. We really should keep those differences in behaviour
> > to a minimum.
> >
> > I figure the verification for this really needs to be moved a few
> > levels down, somewhere into unit_file_enable() and friends, so that
> > all code paths behave the same.
> 
> But that wouldn't fix a scenario where one uses just dbus to call the
> method, would it? Maybe I'm missing something, but that's how I
> understood the code so far. However, I agree that the fix is incomplete
> and I'll try to fix that.

unit_file_enable() is what is used by both codepaths: the one via
dbus, and the one executed directly in systemctl, from the client
side. If you change unit_file_enable() you hence did the work for both
sides.

> While I'm at it, what about disable? Should it behave in the same way,
> i.e. return error when the unit is masked? My guess is that yes, but I'm
> not sure.

disable, reenable, mask, unmask, should not be changed. Only enable,
link and preset should get this check.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list