Dead code in adminpack

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Dead code in adminpack

Antonin Houska-2
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


adminpack_dead_code.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dead code in adminpack

Julien Rouhaud
On Thu, Feb 13, 2020 at 12:14 PM Antonin Houska <[hidden email]> 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.


Reply | Threaded
Open this post in threaded view
|

Re: Dead code in adminpack

Michael Paquier-2
In reply to this post by Antonin Houska-2
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

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dead code in adminpack

Michael Paquier-2
In reply to this post by Julien Rouhaud
On Thu, Feb 13, 2020 at 12:41:46PM +0100, Julien Rouhaud wrote:
> On Thu, Feb 13, 2020 at 12:14 PM Antonin Houska <[hidden email]> 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

signature.asc (849 bytes) Download Attachment