diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2015-01-19 03:36:37 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2015-01-19 03:36:37 +0000 |
commit | b07c59b04d98cf8bf705434d3469d76ec7a2dc11 (patch) | |
tree | 52fe11806f23d1f78bf678ac3721121870acbeaa | |
parent | d8e1d73265ec67956f2bfba969905efcf02a2037 (diff) | |
download | ports-b07c59b04d98cf8bf705434d3469d76ec7a2dc11.tar.gz ports-b07c59b04d98cf8bf705434d3469d76ec7a2dc11.zip |
- Cleanup patches (rebase from previous version)
- Fix several warnings that were caught by Clang
- Strip installed programs; polish pkg-message text
Notes
Notes:
svn path=/head/; revision=377378
-rw-r--r-- | www/thttpd/files/extra-patch-config.h | 2 | ||||
-rw-r--r-- | www/thttpd/files/patch-Makefile.in | 2 | ||||
-rw-r--r-- | www/thttpd/files/patch-cgi-src_Makefile.in | 10 | ||||
-rw-r--r-- | www/thttpd/files/patch-extras_Makefile.in | 12 | ||||
-rw-r--r-- | www/thttpd/files/patch-extras_htpasswd.c | 16 | ||||
-rw-r--r-- | www/thttpd/files/patch-mmc.c | 27 | ||||
-rw-r--r-- | www/thttpd/files/patch-thttpd.c | 4 | ||||
-rw-r--r-- | www/thttpd/files/pkg-message.in | 4 |
8 files changed, 42 insertions, 35 deletions
diff --git a/www/thttpd/files/extra-patch-config.h b/www/thttpd/files/extra-patch-config.h index c5ab0db452ba..ca8bfdaa28cd 100644 --- a/www/thttpd/files/extra-patch-config.h +++ b/www/thttpd/files/extra-patch-config.h @@ -1,6 +1,6 @@ --- config.h.orig Wed Jun 29 19:53:18 2005 +++ config.h Sun Jun 17 20:05:51 2007 -@@ -395,4 +395,6 @@ +@@ -389,4 +389,6 @@ */ #define MIN_WOULDBLOCK_DELAY 100L diff --git a/www/thttpd/files/patch-Makefile.in b/www/thttpd/files/patch-Makefile.in index 94492c68c966..e18c0e6ba57f 100644 --- a/www/thttpd/files/patch-Makefile.in +++ b/www/thttpd/files/patch-Makefile.in @@ -25,7 +25,7 @@ installthis: -mkdir -p $(DESTDIR)$(BINDIR) - $(INSTALL) -m 555 -o bin -g bin thttpd $(DESTDIR)$(BINDIR) -+ $(INSTALL) -m 555 thttpd $(DESTDIR)$(BINDIR) ++ $(INSTALL) -s -m 555 thttpd $(DESTDIR)$(BINDIR) install-man: -mkdir -p $(DESTDIR)$(MANDIR)/man8 diff --git a/www/thttpd/files/patch-cgi-src_Makefile.in b/www/thttpd/files/patch-cgi-src_Makefile.in index 83f12c2d2150..e27a0d19f22e 100644 --- a/www/thttpd/files/patch-cgi-src_Makefile.in +++ b/www/thttpd/files/patch-cgi-src_Makefile.in @@ -26,15 +26,15 @@ - cp phf $(CGIBINDIR)/phf + -mkdir -p $(DESTDIR)$(CGIBINDIR) + rm -f $(DESTDIR)$(CGIBINDIR)/redirect -+ cp redirect $(DESTDIR)$(CGIBINDIR)/redirect ++ $(INSTALL) -s -m 555 redirect $(DESTDIR)$(CGIBINDIR)/redirect + rm -f $(DESTDIR)$(MANDIR)/man8/redirect.8 -+ cp redirect.8 $(DESTDIR)$(MANDIR)/man8/redirect.8 ++ $(INSTALL) -m 444 redirect.8 $(DESTDIR)$(MANDIR)/man8/redirect.8 + rm -f $(DESTDIR)$(CGIBINDIR)/ssi -+ cp ssi $(DESTDIR)$(CGIBINDIR)/ssi ++ $(INSTALL) -s -m 555 ssi $(DESTDIR)$(CGIBINDIR)/ssi + rm -f $(DESTDIR)$(MANDIR)/man8/ssi.8 -+ cp ssi.8 $(DESTDIR)$(MANDIR)/man8/ssi.8 ++ $(INSTALL) -m 444 ssi.8 $(DESTDIR)$(MANDIR)/man8/ssi.8 + rm -f $(DESTDIR)$(CGIBINDIR)/phf -+ cp phf $(DESTDIR)$(CGIBINDIR)/phf ++ $(INSTALL) -s -m 555 phf $(DESTDIR)$(CGIBINDIR)/phf clean: rm -f $(CLEANFILES) diff --git a/www/thttpd/files/patch-extras_Makefile.in b/www/thttpd/files/patch-extras_Makefile.in index 4791c5c0b74d..be3354953e7c 100644 --- a/www/thttpd/files/patch-extras_Makefile.in +++ b/www/thttpd/files/patch-extras_Makefile.in @@ -26,15 +26,15 @@ - rm -f $(MANDIR)/man8/syslogtocern.8 - cp syslogtocern.8 $(MANDIR)/man8/syslogtocern.8 + rm -f $(DESTDIR)$(BINDIR)/makeweb $(DESTDIR)$(BINDIR)/thtpasswd $(DESTDIR)$(BINDIR)/syslogtocern -+ cp makeweb $(DESTDIR)$(BINDIR)/makeweb -+ cp htpasswd $(DESTDIR)$(BINDIR)/thtpasswd -+ cp syslogtocern $(DESTDIR)$(BINDIR)/syslogtocern ++ $(INSTALL) -s -m 555 makeweb $(DESTDIR)$(BINDIR)/makeweb ++ $(INSTALL) -s -m 555 htpasswd $(DESTDIR)$(BINDIR)/thtpasswd ++ $(INSTALL) -m 555 syslogtocern $(DESTDIR)$(BINDIR)/syslogtocern + rm -f $(DESTDIR)$(MANDIR)/man1/makeweb.1 -+ cp makeweb.1 $(DESTDIR)$(MANDIR)/man1/makeweb.1 ++ $(INSTALL) -m 444 makeweb.1 $(DESTDIR)$(MANDIR)/man1/makeweb.1 + rm -f $(DESTDIR)$(MANDIR)/man1/thtpasswd.1 -+ cp htpasswd.1 $(DESTDIR)$(MANDIR)/man1/thtpasswd.1 ++ $(INSTALL) -m 444 htpasswd.1 $(DESTDIR)$(MANDIR)/man1/thtpasswd.1 + rm -f $(DESTDIR)$(MANDIR)/man8/syslogtocern.8 -+ cp syslogtocern.8 $(DESTDIR)$(MANDIR)/man8/syslogtocern.8 ++ $(INSTALL) -m 444 syslogtocern.8 $(DESTDIR)$(MANDIR)/man8/syslogtocern.8 clean: rm -f $(CLEANFILES) diff --git a/www/thttpd/files/patch-extras_htpasswd.c b/www/thttpd/files/patch-extras_htpasswd.c index 52aa93e0725c..5f63419d5efe 100644 --- a/www/thttpd/files/patch-extras_htpasswd.c +++ b/www/thttpd/files/patch-extras_htpasswd.c @@ -1,6 +1,6 @@ --- extras/htpasswd.c.orig 2001-12-19 00:08:08 UTC +++ extras/htpasswd.c -@@ -21,7 +21,12 @@ extern char *crypt(const char *key, cons +@@ -19,7 +19,12 @@ #define LF 10 #define CR 13 @@ -13,7 +13,7 @@ int tfd; char temp_template[] = "/tmp/htp.XXXXXX"; -@@ -137,8 +142,9 @@ add_password( char* user, FILE* f ) +@@ -135,8 +140,9 @@ add_password( char* user, FILE* f ) } static void usage(void) { @@ -25,7 +25,7 @@ exit(1); } -@@ -151,51 +157,131 @@ void interrupted(int signo) { +@@ -149,51 +155,128 @@ void interrupted(int signo) { int main(int argc, char *argv[]) { FILE *tfp,*f; char user[MAX_STRING_LEN]; @@ -35,7 +35,7 @@ + char line[MAX_LINE_LEN]; + char l[MAX_LINE_LEN]; char w[MAX_STRING_LEN]; - char command[MAX_STRING_LEN]; +- char command[MAX_STRING_LEN]; - int found; + int found,u; @@ -80,8 +80,7 @@ + exit(1); + } + if (strlen(argv[3]) > (sizeof(user) - 1)) { -+ fprintf(stderr, "%s: username is too long\n", argv[0], -+ sizeof(user) - 1); ++ fprintf(stderr, "%s: username is too long\n", argv[0]); + exit(1); + } + if ((strchr(argv[3], ':')) != NULL) { @@ -109,8 +108,7 @@ + exit(1); + } + if (strlen(argv[2]) > (sizeof(user) - 1)) { -+ fprintf(stderr, "%s: username is too long\n", argv[0], -+ sizeof(user) - 1); ++ fprintf(stderr, "%s: username is too long\n", argv[0]); + exit(1); + } + if ((strchr(argv[2], ':')) != NULL) { @@ -168,7 +166,7 @@ if(strcmp(user,w)) { putline(tfp,line); continue; -@@ -210,10 +296,28 @@ int main(int argc, char *argv[]) { +@@ -208,10 +291,28 @@ int main(int argc, char *argv[]) { printf("Adding user %s\n",user); add_password(user,tfp); } diff --git a/www/thttpd/files/patch-mmc.c b/www/thttpd/files/patch-mmc.c index c992a3250844..70f29a968ec6 100644 --- a/www/thttpd/files/patch-mmc.c +++ b/www/thttpd/files/patch-mmc.c @@ -1,7 +1,7 @@ --- mmc.c.orig Tue Oct 22 09:42:01 2002 +++ mmc.c Fri Nov 14 12:26:39 2003 -@@ -74,6 +74,9 @@ - time_t ctime; +@@ -83,6 +83,9 @@ + time_t ct; int refcount; time_t reftime; +#ifdef USE_SENDFILE @@ -10,7 +10,7 @@ void* addr; unsigned int hash; int hash_idx; -@@ -140,7 +143,11 @@ +@@ -149,7 +152,11 @@ /* Yep. Just return the existing map */ ++m->refcount; m->reftime = now; @@ -22,7 +22,7 @@ } /* Open the file. */ -@@ -186,7 +193,9 @@ +@@ -195,7 +202,9 @@ else { size_t size_size = (size_t) m->size; /* loses on files >2GB */ @@ -33,7 +33,7 @@ /* Map the file into memory. */ m->addr = mmap( 0, size_size, PROT_READ, MAP_PRIVATE, fd, 0 ); if ( m->addr == (void*) -1 && errno == ENOMEM ) -@@ -234,8 +243,9 @@ +@@ -243,8 +252,9 @@ } #endif /* HAVE_MMAP */ } @@ -44,7 +44,7 @@ /* Put the Map into the hash table. */ if ( add_hash( m ) < 0 ) { -@@ -253,8 +263,12 @@ +@@ -262,8 +272,12 @@ /* Update the total byte count. */ mapped_bytes += m->size; @@ -57,7 +57,7 @@ } -@@ -267,14 +281,18 @@ +@@ -276,14 +290,18 @@ if ( sbP != (struct stat*) 0 ) { m = find_hash( sbP->st_ino, sbP->st_dev, sbP->st_size, sbP->st_ctime ); @@ -76,14 +76,23 @@ if ( m == (Map*) 0 ) syslog( LOG_ERR, "mmc_unmap failed to find entry!" ); else if ( m->refcount <= 0 ) -@@ -363,7 +381,9 @@ +@@ -372,7 +390,9 @@ m = *mm; if ( m->size != 0 ) { -#ifdef HAVE_MMAP +#ifdef USE_SENDFILE -+ close(m->fd); ++ close(m->fd); +#elif defined(HAVE_MMAP) if ( munmap( m->addr, m->size ) < 0 ) syslog( LOG_ERR, "munmap - %m" ); #else /* HAVE_MMAP */ +@@ -523,7 +543,7 @@ + mmc_logstats( long secs ) + { + syslog( +- LOG_INFO, " map cache - %d allocated, %d active (%lld bytes), %d free; hash size: %d; expire age: %ld", ++ LOG_INFO, " map cache - %d allocated, %d active (%lld bytes), %d free; hash size: %d; expire age: %d", + alloc_count, map_count, (long long) mapped_bytes, free_count, hash_size, + expire_age ); + if ( map_count + free_count != alloc_count ) diff --git a/www/thttpd/files/patch-thttpd.c b/www/thttpd/files/patch-thttpd.c index d8300c239193..a7a0a5347d82 100644 --- a/www/thttpd/files/patch-thttpd.c +++ b/www/thttpd/files/patch-thttpd.c @@ -51,7 +51,7 @@ + sz = sbytes > 0 ? sbytes : -1; + else if (sz == 0) + sz = sbytes; -+#else ++#else sz = write( hc->conn_fd, &(hc->file_address[c->next_byte_index]), MIN( c->end_byte_index - c->next_byte_index, max_bytes ) ); @@ -78,7 +78,7 @@ + sz = sbytes > 0 ? sbytes : -1; + else if (sz == 0) + sz = sbytes; -+#else ++#else /* Yes. We'll combine headers and file into a single writev(), ** hoping that this generates a single packet. */ diff --git a/www/thttpd/files/pkg-message.in b/www/thttpd/files/pkg-message.in index 7662341373bc..ebff38be110e 100644 --- a/www/thttpd/files/pkg-message.in +++ b/www/thttpd/files/pkg-message.in @@ -2,9 +2,9 @@ If you want users to be able to create their own Web subdirectories off of the main web directory, you need to: - 1. Add a group for www admins (e.g., "%%WWWGRP%%") + 1. Add a group for www admins (or use "%%WWWGRP%%") 2. chgrp thatgroup %%PREFIX%%/bin/makeweb %%WWWDIR%% - 3. chmod 2755 %%PREFIX%%/bin/makeweb + 3. chmod g+sx %%PREFIX%%/bin/makeweb 4. Tell users about makeweb(1) See http://www.acme.com/software/thttpd/notes.html for more |