https://redmine.graphics-muse.org/https://redmine.graphics-muse.org/favicon.ico?16278048512014-12-12T18:48:58ZGraphics Muse Issue Trackerappmgr - Bug #388: appmgr should be running applications as non-root userhttps://redmine.graphics-muse.org/issues/388?journal_id=14982014-12-12T18:48:58ZHammelmjhammel@graphics-muse.org
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>50</i></li></ul><p>This was easy to implement and the clock and videofe apps work fine. But the network config utility will need to run as root in order to update configuration files. So the appmgr will need special handling for this app. But that sort of handling should be generalized so I can run others the same way.</p>
<p>I need to devise a way to define a privileged set of apps.</p> appmgr - Bug #388: appmgr should be running applications as non-root userhttps://redmine.graphics-muse.org/issues/388?journal_id=14992014-12-12T22:16:22ZHammelmjhammel@graphics-muse.org
<ul></ul>A very simplistic method that is probably not secure:
<ol>
<li>appmgr is packaged with a list of app names that are privileged
<ol>
<li>List is 400 and stored in /etc/appmgr.priv</li>
</ol>
</li>
<li>loadConfig() reads priv list and stores in a link list</li>
<li>in startNew(), in child
<ol>
<li>dup argv(0)</li>
<li>split into tokens using path character ("/")</li>
<li>Find last token</li>
<li>Test if token is in privileged list
<ol>
<li>Yes: don't switch to user=nobody.nobody</li>
<li>No: switch to user=nobody.nobody</li>
</ol>
</li>
<li>free dup</li>
</ol></li>
</ol>
<p>Initial list includes only bui-network-config</p> appmgr - Bug #388: appmgr should be running applications as non-root userhttps://redmine.graphics-muse.org/issues/388?journal_id=15002014-12-13T17:43:15ZHammelmjhammel@graphics-muse.org
<ul><li><strong>Project</strong> changed from <i>PiBox</i> to <i>appmgr</i></li><li><strong>Category</strong> deleted (<del><i>04 - Applications</i></del>)</li></ul> appmgr - Bug #388: appmgr should be running applications as non-root userhttps://redmine.graphics-muse.org/issues/388?journal_id=15012014-12-13T17:47:58ZHammelmjhammel@graphics-muse.org
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>50</i> to <i>100</i></li></ul><p>Simplified the design to just have the full path in the priv configuration file. That way there is no need to dup and tokenize the command. The command provided to appmgr must match exactly to the privileged configuration in order to run as a privileged user.</p>
<p>This was tested on the target and works. The code is committed and pushed upstream.</p>
<p>Closing issue.</p>