[ Home | Liste | F.A.Q. | Risorse | Cerca... ]


[ Data: precedente | successivo | indice ] [ Argomento: precedente | successivo | indice ]


Archivio: Luglio 2004 ml@sikurezza.org
Soggetto: Re: [ml] bash_history vuoto
Mittente: Claudio
Data: Tue, 13 Jul 2004 10:12:42 +0200 (CEST)
>> Il fatto che sembra essere modificato _solo_ il .bash_history mi
>> farebbe pensare che non si tratti affatto di un rootkit, ma del normale
>>  comportamento di bash. Esiste un valore di default (mi pare sia 500)
>> relativo a "quante righe" deve contenere il file incriminato. Se tale
>> limite viene raggiunto, automaticamente bash svuota il file e ne crea
>> uno from-scratch. Se vuoi incrementare tale limite (io di solito lo
>> aumento a 4-5 mila linee) devi impostare:
>>
>> HISTSIZE=4000 HISTFILESIZE=4000
>>
>
> Sei sicuro che il file venga svuotato una volta raggiunto il limite? Per
> quel poco che ne so io il file mantiene quel limite costante, ovvero
> aggiunge i comandi alla fine e li elimina all'inizio  di HISTFILE
> qualsiasi valore tu abbia in HISTSIZE e HISTFILESIZE.

Credo dipenda dalla configurazione usata. I comandi possono essere
"appesi" o il file può essere sovrascritto. Nella sezione "HISTORY" della
man page di bash trovo:

"On startup, the history is initialized from the file named by the vari-
able  HISTFILE  (default ~/.bash_history).  The file named by the value
of HISTFILE is truncated, if necessary, to contain  no  more  than  the
number of lines specified by the value of HISTFILESIZE.  When an inter-
active shell exits, the last $HISTSIZE lines are copied from  the  his-
tory list to $HISTFILE.  If the histappend shell option is enabled (see
the description of shopt under SHELL BUILTIN COMMANDS below), the lines
are  appended  to the history file, otherwise the history file is over-
written."

Ergo, pare che "the histappend shell option" decida la sorte del file in
questione...

   -- Claudio




[ Home | Liste | F.A.Q. | Risorse | Cerca... ]

www.sikurezza.org - Italian Security Mailing List
(c) 1999-2005