cvsserver: Add some useful commandline options

Make git-cvsserver understand some options inspired by
git-daemon, namely --base-path, --export-all, --strict-paths.

Also allow the caller to specify a whitelist of allowed
directories, again similar to git-daemon.

While already adding option parsing also support the common
--help and --version options.

Rationale:

While the gitcvs.enabled configuration option already
offers means to limit git-cvsserver access to a repository,
there are some use cases where other methods of access
control prove to be more useful.

E.g. if setting up a pserver for a collection of public
repositories one might want limit the exported repositories
to exactly the directory this collection is located whithout
having to worry about other repositories that might lie around
with the configuration variable set (never trust your users ;)

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
3 files changed
tree: dd3a0b2185f8099ac72b0a057b1d6d94cda4d47e
  1. arm/
  2. compat/
  3. contrib/
  4. Documentation/
  5. git-gui/
  6. gitweb/
  7. mozilla-sha1/
  8. perl/
  9. ppc/
  10. t/
  11. templates/
  12. xdiff/
  13. .gitignore
  14. .mailmap
  15. alloc.c
  16. archive-tar.c
  17. archive-zip.c
  18. archive.h
  19. attr.c
  20. attr.h
  21. base85.c
  22. blob.c
  23. blob.h
  24. builtin-add.c
  25. builtin-annotate.c
  26. builtin-apply.c
  27. builtin-archive.c
  28. builtin-blame.c
  29. builtin-branch.c
  30. builtin-bundle.c
  31. builtin-cat-file.c
  32. builtin-check-attr.c
  33. builtin-check-ref-format.c
  34. builtin-checkout-index.c
  35. builtin-commit-tree.c
  36. builtin-config.c
  37. builtin-count-objects.c
  38. builtin-describe.c
  39. builtin-diff-files.c
  40. builtin-diff-index.c
  41. builtin-diff-tree.c
  42. builtin-diff.c
  43. builtin-fetch--tool.c
  44. builtin-fmt-merge-msg.c
  45. builtin-for-each-ref.c
  46. builtin-fsck.c
  47. builtin-gc.c
  48. builtin-grep.c
  49. builtin-init-db.c
  50. builtin-log.c
  51. builtin-ls-files.c
  52. builtin-ls-tree.c
  53. builtin-mailinfo.c
  54. builtin-mailsplit.c
  55. builtin-merge-base.c
  56. builtin-merge-file.c
  57. builtin-mv.c
  58. builtin-name-rev.c
  59. builtin-pack-objects.c
  60. builtin-pack-refs.c
  61. builtin-prune-packed.c
  62. builtin-prune.c
  63. builtin-push.c
  64. builtin-read-tree.c
  65. builtin-reflog.c
  66. builtin-rerere.c
  67. builtin-rev-list.c
  68. builtin-rev-parse.c
  69. builtin-revert.c
  70. builtin-rm.c
  71. builtin-runstatus.c
  72. builtin-shortlog.c
  73. builtin-show-branch.c
  74. builtin-show-ref.c
  75. builtin-stripspace.c
  76. builtin-symbolic-ref.c
  77. builtin-tar-tree.c
  78. builtin-unpack-objects.c
  79. builtin-update-index.c
  80. builtin-update-ref.c
  81. builtin-upload-archive.c
  82. builtin-verify-pack.c
  83. builtin-write-tree.c
  84. builtin.h
  85. cache-tree.c
  86. cache-tree.h
  87. cache.h
  88. check-builtins.sh
  89. check-racy.c
  90. color.c
  91. color.h
  92. combine-diff.c
  93. commit.c
  94. commit.h
  95. config.c
  96. config.mak.in
  97. configure.ac
  98. connect.c
  99. convert-objects.c
  100. convert.c
  101. copy.c
  102. COPYING
  103. csum-file.c
  104. csum-file.h
  105. ctype.c
  106. daemon.c
  107. date.c
  108. decorate.c
  109. decorate.h
  110. delta.h
  111. diff-delta.c
  112. diff-lib.c
  113. diff.c
  114. diff.h
  115. diffcore-break.c
  116. diffcore-delta.c
  117. diffcore-order.c
  118. diffcore-pickaxe.c
  119. diffcore-rename.c
  120. diffcore.h
  121. dir.c
  122. dir.h
  123. dump-cache-tree.c
  124. entry.c
  125. environment.c
  126. exec_cmd.c
  127. exec_cmd.h
  128. fast-import.c
  129. fetch-pack.c
  130. fetch.c
  131. fetch.h
  132. generate-cmdlist.sh
  133. git-add--interactive.perl
  134. git-am.sh
  135. git-archimport.perl
  136. git-bisect.sh
  137. git-checkout.sh
  138. git-clean.sh
  139. git-clone.sh
  140. git-commit.sh
  141. git-compat-util.h
  142. git-cvsexportcommit.perl
  143. git-cvsimport.perl
  144. git-cvsserver.perl
  145. git-fetch.sh
  146. git-instaweb.sh
  147. git-lost-found.sh
  148. git-ls-remote.sh
  149. git-merge-octopus.sh
  150. git-merge-one-file.sh
  151. git-merge-ours.sh
  152. git-merge-resolve.sh
  153. git-merge-stupid.sh
  154. git-merge.sh
  155. git-mergetool.sh
  156. git-p4import.py
  157. git-parse-remote.sh
  158. git-pull.sh
  159. git-quiltimport.sh
  160. git-rebase.sh
  161. git-relink.perl
  162. git-remote.perl
  163. git-repack.sh
  164. git-request-pull.sh
  165. git-reset.sh
  166. git-send-email.perl
  167. git-sh-setup.sh
  168. git-submodule.sh
  169. git-svn.perl
  170. git-svnimport.perl
  171. git-tag.sh
  172. git-verify-tag.sh
  173. GIT-VERSION-GEN
  174. git.c
  175. git.spec.in
  176. gitk
  177. grep.c
  178. grep.h
  179. hash-object.c
  180. help.c
  181. http-fetch.c
  182. http-push.c
  183. http.c
  184. http.h
  185. ident.c
  186. imap-send.c
  187. index-pack.c
  188. INSTALL
  189. interpolate.c
  190. interpolate.h
  191. list-objects.c
  192. list-objects.h
  193. local-fetch.c
  194. lockfile.c
  195. log-tree.c
  196. log-tree.h
  197. mailmap.c
  198. mailmap.h
  199. Makefile
  200. match-trees.c
  201. merge-file.c
  202. merge-index.c
  203. merge-recursive.c
  204. merge-tree.c
  205. mktag.c
  206. mktree.c
  207. object-refs.c
  208. object.c
  209. object.h
  210. pack-check.c
  211. pack-redundant.c
  212. pack-write.c
  213. pack.h
  214. pager.c
  215. patch-delta.c
  216. patch-id.c
  217. patch-ids.c
  218. patch-ids.h
  219. path-list.c
  220. path-list.h
  221. path.c
  222. peek-remote.c
  223. pkt-line.c
  224. pkt-line.h
  225. progress.c
  226. progress.h
  227. quote.c
  228. quote.h
  229. reachable.c
  230. reachable.h
  231. read-cache.c
  232. README
  233. receive-pack.c
  234. reflog-walk.c
  235. reflog-walk.h
  236. refs.c
  237. refs.h
  238. remote.c
  239. remote.h
  240. revision.c
  241. revision.h
  242. rsh.c
  243. rsh.h
  244. run-command.c
  245. run-command.h
  246. send-pack.c
  247. server-info.c
  248. setup.c
  249. sha1_file.c
  250. sha1_name.c
  251. shallow.c
  252. shell.c
  253. show-index.c
  254. sideband.c
  255. sideband.h
  256. ssh-fetch.c
  257. ssh-pull.c
  258. ssh-push.c
  259. ssh-upload.c
  260. strbuf.c
  261. strbuf.h
  262. symlinks.c
  263. tag.c
  264. tag.h
  265. tar.h
  266. test-chmtime.c
  267. test-date.c
  268. test-delta.c
  269. test-genrandom.c
  270. test-match-trees.c
  271. test-sha1.c
  272. test-sha1.sh
  273. trace.c
  274. tree-diff.c
  275. tree-walk.c
  276. tree-walk.h
  277. tree.c
  278. tree.h
  279. unpack-file.c
  280. unpack-trees.c
  281. unpack-trees.h
  282. update-server-info.c
  283. upload-pack.c
  284. usage.c
  285. utf8.c
  286. utf8.h
  287. var.c
  288. write_or_die.c
  289. wt-status.c
  290. wt-status.h
  291. xdiff-interface.c
  292. xdiff-interface.h