Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 108845 - app-crypt/pinentry: fixes for non-gtk users + libcap
Summary: app-crypt/pinentry: fixes for non-gtk users + libcap
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Sven Wegener
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-11 04:29 UTC by Diego Elio Pettenò (RETIRED)
Modified: 2006-02-23 14:45 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild patch. (pinentry-ebuild.patch,1.68 KB, patch)
2005-10-11 04:30 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
no-hebrew-hack.patch (no-hebrew-hack.patch,876 bytes, patch)
2005-10-11 04:31 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
pinentry-0.7.2-libcap.patch (pinentry-0.7.2-libcap.patch,910 bytes, patch)
2005-10-11 04:32 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff
Ebuild patch (pinentry-ebuild.patch,2.42 KB, patch)
2006-01-29 17:32 UTC, Diego Elio Pettenò (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Diego Elio Pettenò (RETIRED) gentoo-dev 2005-10-11 04:29:27 UTC
The attached patch applied to current ebuild fixes a couple of problems:  
  
- it use the right configure option to enable/disable gtk2 support, so now is  
possible to build pinentry without gtk support and only with qt itself;  
- it applies the no-hebrew-hack.patch (also attached) to allow it compile with  
qt support (fails elseway :/);  
- it applies the attached -libcap patch, that allows to disable libcap support 
instead of leaving it autorecognized, this also adds the caps useflag, and its 
dependency over sys-libs/libcap (before it was enabled if installed, and 
dependency was missing, it could be used with fixed libcap dependency but in 
that case it should be conditional to kernel_linux; 
- it also uses the new bindnow-flags function to get the right flags for 
bindnow in current linker. 
 
HTH, 
Diego
Comment 1 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-10-11 04:30:03 UTC
Created attachment 70348 [details, diff]
ebuild patch.
Comment 2 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-10-11 04:31:50 UTC
Created attachment 70349 [details, diff]
no-hebrew-hack.patch
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-10-11 04:32:45 UTC
Created attachment 70350 [details, diff]
pinentry-0.7.2-libcap.patch
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-10-11 16:24:41 UTC
Disregard the no-hebrew-hack stuff, that's caused by sucky qt visibility 
support, I'm going to back off from it this night. 
Comment 5 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-12-23 17:57:26 UTC
Sven can you take a look to this? :)
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-01-29 17:32:43 UTC
Created attachment 78485 [details, diff]
Ebuild patch

Okay I forgot about this until tonight, sorry.
The attached patch is on the current ebuild; it goes a step further, it doesn't set the pinentry programs suid when using caps (as that would make useless caps anyway).
Comment 7 Sven Wegener gentoo-dev 2006-02-23 14:26:32 UTC
   Limits and permissions
       In Linux 2.6.8 and earlier, a process must be privileged (CAP_IPC_LOCK)
       in  order  to  lock  memory  and the RLIMIT_MEMLOCK soft resource limit
       defines a limit on how much memory the process may lock.

       Since Linux 2.6.9, no limits are placed on the amount of memory that  a
       privileged  process can lock and the RLIMIT_MEMLOCK soft resource limit
       instead defines a limit on how much memory an unprivileged process  may
       lock.

With >=2.6.9 we don't need libcap, we can disable suid and still be on the safe side as long as ulimit -l is at least 16384 bytes large. On <2.6.9 using libcap and not suid only gains us anything, if CAP_IPC_LOCK is added to the permitted set of the user at login time. Which probably isn't on a default system, hence we're still unprivileged and can't lock the memory. If we're suid, libcap doesn't gain us anything, because we're already privileged through suid, lock the memory and later drop the privilege and uid back to the user.
Comment 8 Sven Wegener gentoo-dev 2006-02-23 14:45:44 UTC
Thanks Diesgo, commited to CVS.