tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

user/group mismatch on munin-server update

Hi list,

Today I hit a curious error I imagined long gone with destdir/user-destdir: user/group UID/GID mismatches when pkg_add'ing a package. It happened today with munin-server on one of my hosts.

The install script generated by a "make package" ended up hardcoding USER/GROUP with their respective uid/gid values from the build host, although their values are nowhere to be seen in the Makefile [1].

buildhost# pkg_info -i /usr/pkgsrc/packages/All/munin-server-1.3.2nb8.tgz | egrep '^# (USER|GROUP)'
# GROUP: munin:1001
# USER: munin:munin:1001:Munin user:/var/munin

Which will of course clash when uid/gid do not match on the install host:

host# getent passwd munin && getent group munin
munin:*************:1005:100:Munin user,,,:/var/munin:/sbin/nologin

Now, onto the fix. A short investigation in mk/pkginstall/ makes me say that the install script will hardcode the uid/gid when the user/group already exist on the system. This happens to be the case when someone builds another package just before: munin-node. It uses the exact same user and group name [2], namely "munin".

Questions are:
- is that expected behavior? This can make some public packages really cumbersome. - does this mean that when two or more packages end up using the same user/group name, all subsequent packages built (except the first one) will get the uid/gid hardcoded in the INSTALL script? - what would be the best fix there? Create a distinct user for munin-server and warn admin in MESSAGE that the user/group changed, and that he/she shall fix the rights accordingly?

Thanks for opinions/reviews on that one.


[1] [2]

Jean-Yves Migeon

Home | Main Index | Thread Index | Old Index