Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jan 2015 10:10:45 +0000 (UTC)
From:      Alexey Dokuchaev <danfe@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r377288 - in head/www/thttpd: . files
Message-ID:  <201501181010.t0IAAj7g033311@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: danfe
Date: Sun Jan 18 10:10:44 2015
New Revision: 377288
URL: https://svnweb.freebsd.org/changeset/ports/377288
QAT: https://qat.redports.org/buildarchive/r377288/

Log:
  Backport a (modified) patch from Red Hat to allow passing custom directory
  for creating new user directories via makeweb(1).

Added:
  head/www/thttpd/files/patch-extras_makeweb.1   (contents, props changed)
  head/www/thttpd/files/patch-extras_makeweb.c   (contents, props changed)
Modified:
  head/www/thttpd/Makefile

Modified: head/www/thttpd/Makefile
==============================================================================
--- head/www/thttpd/Makefile	Sun Jan 18 09:38:15 2015	(r377287)
+++ head/www/thttpd/Makefile	Sun Jan 18 10:10:44 2015	(r377288)
@@ -30,6 +30,8 @@ post-patch:
 	@${REINPLACE_CMD} -e '/\.htpasswd/!s|htpasswd|thttpdpasswd|g' \
 		${WRKSRC}/${f}
 .endfor
+	@${REINPLACE_CMD} -e 's|/var/www|${WWWDIR}|' \
+		${WRKSRC}/extras/makeweb.1
 	@${MV} ${WRKSRC}/extras/htpasswd.1 ${WRKSRC}/extras/thttpdpasswd.1
 	@${MV} ${WRKSRC}/extras/htpasswd.c ${WRKSRC}/extras/thttpdpasswd.c
 

Added: head/www/thttpd/files/patch-extras_makeweb.1
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/thttpd/files/patch-extras_makeweb.1	Sun Jan 18 10:10:44 2015	(r377288)
@@ -0,0 +1,21 @@
+--- extras/makeweb.1.orig	2005-06-29 17:53:22 UTC
++++ extras/makeweb.1
+@@ -2,11 +2,17 @@
+ .SH NAME
+ makeweb - create user web directory
+ .SH SYNOPSIS
+-.B makeweb
++.B makeweb 
++[\fI -d webdir \fR]
+ .SH DESCRIPTION
+ .PP
+ This program allows users to create their own web subdirectories off
+ of the main web directory.
++.PP
++.TP
++\fB\-d\fR
++Specify the root directory for new user directories. The default directory
++is /var/www
+ .SH "SEE ALSO
+ thttpd(8)
+ .SH AUTHOR

Added: head/www/thttpd/files/patch-extras_makeweb.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/thttpd/files/patch-extras_makeweb.c	Sun Jan 18 10:10:44 2015	(r377288)
@@ -0,0 +1,54 @@
+--- extras/makeweb.c.orig	2005-06-29 17:53:25 UTC
++++ extras/makeweb.c
+@@ -48,6 +48,11 @@
+ 
+ static char* argv0;
+ 
++static void
++usage( void )
++{
++    fprintf( stderr, "usage: %s [-d webdir]\n", argv0 );
++}
+ 
+ static void
+ check_room( int size, int len )
+@@ -126,17 +131,27 @@ main( int argc, char** argv )
+     struct passwd* pwd;
+     char* username;
+     char* homedir;
++    int opts;
+     char dirname[5000];
+     char linkname[5000];
+     char linkbuf[5000];
+     struct stat sb;
+ 
+     argv0 = argv[0];
+-    if ( argc != 1 )
++
++#ifndef TILDE_MAP_2
++    webdir = WEBDIR;
++#endif /* TILDE_MAP_2 */
++
++    if ( (opts = getopt(argc, argv, "d:h")) != -1 )
++    {
++	switch (opts)
+ 	{
+-	(void) fprintf( stderr, "usage:  %s\n", argv0 );
+-	exit( 1 );
++	    case 'd': webdir = strdup(optarg); break;
++	    case 'h':
++	    default: usage(); return 1; break;
+ 	}
++    }
+ 
+     pwd = getpwuid( getuid() );
+     if ( pwd == (struct passwd*) 0 )
+@@ -162,8 +177,6 @@ main( int argc, char** argv )
+ 
+ #else /* TILDE_MAP_2 */
+ 
+-    /* Gather the pieces. */
+-    webdir = WEBDIR;
+ #ifdef TILDE_MAP_1
+     prefix = TILDE_MAP_1;
+ #else /* TILDE_MAP_1 */



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