Webmin 2.111 throws error on NetBSD 10.0

SYSTEM INFORMATION
OS type and version 10.0
Webmin version 2.111

Webmin 2.111 on NetBSD 10.0 throws the following error message upon logging in:

Fatal Error!
An error has occurred building a program for listing mounted filesystems on your system :
/usr/local/webmin-2.111/mount/netbsd-mounts.c: In function ‘main’:
/usr/local/webmin-2.111/mount/netbsd-mounts.c:17:16: warning: passing argument 1 of ‘getmntinfo’ from incompatible pointer type [-Wincompatible-pointer-types]
17 | n = getmntinfo(&mntlist, MNT_NOWAIT);
| ^~~~~~~~
| |
| struct statfs **
In file included from /usr/include/sys/mount.h:49,
from /usr/local/webmin-2.111/mount/netbsd-mounts.c:7:
/usr/include/sys/statvfs.h:160:16: note: expected ‘struct statvfs **’ but argument is of type ‘struct statfs **’
160 | int getmntinfo(struct statvfs **, int)
| ^~~~~~~~~~~~~~~~~
/usr/local/webmin-2.111/mount/netbsd-mounts.c:24:10: error: invalid use of undefined type ‘struct statfs’
24 | mntlist[i].f_mntonname,
| ^
/usr/local/webmin-2.111/mount/netbsd-mounts.c:24:13: error: invalid use of undefined type ‘struct statfs’
24 | mntlist[i].f_mntonname,
| ^
/usr/local/webmin-2.111/mount/netbsd-mounts.c:25:10: error: invalid use of undefined type ‘struct statfs’
25 | mntlist[i].f_mntfromname,
| ^
/usr/local/webmin-2.111/mount/netbsd-mounts.c:25:13: error: invalid use of undefined type ‘struct statfs’
25 | mntlist[i].f_mntfromname,
| ^
/usr/local/webmin-2.111/mount/netbsd-mounts.c:26:10: error: invalid use of undefined type ‘struct statfs’
26 | mntlist[i].f_fstypename,
| ^
/usr/local/webmin-2.111/mount/netbsd-mounts.c:26:13: error: invalid use of undefined type ‘struct statfs’
26 | mntlist[i].f_fstypename,
| ^
/usr/local/webmin-2.111/mount/netbsd-mounts.c:27:23: error: invalid use of undefined type ‘struct statfs’
27 | expand_flags(mntlist[i].f_flags),
| ^
/usr/local/webmin-2.111/mount/netbsd-mounts.c:27:26: error: invalid use of undefined type ‘struct statfs’
27 | expand_flags(mntlist[i].f_flags),
| ^
/usr/local/webmin-2.111/mount/netbsd-mounts.c:28:10: error: invalid use of undefined type ‘struct statfs’
28 | mntlist[i].f_flags);
| ^
/usr/local/webmin-2.111/mount/netbsd-mounts.c:28:13: error: invalid use of undefined type ‘struct statfs’
28 | mntlist[i].f_flags);
| ^

Is this a known bug?

Goodness, I didn’t even know there was any C code in Webmin, but I guess there are some commands to get mount information on the BSDs. I can’t imagine that’s still necessary today.

But, no, it is not a known bug. When is the last time things worked? I guess there have been changes in the OS or standard library that broke it.

I’ll ask @Jamie if he has any thoughts on it. There aren’t a lot of NetBSD Webmin users that I’m aware of.

Yeah, I, too, was surprised when I saw that.

As for when the last time was it worked - for me it did work until I upgraded my system from NetBSD 9.3 to 10.0 a week ago or so, but I also upgraded Webmin from 2.021 to 2.111 in the course of the OS upgrade. So I’m quite sure the combination of Webmin 2.021 and NetBSD 9.3 worked, but based on your reaction to even seeing C code, it’s probably safe to assume it’s not Webmin’s code that has changed here, so I’d assume what broke it was upgrading the OS, not Webmin.

Looks similar to this old bug back in 2012.

https://sourceforge.net/p/webadmin/bugs/4141/

1 Like

Is the clue in the Webmin version ? That seems rather advanced !

That’s the version I’m running, don’t forget webmin gets the newer version of webmin in advance of virtualmin installs with the exception of installing webmin then installing the virtualmin module on top of it. You could also add the webmin repro to an existing virtualmin install but that is not recomended, there will be a good reason why webmin is not updated in the virtualmin repros.

I cant be the only one who finds this confusing.
https://forum.virtualmin.com/t/webmin-version-2-111-upgrade-button-fails/126024
OK I understand they are different OS. and there can be a delay in package updates as the world rotates. but did we skip a version

1 Like

None of y’all are running it on NetBSD, and this is obviously specific to NetBSD (it is some C code Jamie wrote 20+ years ago specifically for some BSD variants and hasn’t really been touched since), so there’s nothing useful to glean from behavior you see on Linux.

I think that’s actually it, and it looks like it’s as simple as the version going from 9.x to 10.x, and that regex not including 10.x. I don’t understand how that would result in the error OP is seeing, but it does look like the same errors from way back then.

I meant to reply to this comment by stefan1959: Webmin 2.111 throws error on NetBSD 10.0 - #4 by stefan1959

1 Like

@Thiesi , if you change that line in mount/netbsd-lib.pl to the following, does it fix it?

my $cmd = $uname_release =~ /^[3456789]|10\.[0-9]/ ? "netbsd-mounts-3" :
1 Like

It does indeed. Funny it was just the major OS version falling through a RegEx written probably when NetBSD hardly ever changed its major version, making a two-figure major version number seem like something we’d probably never experience during our lifetime.

This PR should fix it for the next Webmin version, and it should handle future NetBSD versions, too. (Still not sure why it needs a custom C command for something so simple, I suspect the C stuff is actually not needed and we could be using already existent tools for gathering this info.)

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.