<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Yes, iwlist currently requires root, and Harbour rules doesnt allow root-bit to be set currently. But if your ok with application just beeing in OpenRepos, then you can give your
application or helper binary a root suid-bit in rpm .spec file like this:<br>
<pre><span class="k">%attr</span>(4755,root,root) /usr/bin/yourapplication-root-helper<br><br><font face="Tahoma">That would give your application a root suid bitted application that can call iwlist without problems.<br>Please notice that invoker drops suid bits by default, so you need to have it as seperate helper binary, or have special desktop-file flags for not using invoker to launch your app.<br></font></pre>
re, Jonni<br>
<br>
<div style="font-family: Times New Roman; color: #000000; font-size: 16px">
<hr tabindex="-1">
<div style="direction: ltr;" id="divRpF356067"><font color="#000000" face="Tahoma" size="2"><b>From:</b> devel-bounces@lists.sailfishos.org [devel-bounces@lists.sailfishos.org] on behalf of Niels Christian Ørgaard [ncothang@gmail.com]<br>
<b>Sent:</b> Saturday, May 31, 2014 4:15 PM<br>
<b>To:</b> devel@lists.sailfishos.org<br>
<b>Subject:</b> [SailfishDevel] Setting/escalating app privileges ?<br>
</font><br>
</div>
<div></div>
<div>
<div dir="ltr">
<div>
<div>
<div>
<div>Hi all,<br>
<br>
</div>
Is there a way to either set, or escalate, a SailfishOS app's privileges, at first runtime or at installation?<br>
<br>
</div>
Am looking to use 2 shell commands, <span style="font-family:courier new,monospace">
iwlist</span> and <span style="font-family:courier new,monospace">iwpriv</span>, in my apps, but they require root (or similar) access-rights.<br>
</div>
<div>(cannot quite figure out why <span style="font-family:courier new,monospace">
iwlist</span> should require root access ...)<br>
</div>
<div><br>
</div>
Have googled around, looked at QML and QT5 documentation, and best results have been discussions about an absence of configurable permissions; there may be a way via QT, but my brief search didn't reveal anything.<br>
<br>
</div>
I could write a quick root-password requester for my apps, asking for permission every time they need to run either command, but I think that is a pretty ugly and scary solution.<br>
<div>
<div><br>
</div>
<div>Am hoping to eventually introduce at least 1 app to Harbour, so I need to locate a solution that is in line with Jolla's intents.<br>
</div>
<div><br>
<br>
</div>
<div>The 2 apps:<br>
<br>
</div>
<div><i>LightFish - app to control LIFX bulbs</i>.<br>
</div>
<div>Needs to run "<span style="font-family:courier new,monospace">iwpriv wlan0 setMCBCFilter 1</span>" upon startup, to ensure it can catch broadcast messages from LIFX bulbs on the local network, and preferably "<span style="font-family:courier new,monospace">iwpriv
wlan0 setMCBCFilter 3</span>" when closing down.<br>
</div>
<div>Have talked to LIFX about changing their network protocol, but this is (naturally) a non-trivial thing to do.<br>
</div>
<div>Having a pop-up requesting root-password (or similar) every time this apps runs would make it too annoying to use, just to set your lighting level; Even more so, if having a pop-up asking for permissions when just triggering a colour-change on a lightbulb
to indicate an SMS have been received.<br>
</div>
<div><br>
</div>
<div><i>unnamed app - app to do basic wifi scans</i><br>
</div>
<div>Would run <span style="font-family:courier new,monospace">iwlist wlan0 scan </span>
at regular intervals, present results in a table.<br>
</div>
<div>Is simply to help me review local networks, without using my computer.<br>
<br>
</div>
<div><br>
</div>
<div>Any-and-all help are welcome, as I'm at a bit of dead end here.<br>
</div>
<div><br>
Regards,<br>
Niels Chr. Ø.<br>
</div>
<div>Belgium<br>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>