OpenWrt Forum Archive

Topic: Bug in the handling of `getpwnam' and `getgrnam' in `dhcp-fwd'

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

`dhcp-fwd' handles the two libc functions `getpwnam' and `getgrnam' incorrectly: When one of the functions returns a NULL pointer it exits. Before exiting it calls `perror' to output `errno' which may be set to zero. This case (return value is NULL and `errno' is zero) indicates that the user (or group) doesn't exist and should be handled too, but calling `perror' is not a wise choise since it will output `success'.

A bugreport has been sent upstream, a  patch is available here: http://verplant.org/openwrt/dhcp-forwar … rnam.patch

Regards,
-octo

The discussion might have continued from here.