From owner-svn-ports-all@FreeBSD.ORG Fri Dec 14 22:49:43 2012 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0F9D48B8; Fri, 14 Dec 2012 22:49:43 +0000 (UTC) (envelope-from utisoft@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 109C88FC13; Fri, 14 Dec 2012 22:49:41 +0000 (UTC) Received: by mail-bk0-f54.google.com with SMTP id je9so1945495bkc.13 for ; Fri, 14 Dec 2012 14:49:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=u0bL0ouWfEyFBVFZeiWIeK6USgGEj93OJnrIUq5mWNk=; b=XSpxjddXH6jAe4q/XjB+MJx6Elq0MEhzeV4+av/SkpOf3qhlZ2+T65Gh7XP2C6Xtxu Pq/BOpoFu1seMb0A91NwvYTqrW2pxDRmItPAzJuutqpiNM2JkN79QaK7FOFqVhVDXfQZ lx+isXxTaZH8u8/RyH5OhUTAkeBUv/3FjZidDreBmKYSCQkV1PtqSptAXKa+CnV2biID nyNroahYoNoGJhlsW3sXcYTJnYLpYcjzurUcdcRqY9UOTHSdh0IE76nT/xY0fVH+tg9o qODrmSX88nROboD+kCgHE5oX27sFywwJa4YRpXhCH1viLsCbDSZjSn+ZD+QVbzC/uF5g /xgA== Received: by 10.204.150.137 with SMTP id y9mr3336858bkv.103.1355525375300; Fri, 14 Dec 2012 14:49:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.167.71 with HTTP; Fri, 14 Dec 2012 14:49:05 -0800 (PST) In-Reply-To: References: <201212120208.qBC28YTk039216@svn.freebsd.org> From: Chris Rees Date: Fri, 14 Dec 2012 22:49:05 +0000 Message-ID: Subject: Re: svn commit: r308734 - in head/net/rtpproxy: . files To: Maxim Sobolev Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-ports-head@freebsd.org, svn-ports-all@freebsd.org, "ports-committers@freebsd.org" X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Dec 2012 22:49:43 -0000 On 12 December 2012 07:19, Chris Rees wrote: > > On 12 Dec 2012 02:08, "Maxim Sobolev" wrote: >> >> XXX Ports RC script present >> Author: sobomax >> Date: Wed Dec 12 02:08:33 2012 >> New Revision: 308734 >> URL: http://svnweb.freebsd.org/changeset/ports/308734 >> >> Log: >> Add unprivileged user to run under, so it's more secure. >> >> Reminded by: Olle E. Johansson >> >> Added: >> head/net/rtpproxy/files/ >> head/net/rtpproxy/files/patch-freebsd_rtpproxy.in (contents, props >> changed) >> head/net/rtpproxy/pkg-install (contents, props changed) >> Modified: >> head/net/rtpproxy/Makefile >> >> Modified: head/net/rtpproxy/Makefile >> >> ============================================================================== >> --- head/net/rtpproxy/Makefile Wed Dec 12 02:02:55 2012 (r308733) >> +++ head/net/rtpproxy/Makefile Wed Dec 12 02:08:33 2012 (r308734) >> @@ -7,6 +7,7 @@ >> >> PORTNAME= rtpproxy >> PORTVERSION= 1.2.1 >> +PORTREVISION= 1 >> CATEGORIES= net >> MASTER_SITES= http://www.rtpproxy.org/chrome/site/ >> >> @@ -25,6 +26,9 @@ post-build: >> ${SED} 's|%%PREFIX%%|${PREFIX}|g ; s|%%RC_SUBR%%|/etc/rc.subr|g' \ >> ${WRKSRC}/freebsd/rtpproxy.in > ${WRKDIR}/rtpproxy >> >> +pre-install: >> + @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL >> + >> post-install: >> ${INSTALL_SCRIPT} ${WRKDIR}/rtpproxy ${PREFIX}/etc/rc.d/rtpproxy >> >> >> Added: head/net/rtpproxy/files/patch-freebsd_rtpproxy.in >> >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/net/rtpproxy/files/patch-freebsd_rtpproxy.in Wed Dec 12 >> 02:08:33 2012 (r308734) >> @@ -0,0 +1,17 @@ >> + >> +$FreeBSD$ >> + >> +--- freebsd/rtpproxy.in.orig >> ++++ freebsd/rtpproxy.in >> +@@ -25,7 +25,10 @@ >> + >> + rtpproxy_enable=${rtpproxy_enable:-"NO"} >> + rtpproxy_laddr=${rtpproxy_laddr:-"0.0.0.0"} >> ++rtpproxy_usr=${rtpproxy_usr:-"rtpproxy"} >> ++rtpproxy_grp=${rtpproxy_grp:-"rtpproxy"} >> + >> +-command_args="-l ${rtpproxy_laddr} -p /var/run/rtpproxy.pid" >> ++command_args="-l ${rtpproxy_laddr} -p /var/run/rtpproxy.pid \ >> ++ -u ${rtpproxy_usr}:${rtpproxy_grp}" >> + >> + run_rc_command "${1}" >> >> Added: head/net/rtpproxy/pkg-install >> >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/net/rtpproxy/pkg-install Wed Dec 12 02:08:33 2012 >> (r308734) >> @@ -0,0 +1,35 @@ >> +#!/bin/sh >> +# $FreeBSD$ >> +# >> + >> +if [ "$2" != "PRE-INSTALL" ]; then >> + exit 0 >> +fi >> + >> +RTPPROXY_USER=rtpproxy >> +RTPPROXY_GROUP=${RTPPROXY_USER} >> +RTPPROXY_UID=222 >> +RTPPROXY_GID=${RTPPROXY_UID} >> + >> +if ! pw groupshow "${RTPPROXY_GROUP}" 2>/dev/null 1>&2; then >> + if pw groupadd ${RTPPROXY_GROUP} -g ${RTPPROXY_GID}; then >> + echo "Added group \"${RTPPROXY_GROUP}\"." >> + else >> + echo "Adding group \"${RTPPROXY_GROUP}\" failed..." >> + exit 1 >> + fi >> +fi >> + >> +if ! pw usershow "${RTPPROXY_USER}" 2>/dev/null 1>&2; then >> + if pw useradd ${RTPPROXY_USER} -u ${RTPPROXY_UID} -g >> ${RTPPROXY_GROUP} -h - \ >> + -s "/sbin/nologin" -d "/nonexistent" \ >> + -c "RTP Proxy"; \ >> + then >> + echo "Added user \"${RTPPROXY_USER}\"." >> + else >> + echo "Adding user \"${RTPPROXY_USER}\" failed..." >> + exit 1 >> + fi >> +fi >> + >> +exit 0 > > This is the wrong way to create users; please use the USERS and GROUPS > Makefile variables instead. Mind if I commit this? It also updates the Makefile headers and removes the article from the beginning of COMMENT. http://www.bayofrum.net/~crees/patches/rtpproxy-USERS.diff Out of curiosity, where did you get the pkg-install script from? I thought I'd killed all occurrences of manual user creation; did you write it yourself? Chris