On Tue, Feb 25, 2025 at 03:35:47PM +0200, Baruch Burstein wrote: > 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.
So the problem (which your patch fixes) is that if errno is nonzero at entry to massage_data_for_r_func, the RETURN VALUE of massage_data_for_r_func is wrong, because massage_data_for_r_func ends in "return errno;". But a library function should avoid clearing errno. It might be better to have it return 0 and leave errno alone. -- Adam _______________________________________________ busybox mailing list [email protected] https://lists.busybox.net/mailman/listinfo/busybox
