[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-frameworks-devel
Subject:    Re: Review Request 116881: Fix KUser::groups() and KUser::groupNames() on UNIX
From:       "Alexander Richardson" <arichardson.kde () googlemail ! com>
Date:       2014-03-18 20:14:59
Message-ID: 20140318201459.10295.64126 () probe ! kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/116881/
-----------------------------------------------------------

(Updated March 18, 2014, 9:14 p.m.)


Review request for KDE Frameworks.


Changes
-------

removed duplicate files (reviewboard showed they weren't there yet)


Repository: kcoreaddons


Description
-------

Fix KUser::groups() and KUser::groupNames() on UNIX

If available we use getgrouplist() which returns all group IDs.
Otherwise we fall back to using getgrent() and checking whether gr_mem
contains the user. For some reason gr_mem doesn't usally contain the
users primary gid, so we add the corresponding struct group for that gid
as well.


Diffs
-----

  src/lib/CMakeLists.txt 73f28a8a3acda8449a3aee3b025e2b165722b998 
  src/lib/util/config-getgrouplist.h.cmake PRE-CREATION 
  src/lib/util/kuser_unix.cpp 0e0720dbb614015d6d568b39da3cab77cece76a8 

Diff: https://git.reviewboard.kde.org/r/116881/diff/


Testing
-------

Returns more groups now, should fix KUserTest::testKUser() on build.kde.org


File Attachments (updated)
----------------

 old user->groups result (getgrent)
  https://git.reviewboard.kde.org/media/uploaded/files/2014/03/18/86c5e986-8098-4c50-809c-bc3e7851447a__grouplist_getgrent_old.txt
 new user->groups result (getgrouplist)
  https://git.reviewboard.kde.org/media/uploaded/files/2014/03/18/59f4ecda-5c1d-4bdc-a8ec-850de761e3a3__grouplist_getgrouplist.txt
 new user->groups result (getgrent + current gid)
  https://git.reviewboard.kde.org/media/uploaded/files/2014/03/18/39d0172d-f6c8-400e-8af0-0c4aace8f7a1__grouplist_getgrent_new.txt



Thanks,

Alexander Richardson


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/116881/">https://git.reviewboard.kde.org/r/116881/</a>
     </td>
    </tr>
   </table>
   <br />




<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: \
url('https://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black solid;">  <tr>
  <td>

<div>Review request for KDE Frameworks.</div>
<div>By Alexander Richardson.</div>


<p style="color: grey;"><i>Updated March 18, 2014, 9:14 p.m.</i></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Changes</h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">removed duplicate files (reviewboard showed \
they weren&#39;t there yet)</pre>  </td>
 </tr>
</table>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
kcoreaddons
</div>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid \
#b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Fix KUser::groups() and KUser::groupNames() \
on UNIX

If available we use getgrouplist() which returns all group IDs.
Otherwise we fall back to using getgrent() and checking whether gr_mem
contains the user. For some reason gr_mem doesn&#39;t usally contain the
users primary gid, so we add the corresponding struct group for that gid
as well.</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Returns more groups now, should fix \
KUserTest::testKUser() on build.kde.org</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>src/lib/CMakeLists.txt <span style="color: \
grey">(73f28a8a3acda8449a3aee3b025e2b165722b998)</span></li>

 <li>src/lib/util/config-getgrouplist.h.cmake <span style="color: grey">(PRE-CREATION)</span></li>

 <li>src/lib/util/kuser_unix.cpp <span style="color: \
grey">(0e0720dbb614015d6d568b39da3cab77cece76a8)</span></li>

</ul>

<p><a href="https://git.reviewboard.kde.org/r/116881/diff/" style="margin-left: 3em;">View Diff</a></p>



<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">File Attachments (updated)</h1>

<ul>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/03/18/86c5e986-8098-4c50-809c-bc3e7851447a__grouplist_getgrent_old.txt"> \
old user-&gt;groups result (getgrent)</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/03/18/59f4ecda-5c1d-4bdc-a8ec-850de761e3a3__grouplist_getgrouplist.txt">new \
user-&gt;groups result (getgrouplist)</a></li>

 <li><a href="https://git.reviewboard.kde.org/media/uploaded/files/2014/03/18/39d0172d-f6c8-400e-8af0-0c4aace8f7a1__grouplist_getgrent_new.txt">new \
user-&gt;groups result (getgrent + current gid)</a></li>

</ul>





  </td>
 </tr>
</table>




  </div>
 </body>
</html>



_______________________________________________
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic