Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jun 2011 11:47:20 +0100
From:      Chris Rees <utisoft@gmail.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/157562: [PATCH] Fix port: databases/mysql41-server should use USERS
Message-ID:  <BLU0-SMTP128ED70666BF15859233CD9A97F0@phx.gbl>
Resent-Message-ID: <201106031050.p53Ao2vr050574@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         157562
>Category:       ports
>Synopsis:       [PATCH] Fix port: databases/mysql41-server should use USERS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 03 10:50:01 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Chris Rees
>Release:        FreeBSD 8.2-RELEASE-p1 i386
>Organization:
bayofrum
>Environment:
System: FreeBSD zeus.bayofrum.net 8.2-RELEASE-p1 FreeBSD 8.2-RELEASE-p1 #0: Sat Apr 30 15:09:06 BST 2011 root@zeus.bayofrum.net:/usr/obj/usr/src/sys/ZEUS i386


	
>Description:
	

	This port uses pkg-install to create new users instead of using USERS= and GROUPS=, and also tries to delete users on deinstall without prompting -- this is a problem if another installed port uses that username.
>How-To-Repeat:
	
>Fix:

	

	- Use USERS and GROUPS

	Submitted by: Chris Rees (utisoft@gmail.com)

	Please bear in mind that pkg-install has been removed


--- databases-mysql41-server.patch begins here ---
Index: Makefile
===================================================================
RCS file: /exports/cvsroot-freebsd/ports/databases/mysql41-server/Makefile,v
retrieving revision 1.236
diff -u -r1.236 Makefile
--- Makefile	4 Dec 2010 07:30:48 -0000	1.236
+++ Makefile	2 Jun 2011 12:53:56 -0000
@@ -86,6 +86,9 @@
 
 # MySQL-Server part
 .if !defined(CLIENT_ONLY) && !defined(SCRIPTS_ONLY)
+USERS=		${PORTNAME}
+GROUPS=		${USERS}
+
 USE_MYSQL=	yes
 WANT_MYSQL_VER=	41
 
@@ -141,11 +144,6 @@
 	@${REINPLACE_CMD} -e "s|PTHREAD_SCOPE_SYSTEM|PTHREAD_SCOPE_PROCESS|g" ${WRKSRC}/sql/mysqld.cc
 .endif
 
-post-install:
-.if !defined(PACKAGE_BUILDING)
-	@${SETENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
-.endif
-
 .else
 # MySQL-Client part
 .if defined(CLIENT_ONLY)
Index: pkg-install
===================================================================
RCS file: pkg-install
diff -N pkg-install
--- pkg-install	15 Feb 2005 22:57:02 -0000	1.6
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,36 +0,0 @@
-#!/bin/sh
-
-PATH=/bin:/usr/sbin
-
-case $2 in
-POST-INSTALL)
-	USER=mysql
-	GROUP=${USER}
-	UID=88
-	GID=${UID}
-
-	if pw group show "${GROUP}" 2>/dev/null; then
-		echo "You already have a group \"${GROUP}\", so I will use it."
-	else
-		if pw groupadd ${GROUP} -g ${GID}; then
-			echo "Added group \"${GROUP}\"."
-		else
-			echo "Adding group \"${GROUP}\" failed..."
-			exit 1
-		fi
-	fi
-
-	if pw user show "${USER}" 2>/dev/null; then
-		echo "You already have a user \"${USER}\", so I will use it."
-	else
-		if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-			-d /nonexistent -s /sbin/nologin -c "MySQL Daemon"
-		then
-			echo "Added user \"${USER}\"."
-		else
-			echo "Adding user \"${USER}\" failed..."
-			exit 1
-		fi
-	fi
-	;;
-esac
--- databases-mysql41-server.patch ends here ---



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BLU0-SMTP128ED70666BF15859233CD9A97F0>