List for cgit developers and users
 help / color / mirror / Atom feed
From: list at eworm.de (Christian Hesse)
Subject: [PATCH 2/2] cgit: sanitize max-repo-count
Date: Mon,  7 Jan 2019 16:35:35 +0100	[thread overview]
Message-ID: <20190107153535.21620-2-list@eworm.de> (raw)
In-Reply-To: <20190107153535.21620-1-list@eworm.de>

From: Christian Hesse <mail at eworm.de>

Setting max-repo-count to "0" makes cgit loop forever generating page
links. Make this a special value to show all repositories.

Signed-off-by: Christian Hesse <mail at eworm.de>
---
 cgit.c       | 2 +-
 cgitrc.5.txt | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/cgit.c b/cgit.c
index cc953a7..a09e3c7 100644
--- a/cgit.c
+++ b/cgit.c
@@ -241,7 +241,7 @@ static void config_cb(const char *name, const char *value)
 	else if (!strcmp(name, "max-blob-size"))
 		ctx.cfg.max_blob_size = parse_int(value, 0, INT_MAX, 0);
 	else if (!strcmp(name, "max-repo-count"))
-		ctx.cfg.max_repo_count = parse_int(value, 0, INT_MAX, 0);
+		ctx.cfg.max_repo_count = parse_int(value, 0, INT_MAX, INT_MAX);
 	else if (!strcmp(name, "max-commit-count"))
 		ctx.cfg.max_commit_count = parse_int(value, 0, INT_MAX, 0);
 	else if (!strcmp(name, "project-list"))
diff --git a/cgitrc.5.txt b/cgitrc.5.txt
index 34b351b..1731fda 100644
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -269,7 +269,8 @@ max-message-length::
 
 max-repo-count::
 	Specifies the number of entries to list per page on the	repository
-	index page. Default value: "50".
+	index page. The value "0" shows all repositories without limitation.
+	Default value: "50".
 
 max-repodesc-length::
 	Specifies the maximum number of repo description characters to display


  reply	other threads:[~2019-01-07 15:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 14:38 [PATCH 1/1] cgitrc: handle value "0" for max-repo-count list
2018-07-16 14:41 ` list
2018-09-11  6:56   ` list
2018-10-18 22:52     ` Jason
2018-11-23 16:08       ` list
2018-12-07  4:10         ` Jason
2019-01-07 15:34         ` list
2019-01-07 15:35           ` [PATCH 1/2] cgit: introduce parse_{bool, int}() for for cgitrc parsing list
2019-01-07 15:35             ` list [this message]
2019-01-07 20:54             ` list
2019-01-08 14:05             ` whydoubt
2019-01-10 19:23           ` [PATCH 1/1] cgitrc: handle value "0" for max-repo-count tlatorre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190107153535.21620-2-list@eworm.de \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).