Skip to content
  • David Zeuthen's avatar
    make polkit-policy-file-validate require that actions are properly packaged · 2b1a2a69
    David Zeuthen authored
    Meaning this bit was added to the spec:
    
       The name of the XML file is significant. Each XML file can only
       declare actions from the namespace of it's own name; for example
       actions org.foobar.action-a, org.foobar.action-b and
       org.foobar.action-c would all go into the file org.foobar.policy
       while actions com.my-company.product-awesome.action-a,
       com.mycompany.product-awesome.action-b would go into the file
       com.mycompany.product-awesome.policy.
    
    This is the output of the validator on a broken .policy file
    
      $ polkit-policy-file-validate /usr/share/PolicyKit/policy/gnome-clock-applet-mechanism.policy
      WARNING: The action org.gnome.clockapplet.mechanism.configurehwclock does not
               belong in a policy file named gnome-clock-applet-mechanism.policy.
               A future version of PolicyKit will ignore this action.
    
      WARNING: The action org.gnome.clockapplet.mechanism.settime does not
               belong in a policy file named gnome-clock-applet-mechanism.policy.
               A future version of PolicyKit will ignore this action.
    
      WARNING: The action org.gnome.clockapplet.mechanism.settimezone does not
               belong in a policy file named gnome-clock-applet-mechanism.policy.
               A future version of PolicyKit will ignore this action.
    
      ERROR: /usr/share/PolicyKit/policy/gnome-clock-applet-mechanism.policy did not validate
    
    We currently don't enforce this but will in a future version. The
    rationale is that we can avoid loading all .policy files at startup
    which would be a performance win.
    2b1a2a69