bug-bash
[Top][All Lists]
Advanced

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

Re: syntax error with lone > or < as string in [ ] tests with -a or -o o


From: Emanuel Attila Czirai
Subject: Re: syntax error with lone > or < as string in [ ] tests with -a or -o operators
Date: Mon, 15 Apr 2024 20:13:23 +0200

On Mon, Apr 15, 2024 at 7:56 PM Greg Wooledge <greg@wooledge.org> wrote:

> On Mon, Apr 15, 2024 at 07:04:23PM +0200, Emanuel Attila Czirai wrote:
> > In my superficial report, I definitely didn't think of that. I even
> forgot
> > to mention that it works when escaped like "\>"
> >
> > I've encountered it in the "adduser" FreeBSD sh script that runs as root,
> > while trying to set a one char password like ">", so I thought I'd
> mention
> > it here as well in case it might be helpful since I saw it happens in
> bash
> > as well.
>
> Sounds like you've found a nontrivial bug in FreeBSD (in the adduser
> script, not in sh).  I hope this gets reported and fixed, and in any case,
> good work and thank you.
>
It's nothing really,

there's code in adduser that does this:
[ -z ">" -a -z ">" ] && continue
which errors like:
[: -a: unexpected operator
but the > are $passwordvars

so if I want to set the password to ">" for example,
I get to see that error, but still works as expected in the end.


reply via email to

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