tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pwd_mkdb(8) is still broken to me
> > Since the # of bytes written to database is controlled not by
> > sizeof(time_t) but by sizeof(pwd.pw_change), getversion() also should
> > return 0 or 1 depending on sizeof(pwd.pw_change).
>
> Or, write database depending on the size of time_t, like:
>
> time_t tmp = pwd.pw_change;
>
> memmove(p, &tmp, sizeof(tmp));
> p += sizeof(tmp);
What is the benefit to do so? It means nbpwd_mkdb (built on 32bit
time_t host) generates version 0 databases, and installer will need to
be changed to run native pwd_mkdb once before changing root passwd
etc. I wonder what is the raison d'etre of nbpwd_mkdb.
> Other problems I'm seeing:
>
> - pw_scan.c:gettime() built as libnbcomat.a passes wrong sized pointer
> when host time_t is 32-bit.
> - tools/compat should be built with stricter compiler checks (-Wall
> -Werror) IMO.
Since the compiler used here is a host compiler, probably it is
difficult to turn them on unconditionally.
> - Current nbpwd_mkdb generates a broken *pwd.db where VERSION == 0 but
> pw_change & pw_expire are 64-bit.
Yes, need to be fixed.
enami.
Home |
Main Index |
Thread Index |
Old Index