aptitude search throws an error if used without sudo

Bug #21704 reported by mon
4
Affects Status Importance Assigned to Milestone
aptitude (Ubuntu)
Fix Released
Medium
Michael Vogt

Bug Description

If I type: "aptitude search package", aptitude throws an error about not been
able to open /home/<username>/.aptitude/config
If done with: "sudo aptitude search package" there's no error.
"apt-cache search package" doesn't throw an error message if used without sudo.
I don't think it's necesary to use root priv. to search for a package.

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

can you please do a "$ ls -l ~/.aptitude/config"
on a termianl and check if the file actually is owned by your user or by root?
My guess is that it's root. You should chown the file back to your user. This
is probably a side-effect of saving the config under sudo before (sudo does not
changes HOME by default, it only does that if called with sudo -H).

Cheers,
 Michael

Revision history for this message
mon (javiermon-deactivatedaccount) wrote :

(In reply to comment #1)
> Thanks for your bugreport.
>
> can you please do a "$ ls -l ~/.aptitude/config"
> on a termianl and check if the file actually is owned by your user or by root?
> My guess is that it's root. You should chown the file back to your user. This
> is probably a side-effect of saving the config under sudo before (sudo does not
> changes HOME by default, it only does that if called with sudo -H).
>
> Cheers,
> Michael

javier@A1691:~$ ls -l /home/javier/.aptitude/
ls: /home/javier/.aptitude/: Permiso denegado

Can't access the file. So you're right, the file belongs to root.

Revision history for this message
mon (javiermon-deactivatedaccount) wrote :

(In reply to comment #2)
> (In reply to comment #1)
> > Thanks for your bugreport.
> >
> > can you please do a "$ ls -l ~/.aptitude/config"
> > on a termianl and check if the file actually is owned by your user or by root?
> > My guess is that it's root. You should chown the file back to your user. This
> > is probably a side-effect of saving the config under sudo before (sudo does not
> > changes HOME by default, it only does that if called with sudo -H).
> >
> > Cheers,
> > Michael
>
> javier@A1691:~$ ls -l /home/javier/.aptitude/
> ls: /home/javier/.aptitude/: Permiso denegado
>
> Can't access the file. So you're right, the file belongs to root.

As expected, changing the directory owner did the trick.

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for confirming.

I'm not sure what to do with this bugreport. I think it can be closed because
it's not a bug in aptitude (aptitude can be used as user and it will switch
itself to root-mode when it needs that privilieges). If anything it's a problem
with sudo (but sudo is designed to leave $HOME alone).

If you don't mind I would like to close. it.

Cheers,
 Michael

Revision history for this message
mon (javiermon-deactivatedaccount) wrote :

(In reply to comment #4)
> Thanks for confirming.
>
> I'm not sure what to do with this bugreport. I think it can be closed because
> it's not a bug in aptitude (aptitude can be used as user and it will switch
> itself to root-mode when it needs that privilieges). If anything it's a problem
> with sudo (but sudo is designed to leave $HOME alone).
>
> If you don't mind I would like to close. it.
>
> Cheers,
> Michael

Ok, I understand your concerns. Feel free to close it, I won't protest :)

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, bug closed.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.