legatoproject / legato-af

Legato Application Framework
Mozilla Public License 2.0
153 stars 118 forks source link

Access to /etc/resolv.conf denied #63

Closed cloudtrac closed 4 years ago

cloudtrac commented 4 years ago

Access to /etc/resolv.conf via this addition to the .adef file:

requires:{
    dir:{
        [rwx] /etc/resolv.conf /etc/resolv.conf
    }
}

is now producing the error /home/buildserver/workspace/apps/data_test/data_app.adef:17:6: error: Cannot set access permission of: /etc/resolv.conf Found this on issue on wp77xx targets running any R13 firmware with legato 19.11.2 or 20.04.0. Any combination of read, write, or execute permissions on the file throw the above error.

cloudtrac commented 4 years ago

If updating from previous versions of legato, the read/write/execute permissions must be removed, and files and directories now need to be included under separate headings, ex:

requires:{
    file:{
        /etc/resolve.conf /etc/resolv.conf
    }
    dir:{
        /home/root /home/root
    }
}

Additionally, for this to work, the app must not be sandboxed, which is the default behaviour. Include sandboxed: false in the .adef to disable sandboxing (be aware of security issues that arise from this).