inipafile: Backport some upstream changes