Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TOOL] (se cosi si puo' chiamare) x vedere pkg injected
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Tue Sep 07, 2004 2:18 am    Post subject: [TOOL] (se cosi si puo' chiamare) x vedere pkg injected Reply with quote

pubblico questo scriptino che feci 2 settimane fa per trovare i pacchetti iniettati.
perdonate la banalita', ma magari puo tornare utile a qualcuno..
senza argomenti lista tutti i pacchetti, con un argomento (pattern) restringe la ricerca.
Code:
#!/bin/sh
list=($(find /var/db/pkg/*/ -mindepth 1 -maxdepth 1 -iname $1\* -type d))
for item in ${list[*]}
do
   i=0
   for a in ${item}/*;do ((i++)); done
   (($i==1)) && pkglist=(${pkglist[*]} $(basename ${item}))
done
[ ${#pkglist[*]} ] && echo -e "These packages are probably injected (they are missing emerge information):\n"
for a in ${pkglist[*]}
do
   echo ${a}
done

_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31344
Location: here

PostPosted: Tue Sep 07, 2004 8:09 am    Post subject: Reply with quote

Bellissimo a me torna piu' che utile. Aggiunto ai post utilissimi
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Tue Sep 07, 2004 8:36 am    Post subject: Reply with quote

ottimo.
l'ho testato...
pensavo di aver trovato un bug...
invece era un vecchio pkt iniettato :) (stesso nome,versione diversa)

se lo colori un po' lo mettiamo nel gekit?
E' semplice ma comodo.
ciao
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31344
Location: here

PostPosted: Tue Sep 07, 2004 8:47 am    Post subject: Reply with quote

xchris wrote:
E' semplice ma comodo.

E molto utile
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
silian87
Advocate
Advocate


Joined: 06 Oct 2003
Posts: 2318
Location: Treviso, Italy

PostPosted: Tue Sep 07, 2004 8:54 am    Post subject: Reply with quote

credo che faro' l'inject di qualche pacchetto per provarlo :lol: . Se no mi mostra tutto vuoto :cry:
_________________
Musica che ascolto: http://www.last.fm/user/silian87/

Silian87 FAQs: http://marentax.homelinux.org/~silian87/silian87-faq.txt

GTalk: silian87@gmail.com
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Tue Sep 07, 2004 8:54 am    Post subject: Reply with quote

si... utile e' la parola + adatta :)
ciao
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Wed Sep 08, 2004 7:22 pm    Post subject: Reply with quote

in realta' e' un pezzo di codice che volevo includere dentro portagenurse, ma visto che lo scrivo in python, per me puo' essere un tool a se stante
sempre che si possa considerare tool..
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Thu Sep 09, 2004 12:09 am    Post subject: Reply with quote

aspettiamo allora portagenurse :)
(anche se gia' depcleaner li rilevava)

cmq e' comodo...ho trovato una vecchia "carogna" :D

ciao
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Thu Sep 09, 2004 12:47 am    Post subject: Reply with quote

per la tua gioia ecco la versione pitone:
Code:

#!/usr/bin/python
import os
import os.path

def is_inject(arg,dirname,names):
        content = os.listdir(dirname)
        if len(content) == 1:
                if (names[0] == 'COUNTER'):
                        print dirname[arg:]


portage_db_dir = '/var/db/pkg'
os.path.walk(portage_db_dir,is_inject,len(portage_db_dir)+1)

_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Thu Sep 09, 2004 1:01 am    Post subject: Reply with quote

decisamente + pulito!
volendo puoi sistemare un po' gli import :)
ciao
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) 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