OpenWRT upgrade: Dnsmasq problem solved

After upgrading OpenWRT to version 18.06.2 (current release at the time of writing) on one of my Xiaomi MiWiFi Mini routers I started seeing this error in System Log:

unknown user or group: dnsmasq

In addition to that users were not able to connect to WiFi due to not received DHCP configuration.

Luckily, on this page I've found a workaround:

echo "dnsmasq:*:453:dnsmasq" >> /etc/group
echo "dnsmasq:*:453:453:dnsmasq:/var:/bin/false" >> /etc/passwd
echo "dnsmasq:*:0:0:99999:7:::" >> /etc/shadow
chown dnsmasq.dnsmasq /usr/sbin/dnsmasq

Apparently Dnsmasq (which is DHCP server on OpenWRT) was not having it's user setup properly on the image.