Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAM_USERTYPE_UIDMIN, PAM_USERTYPE_SYSUIDMIN, PAM_USERTYPE_OVERFLOW_UID defaults not set #241

Closed
mijenix opened this issue Jun 15, 2020 · 0 comments

Comments

@mijenix
Copy link

mijenix commented Jun 15, 2020

PAM_USERTYPE_UIDMIN, PAM_USERTYPE_SYSUIDMIN, PAM_USERTYPE_OVERFLOW_UID default values are not set during configure:

...
./configure: 19197: test: x: unexpected operator
./configure: 19212: test: x: unexpected operator
./configure: 19227: test: x: unexpected operator
...

which leads to the following compilation error(s):

pam_setquota.c:178:43: error: expected expression before ',' token
  178 |           .start_uid = PAM_USERTYPE_UIDMIN,

with the following patch or specifying all the configure options --with-uidmin, --with-sysuidmin, --with-kernel-overflow-uid compilation succeeds.

diff --git a/configure.ac b/configure.ac
index c1862ea7..9a506884 100644
--- a/configure.ac
+++ b/configure.ac
@@ -662,19 +662,19 @@ dnl
 dnl Get values for default uid ranges in login.defs used in pam_usertype
 dnl
 AC_ARG_WITH([uidmin], AS_HELP_STRING([--with-uidmin=<number>],[default value for regular user min uid (1000)]), opt_uidmin=$withval)
-if test x"$opt_uidmin" == x; then
+if test x"$opt_uidmin" = x; then
     opt_uidmin=1000
 fi
 AC_DEFINE_UNQUOTED(PAM_USERTYPE_UIDMIN, $opt_uidmin, [Minimum regular user uid.])

 AC_ARG_WITH([sysuidmin], AS_HELP_STRING([--with-sysuidmin=<number>],[default value for system user min uid (101)]), opt_sysuidmin=$withval)
-if test x"$opt_sysuidmin" == x; then
+if test x"$opt_sysuidmin" = x; then
     opt_sysuidmin=101
 fi
 AC_DEFINE_UNQUOTED(PAM_USERTYPE_SYSUIDMIN, $opt_sysuidmin, [Minimum system user uid.])

 AC_ARG_WITH([kerneloverflowuid], AS_HELP_STRING([--with-kernel-overflow-uid=<number>],[kernel overflow uid, default (uint16_t)-2=65534]), opt_kerneloverflowuid=$withval)
-if test x"$opt_kerneloverflowuid" == x; then
+if test x"$opt_kerneloverflowuid" = x; then
     opt_kerneloverflowuid=65534
 fi
 AC_DEFINE_UNQUOTED(PAM_USERTYPE_OVERFLOW_UID, $opt_kerneloverflowuid, [Kernel overflow uid.])
ldv-alt added a commit that referenced this issue Jun 15, 2020
Portable code should not assume that test builtin supports == operator.

* configure.ac (opt_uidmin, opt_sysuidmin, opt_kerneloverflowuid): Fix
initialization.

Resolves: #241
Fixes: 926d793 ("pam_usertype: new module to tell if uid is in login.defs ranges")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant