Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
equery files --filter=cmd does not report files in /usr/sbin
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
aramis_qc
Tux's lil' helper
Tux's lil' helper


Joined: 24 Sep 2006
Posts: 106
Location: Québec - Canada

PostPosted: Wed Feb 15, 2012 1:51 pm    Post subject: equery files --filter=cmd does not report files in /usr/sbin Reply with quote

I've been using gentoolkit for long. I recently noted that

Code:
equery files --filter=cm ebuild_name


does not list files in /usr/sbin when query is ran without root privileges.

On the other hand when module files is used with no option then contents of /usr/sbin is output. Same holds true when equery is submitted with --filter=tree or --filter=type as regular user. That is everything is listed.

Does anyone know a reason ?

Thank's in advance.[/code]


This is solved. No room in subject field to include mention
_________________
Profil et systèmes


Last edited by aramis_qc on Thu Feb 16, 2012 1:18 pm; edited 2 times in total
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9538
Location: beyond the rim

PostPosted: Thu Feb 16, 2012 10:27 am    Post subject: Reply with quote

It's not a security measure if that's your concern, the --filter=cmd option simply lists files that are contained in the calling users PATH:
Code:
 150 def filter_by_command(contents):
 151         """Return a copy of content filtered by executable commands."""
 152
 153         filtered_content = {}
 154         userpath = os.environ["PATH"].split(os.pathsep)
 155         userpath = [os.path.normpath(x) for x in userpath]
 156         for path in contents:
 157                 if (contents[path][0] in ['obj', 'sym'] and
 158                         os.path.dirname(path) in userpath):
 159                         filtered_content[path] = contents[path]
 160
 161         return filtered_content
Back to top
View user's profile Send private message
aramis_qc
Tux's lil' helper
Tux's lil' helper


Joined: 24 Sep 2006
Posts: 106
Location: Québec - Canada

PostPosted: Thu Feb 16, 2012 1:16 pm    Post subject: Reply with quote

Thank's a lot !
_________________
Profil et systèmes
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum