diff options
author | danfe <danfe@FreeBSD.org> | 2015-01-18 18:10:44 +0800 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2015-01-18 18:10:44 +0800 |
commit | 578fc5f5443ba81c732cc83be82d64a6dc6e1e3c (patch) | |
tree | 86a9d1592e3d78832efbdb159515e0b86f01402c /www | |
parent | 9e1fd4261b80ae1a08b5cb6bb0f30ca48a3efd1f (diff) | |
download | freebsd-ports-gnome-578fc5f5443ba81c732cc83be82d64a6dc6e1e3c.tar.gz freebsd-ports-gnome-578fc5f5443ba81c732cc83be82d64a6dc6e1e3c.tar.zst freebsd-ports-gnome-578fc5f5443ba81c732cc83be82d64a6dc6e1e3c.zip |
Backport a (modified) patch from Red Hat to allow passing custom directory
for creating new user directories via makeweb(1).
Diffstat (limited to 'www')
-rw-r--r-- | www/thttpd/Makefile | 2 | ||||
-rw-r--r-- | www/thttpd/files/patch-extras_makeweb.1 | 21 | ||||
-rw-r--r-- | www/thttpd/files/patch-extras_makeweb.c | 54 |
3 files changed, 77 insertions, 0 deletions
diff --git a/www/thttpd/Makefile b/www/thttpd/Makefile index 441f7ff0bf18..d13a93e2673c 100644 --- a/www/thttpd/Makefile +++ b/www/thttpd/Makefile @@ -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 diff --git a/www/thttpd/files/patch-extras_makeweb.1 b/www/thttpd/files/patch-extras_makeweb.1 new file mode 100644 index 000000000000..c9aee52ff7e3 --- /dev/null +++ b/www/thttpd/files/patch-extras_makeweb.1 @@ -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 diff --git a/www/thttpd/files/patch-extras_makeweb.c b/www/thttpd/files/patch-extras_makeweb.c new file mode 100644 index 000000000000..9b5376d3f922 --- /dev/null +++ b/www/thttpd/files/patch-extras_makeweb.c @@ -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 */ |