1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-28 05:29:48 +00:00

Backport a (modified) patch from Red Hat to allow passing custom directory

for creating new user directories via makeweb(1).
This commit is contained in:
Alexey Dokuchaev 2015-01-18 10:10:44 +00:00
parent 43650faa38
commit 87ccc8ec61
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=377288
3 changed files with 77 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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 */