help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is there a setting to deny a command input that exceeds certain leng


From: Greg Wooledge
Subject: Re: Is there a setting to deny a command input that exceeds certain length?
Date: Wed, 8 Sep 2021 09:29:38 -0400

On Wed, Sep 08, 2021 at 10:39:09AM +0000, conan zhan wrote:
> I have noticed that in 'bashhist.c' , any command input longer than
> "SYSLOG_MAXLEN" will be truncated and log the only first 600 bytes. Is there a
> setting in some script that denies a line longer than this/or some length?

In "some script"?  I'm a little confused.

I think what you're trying to ask is: "Is there a setting in bash that
will cause bash to reject all commands which exceed a certain length?"

To the best of my knowledge, no, there isn't.

Looking "behind" your question, it seems that your primary concern is
making syslog save every byte of every bash command, without truncation.
The way the code works now, as you observed, bash truncates commands
so that they'll fit in syslog.  Perhaps what you should be looking at,
instead of asking bash to reject long commands, is splitting long commands
into multiple syslog chunks.  If you come up with a patch for that, it
may suit your needs, and there's even a possibility Chet would consider
including it in a future release of bash.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]