<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div><blockquote type="cite" class=""><div class="">On 04-Sep-2018, at 9:19 AM, Necktwi Ozfguah <<a href="mailto:necktwi@ferryfair.com" class="">necktwi@ferryfair.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><p class="">On 04-Sep-2018, at 8:58 AM, Andy Green <<a href="mailto:andy@warmcat.com" class="">andy@warmcat.com</a>> wrote:</p><p class="">On 09/04/2018 11:17 AM, Necktwi Ozfguah wrote:</p><blockquote class=""><p class="">Hi, For a FileSystem operation, is it possible to set UID and GID on the</p></blockquote><p class="">You can tell lws to drop privileges and take on a noprivileged uid and gid just by setting the context creation info .uid and .gid</p><p class=""><a href="https://u7535577.ct.sendgrid.net/wf/click?upn=S8VPHvg5-2FzxqlLfWXPq42u7cPGghXCdGGd9Sj25ftZFcHDVj2YDVyT9b6LUfX5fnuKUjlwv25oT2-2F64zCCBCjSfHC9-2FSlUnqZwozeI25o-2FkjidU18XREyIuuNt1yrePg1VmWhLB5z5CWZOQFw-2FGj3Pw6iVOnS3XIUOn07bIddimqrEHKOj3FRS4iD8V8VsmcTbsVoVJ8wqVIjlA4o1Gw5M-2FhvqDhd8rz7ESV4bgLkq6XhHD4CSBAAL-2FSCMSGA8R7qb9SvrrxMWbmVDpuxNWfCRmS3nR-2FenBUrGPpTwQ-2Fb72SnqyLJB6GUPASzlxFVaz-2BkFhqfu1-2FKO9jwCztFyfbdL1xXDOy6MoZNDnV6dVU06bnscdUe8YhgQpDHwowm0FJIDucki9RcqcXagj1ISQzzKAH5tcBwvgA2z6qOAa0n-2BqhTyxBbC-2BzVSRwIrXyqRGJUc6oM-2BUu7988Co-2BacEz8nXmILPLEoiTHBXxbLE6xqkYgRXe9IB5Htg5iKmB-2FzzMaxGye3DoYl0xGLOCDE0u8xH463lC-2Fv8b8P2LZBeZ6gQF5jq8f-2FcJXiqRfzn9Ut0QEKt3193wDqfchZHJAhCpaZDueAqYEpikIaT5-2Bl7s-2F044FOFDnbE-2BZfDPgXN5BqknW_MVqETTsl5w9JZmVH1Sq2QE8KivBbCxWEMAI66w938-2FwvrqQiWAHgQB1aY46IxLBqy41Q0-2FnwWX425FIt2hO9UzKbQqQGg8SlsN-2BMMOHDfi55VsH4oiHmhZbGBIP-2FLZmXUkEWpf1kWhG708YcJKr03LS3csgLFu-2F4sXQobG-2BG7PkUPxulJWHrAMM7dA6gNFhWwwrKRFNya8-2FHbWsYgbDNyTzHXKMnaDpob4SOvbi6nx0-3D" class="">https://libwebsockets.org/git/libwebsockets/tree/include/libwebsockets/lws-context-vhost.h#n219-222</a></p><p class="">It implies you start your app as root. The transition to the different uid + gid happens after the vhost protocol init, which allows you to open / create / modify things still as root in your LWS_CALLBACK_PROTOCOL_INIT. This is very convenient for opening logfiles or whatever in directories that are only root-accessible, and still be able to use the fd after the privileges to do that have gone.</p><blockquote class=""><p class="">process? Is there any mechanism drafted to use PAM with libwebsockets.</p></blockquote><p class="">AFAIK I don't have any use for PAM + lws.</p><p class="">What would you actually use it for?</p><div class=""><br class=""></div></blockquote></div></blockquote>I am running a hobby web server. I want my web users to use the linux login credentials. Of course lws and PAM are independent. Thank you.<br class=""><blockquote type="cite" class=""><div class=""><p style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class="">To determine uid of the http session user. Never mind, “You can tell lws to drop privileges and take on a noprivileged uid and gid just by setting the context creation info .uid and .gid” is all I am looking for. Thank you for implementing thread pool, I shall checkout.</p><blockquote style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><pre class="">-Andy</pre><blockquote class=""><p class="">… NeckTwi<span class="Apple-converted-space"> </span><em class="">____________________________________________</em>_ Libwebsockets mailing list<span class="Apple-converted-space"> </span><a href="mailto:Libwebsockets@ml.libwebsockets.org" class="">Libwebsockets@ml.libwebsockets.org</a><a href="https://u7535577.ct.sendgrid.net/wf/click?upn=S8VPHvg5-2FzxqlLfWXPq42u7cPGghXCdGGd9Sj25ftZFcHDVj2YDVyT9b6LUfX5fnuKUjlwv25oT2-2F64zCCBCjSfHC9-2FSlUnqZwozeI25o-2FkjidU18XREyIuuNt1yrePgv1KVyq4PpZGx7bUqYpOnksHQlyYrN206d9whpm31pcB49UPaNazrrNkz-2FndU8cww5p4WM7wWoMpE9p1mvQZAbnlLw1Z07eoaeAvDfOcqsPs8u0OMqNGkM5-2BUq4zJ061u-2BeTK9wq5qCIlLnswHXVtMHTn0YQRIC6BG04b9NVEoxumCzMMbGvgyM1-2BhdvlFCJmiSKm4SXIt3g8gZVJXulRhgPwqfFs1v6-2Bh2MyxTbMP1lIGetzcFnL-2BMJVmBTjb1yB2g5OvFXq-2Bv-2Bh7cEqQwidyV0-2BuQGidM8ufNRKKG29Pe6uiIAu9i-2BvYJnPzJkG9ijMNZl7UnWYSMxpD00aoC-2FA5pqomp9UwWDPD-2F2bqXD1-2FvkwIFDf-2B-2BDhfDduLgoGxe-2BVe46P2k8A0Hc27Fr92mAnTmRYd5wS1VXQj1o81BmwCks-3D_MVqETTsl5w9JZmVH1Sq2QE8KivBbCxWEMAI66w938-2FwvrqQiWAHgQB1aY46IxLBqy41Q0-2FnwWX425FIt2hO9U9Cbk18TqvhYwsCkTKEYErS0fGWKln4OyCTLFD4aG9d0t7D2COfgFIA8rDR9DZeJo1TCGKfvDkOkOjtEbwx3XNQ7zP0xhRHaRm2VmifbrpmHxAzRuGI71NksiEzrzaCGpPoxIdVQGvt4bZRyyr0W1VE-3D" class="">https://libwebsockets.org/mailman/listinfo/libwebsockets</a></p></blockquote></blockquote><img src="https://u7535577.ct.sendgrid.net/wf/open?upn=MVqETTsl5w9JZmVH1Sq2QE8KivBbCxWEMAI66w938-2FwvrqQiWAHgQB1aY46IxLBqar9vonnVTcA5cWTfDu-2BRqhY7EUD3PaAoACwlYOmE0Z3jZGRZDY1bXBW0aD3Hvef5zQVtook-2FcSCroT4BauTnJD2rNdxlH11zbq-2BO1uwmft-2BJ8Dbcc-2Fo8dIEZItelQi1kDo7qMbOEyrZ1JdkP-2BVdEl1HdxUqpH70fHarq1KXO5CwIcRFtHgsN8-2FBUQGsnOFXf" alt="" width="1" height="1" border="0" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; height: 1px !important; width: 1px !important; border-width: 0px !important; margin: 0px !important; padding: 0px !important;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class=""><span class="Apple-converted-space"> </span>_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Libwebsockets mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="mailto:Libwebsockets@ml.libwebsockets.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">Libwebsockets@ml.libwebsockets.org</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="https://u7535577.ct.sendgrid.net/wf/click?upn=S8VPHvg5-2FzxqlLfWXPq42jtl-2BHS72n8W8-2BdZEc27Pkm8-2BhcIKmaR9WoeTGnhmq-2Br9kYDs4T-2FMrzobihEBMVcsg-3D-3D_MVqETTsl5w9JZmVH1Sq2QE8KivBbCxWEMAI66w938-2FwvrqQiWAHgQB1aY46IxLBqy41Q0-2FnwWX425FIt2hO9U-2FFmiDq033dGO4tcee5sBa620krxdNAERruIwLBzy0lPdmHJrzlp-2F4miBVZNfz6E2WorFXiBvnCiuUo05I6hc0a2GcIQAnLIbsN6wi95MTQyHDrBenZ00hnw5m-2FusL9PhFzY5tjlxXHAjFNADUSFypk-3D" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">https://libwebsockets.org/mailman/listinfo/libwebsockets</a></div></blockquote></div><div class=""><div><br class=""></div><div>… NeckTwi</div></div>
<img src="https://u7535577.ct.sendgrid.net/wf/open?upn=MVqETTsl5w9JZmVH1Sq2QE8KivBbCxWEMAI66w938-2FwvrqQiWAHgQB1aY46IxLBqy41Q0-2FnwWX425FIt2hO9U1h5domu9sqDVVqOftHm-2FKG8FFs497JuqBWxAoQQaa2Twdy3juO3O9nWb-2BSaRg6ccQKGRNSuQyToAqfALwmpv9ugkUDfxqtgqp6GZAgCZRcM5JNbUNMqGlxlatGe9iv-2BRZOgmiUhL4slv-2Fp8QNnxrEg803E3Z40f27-2F8SRZx5WNM" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body></html>