Merge pull request #243 from Daniel-Abrecht/master

The check for getpwnam wrongly succeeded on some systems
libnfs-4.0.0-vitalif
Ronnie Sahlberg 2018-04-08 17:04:39 +10:00 committed by GitHub
commit 61584229d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -82,7 +82,10 @@ else
fi
AC_MSG_CHECKING(whether getpwnam() is available)
AC_TRY_COMPILE([#include <sys/types.h>, #include <pwd.h>], [
AC_TRY_COMPILE([
#include <sys/types.h>
#include <pwd.h>
], [
struct passwd *pwd = getpwnam("nobody");
], ac_cv_have_getpwnam=yes, ac_cv_have_getpwnam=no)
if test "$ac_cv_have_getpwnam" = yes ; then

View File

@ -423,6 +423,8 @@ nfs_get_ugid(struct nfs_context *nfs, const char *buf, int slen, int is_user)
return pwd->pw_gid;
}
}
#else
(void) name; // Let the compiler know that this variable is intentionally unused, build would fail with -Werror=unused-variable otherwise
#endif
return 65534;
}