Bug 344751

Summary: kpackage does not uninstall RPMs
Product: [Fedora] Fedora Reporter: Ian Chapman <packages>
Component: kdeadminAssignee: Than Ngo <than>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 7CC: mirsev, rdieter
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-12-20 11:14:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fixes the uninstall problem
none
Fix uninstallations of RPMs through consolehelper none

Description Ian Chapman 2007-10-22 00:14:42 UTC
Description of problem:
Kpackage does not uninstall RPMs.

Version-Release number of selected component (if applicable):
kdeadmin-3.5.7-1.fc7.1

How reproducible:
Choose an RPM and try to uninstall it in kpackage

Steps to Reproduce:
1. Load kpackage
2. Choose an RPM
3. Select uninstall from the right hand pane, near the bottom
4. A window opens, choose uninstall
5. It simply closes (despite the option keep window open) and does nothing.
  
Actual results:


Expected results:


Additional info:

Comment 1 Serguei Miridonov 2007-11-10 01:35:42 UTC
Created attachment 253811 [details]
Fixes the uninstall problem

I don't know if this is the right fix but kpackage succesfully does uninstalls
after this. Please, check and apply if everything is OK.

Comment 2 Ian Chapman 2007-11-12 12:25:09 UTC
(In reply to comment #1)
> Created an attachment (id=253811) [edit]
> Fixes the uninstall problem
> 
> I don't know if this is the right fix but kpackage succesfully does uninstalls
> after this. Please, check and apply if everything is OK.


I can confirm that this works for me too. It probably isn't the correct fix
though, but I'm no programmer. What I suspect is the problem is that kpackage
checks to see if you are root and if not, doesn't perform an uninstall. It uses
consolehelper when run as a normal user but as kpackage uses getuid() it returns
the non-priviledged users uid and not that of root - so it thinks it's not root.
That patch simply bypasses that. Replacing getuid() with geteuid() might be a
better fix but like I said I'm no programmer so I could be talking rubbish. 

I haven't tested that theory yet, but I'll give it a go.

Comment 3 Ian Chapman 2007-11-12 12:49:48 UTC
Created attachment 255171 [details]
Fix uninstallations of RPMs through consolehelper

I've tested it an geteuid() seems to work! :-)

Comment 4 Serguei Miridonov 2007-11-12 13:39:43 UTC
Just curious, what is the reason to check something and then do the same in any 
case?:

-  if (getuid() == 0) {
+  if (geteuid() == 0) {
     return doinstP(installFlags,files,test);
   } else {
     return doinstP(installFlags,files,test);
   }

Strange, isn't it? Moreover, the patch you provide here has nothing to do with 
uninstallation because this part is related to installation.

You missed that in the original version there was a doUninst instead of one of 
doUninstP and this was a cause of not uninstalling packages. If you try 
original version, then you start kdepackage as root, it does nnot work. If you 
start it from konsole as ordinary user, when you hit "Uninstall" it asks for 
root password and then uninstall works.

So, please, respect my patch until someone from kpackage maintainers confirms 
the bug and provide correct fix.

BTW, if you are not programmer, why don't wait and see what programmers say?

Comment 5 Rex Dieter 2007-11-12 13:47:35 UTC
fwiw, if you want a real(upstream) kpackage developer to see/comment, reporting
this to bugs.kde.org is the best way to help make that happen.

Comment 6 Serguei Miridonov 2007-11-12 14:26:31 UTC
Two questions:

1. What the bugzilla.redhat.com is for?

2. What is current development version of KDE? Is it kdeadmin-3.5.7 which we 
are talking about? If not than why not to fix the bug here in the version which 
Fedora users currently running?


Comment 7 Rex Dieter 2007-11-12 14:44:17 UTC
> 1. What the bugzilla.redhat.com is for?

imo, generally, for fedora-specific issues (or where upstream *is*
fedora/redhat).  Otherwise, fedora tries to do as much with upstream (in this
case, kde.org) as possible (that way, everybody wins/benefits).

> 2. What is current development version of KDE?

not sure exactly what you mean, but the latest in the kde-3.5.x series is
kde-3.5.8.  kde-4.0 is in the works, but most of that is strictly F9 territory.

Comment 8 Serguei Miridonov 2007-11-12 15:05:24 UTC
>> 1. What the bugzilla.redhat.com is for?

> imo, generally, for fedora-specific issues

Then why not to remove all packages from bugzilla menu which are not fedora/
redhat upstream?

> not sure exactly what you mean

I mean that Fedora 7 users are running 3.5.7 and we are asking to fix kpackage 
here in Fedora. Moreover, the possible fix is already provided (the first one) 
and it only necessary to check this with Fedora package maintainer. If the 
Fedora package maintainer thinks that he has not enough knowledge and needs 
some assistance from KDE team, it is better if he contacts them himself.

P.S. This bugzilla thread is an area for discussion about specific bug in the 
specific package. Why not limit the discussion only for this topic and start 
more general one in fedora-list?

Comment 9 Rex Dieter 2007-11-12 15:19:37 UTC
> Then why not to remove all packages from bugzilla

That suggestion misses "fedora-specific issues".
upstream's generally get annoyed seeing disto-specific bugs in their bug-trackers.

> the possible fix is already provided 

no argument there, I'll probably be applying/testing the provided patch soon.

Comment 10 Rex Dieter 2007-11-12 15:27:46 UTC
wrt further discussion, would be great.  see also:
http://fedoraproject.org/wiki/Objectives
http://fedoraproject.org/wiki/PackageMaintainers/WhyUpstream

Comment 11 Ian Chapman 2007-11-12 18:56:03 UTC
(In reply to comment #4)

> So, please, respect my patch until someone from kpackage maintainers confirms 
> the bug and provide correct fix.
> 
> BTW, if you are not programmer, why don't wait and see what programmers say?

Yes you're right, I went barking up the wrong tree and blundered in with my two
left feet. Apologies. 

Comment 12 Than Ngo 2007-12-20 11:14:10 UTC
the correct fix is that we shouldn't use console helper but just use the code 
in kpackage. It's safer. It's fixed in kdeadmin-3.5.8-2.f7 that will be pushed 
in F8/F7 update soon. Thanks for your report