Re: The NetworkManager does not run dispatch script



On Wed, 2012-07-25 at 13:44 -0600, Chengyu Fan wrote:
> Hi~
> I figured it out. That is because I replace the '01ifupdown' with my
> script, and I forgot to make the file owner as root. The execution
> permissions must be 755 as well.

Yes, this is detailed in 'man NetworkManager' if anyone wants to know:

       (a) a regular file
       (b) owned by root
       (c) not writable by group or other
       (d) not set-uid
       (e) and executable by the owner

these permissions are for security reasons.  Patches accepted to make
the dispatcher warn about these issues in syslog, that might help make
people aware of the problems.  One issue is that since the dispatcher is
a short-lived process, we dont' necessarily want to be warning every
time an event happens, which can be quite often.  Not sure how to deal
with that though.

I guess we could hack some bits into NetworkManager itself to warn about
it, and leave that part out of the dispatcher, as long as the code to do
the checks is shared.  That might take the form of making a new static
library in src/ that contains only a function that checks the status of
the file like so:

gboolean dispatcher_check_script (const char *path, GError **error);

which would be used by both NM and the dispatcher.  The dispatcher of
course would ignore error, and simply not execute the script.
NetworkManager on the other hand would run this for each file and print
a warning on startup (eg, nm_log_warn ("Dispatcher script %s failed
permissions checks: %s", script_path, error->message);).

Dan

> On Wed, Jul 25, 2012 at 9:42 AM, Chengyu Fan <chengy fan gmail com>
> wrote:
>         
>         
>         On Wed, Jul 25, 2012 at 7:24 AM, Lamarque V. Souza
>         <lamarque kde org> wrote:
>                 Em Wednesday 25 July 2012, Chengyu Fan escreveu:
>                 
>                 > Hi~
>                 
>                  
>                 
>                 Hi,
>                 
>                  
>                 
>                 > I use NetworkManager on Ubuntu.
>                 
>                 > After I install a new DHCP client, the
>                 NetworkManager does not run the
>                 
>                 > script "01ifupdown"
>                 in /etc/NetworkManager/dispatcher.d/ when the network
>                 
>                 > is up.
>                 
>                 > 
>                 
>                 > What should I do to let NM run this script?
>                 
>                 > Thanks,
>                 
>                  
>                 
>                 
>                 Does the script has execution permissions (chmod 755)?
>                 
>                  
>                 
>                 
>         
>         
>         Yes, the script has execution permission. 
>         Before I install new DHCP client, the NM can run this script.
>         But after I install the DHCP client from ISC code, the script
>         codes that I added into 01ifupdown don't execute any more.
>          
>                 -- 
>                 
>                 Lamarque V. Souza
>                 
>                 KDE's Network Management maintainer
>                 
>                 http://planetkde.org/pt-br
>                 
>                 
>         
>         
>         
>         
>         -- 
>         Regards,
>         Chengyu Fan
> 
> 
> 
> 
> -- 
> Regards,
> Chengyu Fan
> 
> _______________________________________________
> networkmanager-list mailing list
> networkmanager-list gnome org
> https://mail.gnome.org/mailman/listinfo/networkmanager-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]