Dropbear patch suggestion

Rob Landley rob at landley.net
Sat Apr 5 07:38:36 WST 2008

On Friday 04 April 2008 10:56:25 sindi keesan wrote:
> On Fri, 4 Apr 2008, Rob Landley wrote:
> > On Thursday 03 April 2008 21:32:05 sindi keesan wrote:
> >> On Thu, 3 Apr 2008, Rob Landley wrote:
> >>> On Thursday 03 April 2008 16:13:43 sindi keesan wrote:
> >>>> I don't know where shadow came from or why it appears not to work.
> >>
> >> It came from the original setup, where root and user had blank
> >> passwords. Apparently the busybox passwd changed the passwords in passwd
> >> but not in shadow, and dropbear looked at shadow but not at passwd to
> >> decide that my passwords were blank.  When I boot and log in passwd
> >> seems to be consulted, not shadow.  Maybe someone would like to patch
> >> dropbear to look at BOTH files (passwd as well as shadow) before decided
> >> there are blank passwords?
> >
> > It's more that the spec says that _if_ there is a shadow file, the
> > password should live there.  They only live in /etc/passwd on systems
> > that haven't got shadow password support.
> When I log in, why does my system consult passwd and not shadow?

Possibly because you're logging in using the busybox login utility (rather 
than dropbear), and the one you're using does not seem to have been compiled 

This is a guess...

Busybox has support for shadow passwords, but when you configure busybox it's 
possible to switch that support _off_.  (You can switch all sorts of things 
in busybox off, generally to make the binary smaller.)  This is what seems to 
have happened in your case.

> > Busybox has a CONFIG entry for shadow password support or not.  If it's
> > creating a shadow file when shadow password support is disabled, that's a
> > bug.  (Last time I was involved in busybox was the 1.2.2 release...)
> I compiled my own busybox and did not understand most of the questions.
> Apparently it edited the passwd file without removing shadow.  I don't
> know why we even had a shadow file when we had no passwords - it came on
> the 2-floppy download of our linux.

Because if the login you were using had shadow password support, 
then /etc/shadow was the place it would look for passwords.  (If your account 
didn't have passwords, that would be the place for that _lack_ of passwords 
to be recorded.)

> I told people on our list to delete shadow if they were having problems
> with dropbear.

Being aware of /etc/shadow vs /etc/passwd is an important thing.  Blindly 
deleting /etc/shadow may mean you can't even log in as root anymore.

> > If you're using a version of busybox that's configured not to support
> > shadow passwords on a system that's configured to use shadow passwords,
> > that's a problem.
> I have compiled 1.1.0 and 1.3.2 of busybox.  I compiled without shadow
> support.  Some day I can redo this.

If busybox doesn't have shadow support but your system has an /etc/shadow, 
programs that _are_ shadow aware will get confused.  This isn't a 
dropbear-specific issue, per se.

"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.

More information about the Dropbear mailing list