[Toybox] patch: make login use the shared read_passwd function

Rob Landley rob at landley.net
Fri Jul 20 15:43:05 PDT 2012


On 07/20/2012 01:47 AM, Elie De Brauwer wrote:
> All,
> 
> In attach a patch which make the entire things actually smaller ;),
> login.c used a function to read a password which was virtually identical
> to a more globally defined function in lib/password.c, so I removed the
> one in login.c and made use of the function defined elsewhere.

I actually prefer "_password" for the generic function names because
passwd is a command, and I called the file lib/password.c so it's more
consistent to have the functions in it named password.

But I'll fix that up myself...

> Some comments not in this patch here, but these a trivial whitespace fixes.
> - lib/password.c needs a spaces to tab fix.
> - lib/password.c has a wrong filename in the header comment.
> - lib/passwd.c also needs a spaces to tab fix.

Long-term I'm thinking of just switching all the tabs to spaces because
it's not consistent now and vi's stopped honoring the ts=4 comments.
Keeping it straight is silly bordering on annoying.

Probably best to do that when I move the toys/*.c files into categorized
subdirectories. But I'm cutting a release first, though. :)

Meanwhile: chmod's missing some corner cases ("chmod a+w blah" and
"chmod +w blah" aren't _quite_ the same: the second needs to honor
umask. And it looks like I never filled in the suid/sgid/sticky bit
calculation part? There's an if() but it's just empty curly brackets
after it...

Aw, bash's "umask" won't let me set the SUID, SGID, or STID bits in the
umask. No umask 2022. So how do I test whether "+s" should honor the
umask? :)

Rob
-- 
GNU/Linux isn't: Linux=GPLv2, GNU=GPLv3+, they can't share code.
Either it's "mere aggregation", or a license violation.  Pick one.

 1342824185.0


More information about the Toybox mailing list