Bug#853502: libpam-chroot: ftbfs with GCC-7

2018-01-10 Thread Jason Duerstock
Package: libpam-chroot
Followup-For: Bug #853502

Dear Maintainer,

Attached please find a patch that fixes this bug.  It also addresses #754322.

Thanks,

Jason


-- System Information:
Debian Release: buster/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: ia64

Kernel: Linux 3.14-0.bpo.2-mckinley (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
--- libpam-chroot-0.9/pam_chroot.c  2018-01-10 14:20:17.0 +
+++ libpam-chroot-0.9-fixed/pam_chroot.c2018-01-10 14:05:39.275066056 
+
@@ -187,7 +187,7 @@
char **uptr;
 
if(NULL == user || NULL == ngrps) { return -1; }
-   if(0 > *ngrps || 0 > gid) { return -1; }
+   if(0 > *ngrps) { return -1; }
 
if(gcount < *ngrps) {
if(NULL != grps) { grps[gcount] = gid; }
@@ -870,7 +870,7 @@
break;
 
default:
-   if(opts.flags * _PAM_OPTS_DEBUG) {
+   if(opts.flags & _PAM_OPTS_DEBUG) {
_pam_log(LOG_NOTICE, "%s: returning failure", 
opts.module);
}
err = PAM_SESSION_ERR;


Bug#853502: libpam-chroot: ftbfs with GCC-7

2017-12-19 Thread Juhani Numminen
Control: tags -1 patch

On Tue, 31 Jan 2017 09:33:05 + Matthias Klose  wrote:

> pam_chroot.c:873:18: error: '*' in boolean context, suggest '&&' instead 
> [-Werror=int-in-bool-context]
> if(opts.flags * _PAM_OPTS_DEBUG) {

That is most likely a typo since everywhere else in the file it is
opts.flags & _PAM_OPTS_DEBUG (bitwise-AND &, not multiplication *).
Patch attached; tested on amd64 and i386 cowbuilder chroots.


Juhani
diff -u libpam-chroot-0.9/pam_chroot.c libpam-chroot-0.9/pam_chroot.c
--- libpam-chroot-0.9/pam_chroot.c
+++ libpam-chroot-0.9/pam_chroot.c
@@ -870,7 +870,7 @@
 			break;
 
 		default:
-			if(opts.flags * _PAM_OPTS_DEBUG) {
+			if(opts.flags & _PAM_OPTS_DEBUG) {
 _pam_log(LOG_NOTICE, "%s: returning failure", opts.module);
 			}
 			err = PAM_SESSION_ERR;