To give some context:
At loginutils/login.c:502 `is_tty_secure()` is called. This function
(at libbb/securetty.c:10) attempts to open "/etc/securetty". If the file is
not found this is not an error (see comment there), but it does set errno.
A few lines later, login.c calls `ask_and_check_password()`, which
eventually reaches `massage_data_for_r_func()`, which returns a failure if
errno is set at the end of the function.
On Wed, Feb 12, 2025 at 3:25 PM Baruch Burstein <bmburst...@gmail.com>
wrote:

> Attempting to attach the patch
>
> On Wed, Feb 12, 2025 at 1:17 PM Baruch Burstein <bmburst...@gmail.com>
> wrote:
> >
> > errno may be non-zero when entering function. Function then completes
> > successfully but reports error.
> >
> > Signed-off-by: Baruch Burstein <bmburst...@gmail.com>
> > ---
> > libpwdgrp/pwd_grp.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c
> > index 10debbcdb..9caf4d70a 100644
> > --- a/libpwdgrp/pwd_grp.c
> > +++ b/libpwdgrp/pwd_grp.c
> > @@ -331,6 +331,7 @@ static int massage_data_for_r_func(struct passdb *db,
> > {
> > void *result_buf = *result;
> > *result = NULL;
> > + errno = 0;
> > if (buf) {
> > if (S.string_size > buflen) {
> > errno = ERANGE;
> > --
> > 2.25.1
>
_______________________________________________
busybox mailing list
busybox@busybox.net
https://lists.busybox.net/mailman/listinfo/busybox

Reply via email to