Re: pg_walsummary, Character-not-present-in-option

2024-09-30 Thread btsugieyuusuke

I forgot to attach the patch file, so I'm attaching it in reply.


2024-09-30 15:02 に btsugieyuusuke さんは書きました:

Hi hackers,
I found probably something to fix in pg_walsummary.

pg_walsummary specifies “f:iqw:” as the third argument of 
getopt_long().



/* process command-line options */
while ((c = getopt_long(argc, argv, "f:iqw:",
long_options, &optindex)) != -1)


However, only i and q are valid options.


switch (c)
{
case 'i':
break;
case 'q':
opt.quiet = true;
break;
default:
/* getopt_long already emitted a complaint */
			pg_log_error_hint("Try \"%s --help\" for more information.", 
progname);

exit(1);
}


Therefore, shouldn't “f:” and “w:” be removed?

Best regards,
Yusuke Sugie
From 7ced18bad958156a18bab6b6a9abe554fb44f970 Mon Sep 17 00:00:00 2001
From: Yuusuke Sugie 
Date: Fri, 27 Sep 2024 17:06:10 +0900
Subject: [PATCH] Character not present in option

---
 src/bin/pg_walsummary/pg_walsummary.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/bin/pg_walsummary/pg_walsummary.c b/src/bin/pg_walsummary/pg_walsummary.c
index 93f6e6d408..f6a262d318 100644
--- a/src/bin/pg_walsummary/pg_walsummary.c
+++ b/src/bin/pg_walsummary/pg_walsummary.c
@@ -71,7 +71,7 @@ main(int argc, char *argv[])
 	handle_help_version_opts(argc, argv, progname, help);
 
 	/* process command-line options */
-	while ((c = getopt_long(argc, argv, "f:iqw:",
+	while ((c = getopt_long(argc, argv, "iq",
 			long_options, &optindex)) != -1)
 	{
 		switch (c)
-- 
2.40.1



pg_walsummary, Character-not-present-in-option

2024-09-29 Thread btsugieyuusuke

Hi hackers,
I found probably something to fix in pg_walsummary.

pg_walsummary specifies “f:iqw:” as the third argument of getopt_long().


/* process command-line options */
while ((c = getopt_long(argc, argv, "f:iqw:",
long_options, &optindex)) != -1)


However, only i and q are valid options.


switch (c)
{
case 'i':
break;
case 'q':
opt.quiet = true;
break;
default:
/* getopt_long already emitted a complaint */
			pg_log_error_hint("Try \"%s --help\" for more information.", 
progname);

exit(1);
}


Therefore, shouldn't “f:” and “w:” be removed?

Best regards,
Yusuke Sugie




ACL_MAINTAIN, Lack of comment content

2024-09-30 Thread btsugieyuusuke

Hi hackers,
I found a flaw in the ACL_MAINTAIN comment.

Commands such as VACUUM are listed as commands that are allowed to be 
executed by the MAINTAIN privilege.

However, LOCK TABLE is missing from the comment.


/*
	 * Check if ACL_MAINTAIN is being checked and, if so, and not already 
set

 * as part of the result, then check if the user is a member of the
 * pg_maintain role, which allows VACUUM, ANALYZE, CLUSTER, REFRESH
 * MATERIALIZED VIEW, and REINDEX on all relations.
 */


Therefore, shouldn't LOCK TABLE be added to the comment?

Best regards,
Yusuke Sugie