<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p><font size="-1">A helpful addition would be to bracket the part of the program that does disk IO with setgid(), just like one brackets setuid code. --dave</font><br>
</p>
<div class="moz-cite-prefix">On 2020-02-20 4:11 p.m., Chris Tyler via talk wrote:<br>
</div>
<blockquote type="cite" cite="mid:CANvYDTJfBqyfQ0pQi9+K2vbR7pYTfR2-1-iFvj41=93PZjv_sQ@mail.gmail.com">
<div dir="ltr">Stewart, I'm having troubles understanding the author's reply to the SGID suggestion. What I was proposing was to set things up with a command like this (executed just once):
<div><br>
</div>
<div>  BINARY=/path/to/binary ; sudo chmod 02711 $BINARY ; sudo chown root:disk $BINARY</div>
<div><br>
</div>
<div>...Which would mean that the user would have their effective group ID changed to 'disk' only while the binary was running. This means that, during program execution, it would be have the same level of access as if the user belonged to the 'disk' group;
 however, this would drop back to their previous group membership when the binary exited. As a bonus, you don't have to change the system group memberships. (The program in question should, of course, guard against writing to the wrong device while it's running,
 and prevent shell-outs).</div>
<div><br>
</div>
<div>-Chris</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, Feb 18, 2020 at 8:27 AM Stewart C. Russell via talk <<a href="mailto:talk@gtalug.org" moz-do-not-send="true">talk@gtalug.org</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hey, thanks to all who responded. I'm sticking with merely "bad idea", <br>
as it would also give the user block-level access to everyone's secret <br>
files. I know sudo already does this, but one has to manually clunk into <br>
that mode. Though there are still plenty of Raspberry Pi users who 'sudo <br>
ls', for some reason.<br>
<br>
On 2020-02-17 7:23 p.m., Chris Tyler wrote:<br>
> Wouldn't it be better to use SGID to enable access to disk devices only <br>
> for the duration of that program's execution?<br>
<br>
Author claims it's not possible. The program was written as a reaction <br>
to finding out that balenaEtcher (<a href="https://www.balena.io/etcher/" rel="noreferrer" target="_blank" moz-do-not-send="true">https://www.balena.io/etcher/</a>) "phones
<br>
home" with usage data. If true, this is unfortunate, because Etcher <br>
fixes all the fiddliness of using dd as root, it's truly cross platform, <br>
and avoids the Windows unzip bug. No-one's yet identified what exactly <br>
Etcher phones home yet, but that hasn't stopped the heat, light and fury <br>
of a Free Software Cause in the making …<br>
<br>
The new program's quite usable for now (even if you have to run it sudo) <br>
and appears to be cross-platform too. It's also a lot smaller than <br>
Etcher, which is an Electron app.<br>
<br>
Source repo is here: <a href="https://gitlab.com/bztsrc/usbimager" rel="noreferrer" target="_blank" moz-do-not-send="true">
https://gitlab.com/bztsrc/usbimager</a><br>
---<br>
Post to this mailing list <a href="mailto:talk@gtalug.org" target="_blank" moz-do-not-send="true">
talk@gtalug.org</a><br>
Unsubscribe from this mailing list <a href="https://gtalug.org/mailman/listinfo/talk" rel="noreferrer" target="_blank" moz-do-not-send="true">
https://gtalug.org/mailman/listinfo/talk</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">---
Post to this mailing list <a class="moz-txt-link-abbreviated" href="mailto:talk@gtalug.org">talk@gtalug.org</a>
Unsubscribe from this mailing list <a class="moz-txt-link-freetext" href="https://gtalug.org/mailman/listinfo/talk">https://gtalug.org/mailman/listinfo/talk</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">-- 
David Collier-Brown,         | Always do right. This will gratify
System Programmer and Author | some people and astonish the rest
<a class="moz-txt-link-abbreviated" href="mailto:dave.collier-brown@indexexchange.com">dave.collier-brown@indexexchange.com</a> |              -- Mark Twain
</pre>
<br>
<p><strong><em><span style="color: #212121;">CONFIDENTIALITY NOTICE AND DISCLAIMER</span></em></strong><em><span style="color: #212121;"> : This telecommunication, including any and all attachments, contains confidential information intended only for the person(s)
 to whom it is addressed. Any dissemination, distribution, copying or disclosure is strictly prohibited and is not a waiver of confidentiality. If you have received this telecommunication in error, please notify the sender immediately by return electronic mail
 and delete the message from your inbox and deleted items folders. This telecommunication does not constitute an express or implied agreement to conduct transactions by electronic means, nor does it constitute a contract offer, a contract amendment or an acceptance
 of a contract offer. Contract terms contained in this telecommunication are subject to legal review and the completion of formal documentation and are not binding until same is confirmed in writing and has been signed by an authorized signatory.</span></em></p>
</body>
</html>