Dead code in adminpack

Started by Antonin Houskaabout 6 years ago4 messageshackers
Jump to latest
#1Antonin Houska
ah@cybertec.at

I've noticed that convert_and_check_filename() is always passed false for the
"logAllowed" argument - someone probably forgot to remove the argument when it
was decided that log files are no longer accepted. If the argument was removed,
the function would become a bit simpler, see the patch.

--
Antonin Houska
Web: https://www.cybertec-postgresql.com

Attachments:

adminpack_dead_code.patchtext/x-diffDownload+10-12
#2Julien Rouhaud
rjuju123@gmail.com
In reply to: Antonin Houska (#1)
Re: Dead code in adminpack

On Thu, Feb 13, 2020 at 12:14 PM Antonin Houska <ah@cybertec.at> wrote:

I've noticed that convert_and_check_filename() is always passed false for the
"logAllowed" argument - someone probably forgot to remove the argument when it
was decided that log files are no longer accepted. If the argument was removed,
the function would become a bit simpler, see the patch.

Indeed, and actually I don't see when this codepath was reachable.

Patch LGTM.

#3Michael Paquier
michael@paquier.xyz
In reply to: Antonin Houska (#1)
Re: Dead code in adminpack

On Thu, Feb 13, 2020 at 12:15:39PM +0100, Antonin Houska wrote:

I've noticed that convert_and_check_filename() is always passed false for the
"logAllowed" argument - someone probably forgot to remove the argument when it
was decided that log files are no longer accepted. If the argument was removed,
the function would become a bit simpler, see the patch.

This routine was originally named absClusterPath(), but even at its
origin point (fe59e56) this argument has never been used. So no
objections to clean up that.
--
Michael

#4Michael Paquier
michael@paquier.xyz
In reply to: Julien Rouhaud (#2)
Re: Dead code in adminpack

On Thu, Feb 13, 2020 at 12:41:46PM +0100, Julien Rouhaud wrote:

On Thu, Feb 13, 2020 at 12:14 PM Antonin Houska <ah@cybertec.at> wrote:

I've noticed that convert_and_check_filename() is always passed false for the
"logAllowed" argument - someone probably forgot to remove the argument when it
was decided that log files are no longer accepted. If the argument was removed,
the function would become a bit simpler, see the patch.

Indeed, and actually I don't see when this codepath was reachable.

Patch LGTM.

Thanks, applied.
--
Michael