From owner-freebsd-ports-bugs@freebsd.org Sun Jun 7 13:57:09 2020 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 591A032C549 for ; Sun, 7 Jun 2020 13:57:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 49fycP1nYGz3YsP for ; Sun, 7 Jun 2020 13:57:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 3B20932C548; Sun, 7 Jun 2020 13:57:09 +0000 (UTC) Delivered-To: ports-bugs@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3AE4F32C89D for ; Sun, 7 Jun 2020 13:57:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49fycP0nhSz3Ypy for ; Sun, 7 Jun 2020 13:57:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16C4B146B4 for ; Sun, 7 Jun 2020 13:57:09 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 057Dv8MI044333 for ; Sun, 7 Jun 2020 13:57:08 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 057Dv89a044332 for ports-bugs@FreeBSD.org; Sun, 7 Jun 2020 13:57:08 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 244530] print/cups-pdf backend segmentation fault upon upgrade to revision r527186 Date: Sun, 07 Jun 2020 13:57:06 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: taras.filatov@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 07 Jun 2020 13:57:09 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D244530 taras.filatov@gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |taras.filatov@gmail.com --- Comment #5 from taras.filatov@gmail.com --- about cups-pdf version 3.0.0 cups-pdf crashes at code group=3Dgetgrnam(Conf_Grp); grpstat=3Dsetgid(group->gr_gid); while setting new gid for own process. Conf_Grp is NULL. this is because conf file assumed /etc/cups/cups-pdf.conf and cannot be ope= ned. And at this stage nothing can be logged (previous function read_config_file(filename); tries to do log_even, but log file still not open...) And this is because of mistake in Makefile: in pdf-conf.h now contains /* location of the configuration file */ #define CP_CONFIG_PATH "/usr/local/etc/cups" but current Makefile tries to correct this: post-configure: @${REINPLACE_CMD} ${_SUBST_CMD} ${WRKSRC}/extra/cups-pdf.conf @${REINPLACE_CMD} -e \ 's,CPCONFIG "/etc/cups/cups-pdf.conf",CPCONFIG "${ETCDIR}/cups-pdf.conf",' \ ${WRKSRC}/src/cups-pdf.h So solution: 1) Makefile should be corrected like this: --- Makefile.orig 2020-06-07 15:42:18.182963000 +0300 +++ Makefile 2020-06-07 16:50:19.899876000 +0300 @@ -78,7 +78,7 @@ post-configure: @${REINPLACE_CMD} ${_SUBST_CMD} ${WRKSRC}/extra/cups-pdf.conf @${REINPLACE_CMD} -e \ - 's,CPCONFIG "/etc/cups/cups-pdf.conf",CPCONFIG "${ETCDIR}/cups-pdf.conf",' \ + 's,\#define CP_CONFIG_PATH "/etc/cups",\#define CP_CONFIG_P= ATH "${ETCDIR}",' \ ${WRKSRC}/src/cups-pdf.h do-build: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~` 2) if your ever edit cups-pdf.conf and set Grp to nonexistent group, e.g. l= p, cups-pdf will crash silently. So I propose add some code to tell about it to stderr: --- src/cups-pdf.c.orig 2017-02-24 18:32:46.767977798 +0200 +++ src/cups-pdf.c 2020-06-07 16:18:14.701263000 +0300 @@ -374,7 +374,13 @@ (void) umask(0077); group=3Dgetgrnam(Conf_Grp); + if (group !=3D NULL) grpstat=3Dsetgid(group->gr_gid); + else { + fprintf(stderr,"Get group data (getgrnam) failed! group name was %s\n",Conf_Grp); + fprintf(stderr,"GID of process not changed!\n"); + return 1; + } if (strlen(Conf_Log)) { if (stat(Conf_Log, &fstatus) || !S_ISDIR(fstatus.st_mode)) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ put this in file like patch-group_cups-pdf.c and put it inf folder files/ (create int port's folder). --=20 You are receiving this mail because: You are the assignee for the bug.=