Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deduplicate PATH entries that are symlinks resolving to other PATH entries #547

Merged
merged 3 commits into from
Dec 11, 2020

Conversation

DimCitus
Copy link
Collaborator

@DimCitus DimCitus commented Dec 9, 2020

In recent debian releases /bin is a symlink to /usr/bin, which means we're
going to find pg_config twice on that system. But it's twice the same entry,
and we can deduplicate and realize we only have one entry actually.

Fixes #545

@DimCitus DimCitus added the bug Something isn't working label Dec 9, 2020
@DimCitus DimCitus added this to the Sprint 2020 W52 2021 W2 milestone Dec 9, 2020
@DimCitus DimCitus requested a review from JelteF December 9, 2020 13:38
@DimCitus DimCitus self-assigned this Dec 9, 2020
src/bin/pg_autoctl/file_utils.c Outdated Show resolved Hide resolved
src/bin/pg_autoctl/file_utils.c Outdated Show resolved Hide resolved
src/bin/pg_autoctl/pgctl.c Show resolved Hide resolved
@JelteF
Copy link
Contributor

JelteF commented Dec 9, 2020

There's this warning in travis:

/file_utils.Po -o file_utils.o file_utils.c

In file included from /usr/include/stdlib.h:1020:0,

                 from /usr/include/postgresql/10/server/c.h:82,

                 from /usr/include/postgresql/10/server/postgres_fe.h:25,

                 from file_utils.c:18:

In function ‘realpath’,

    inlined from ‘search_path_deduplicate_symlinks’ at file_utils.c:620:7:

/usr/include/x86_64-linux-gnu/bits/stdlib.h:43:9: warning: call to ‘__realpath_chk_warn’ declared with attribute warning: second argument of realpath must be either NULL or at least PATH_MAX bytes long buffer

  return __realpath_chk_warn (__name, __resolved, __bos (__resolved));

         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Also, all of the tests are failing (possibly because of the same thing).

…tries.

In recent debian releases /bin is a symlink to /usr/bin, which means we're
going to find pg_config twice on that system. But it's twice the same entry,
and we can deduplicate and realize we only have one entry actually.
@DimCitus
Copy link
Collaborator Author

DimCitus commented Dec 9, 2020

There's this warning in travis:

Ah yeah, realpath requires PATH_MAX. Fixed now, thanks for pointing it to me!

@DimCitus DimCitus requested a review from JelteF December 10, 2020 15:05
@DimCitus DimCitus merged commit 2143009 into master Dec 11, 2020
@DimCitus DimCitus deleted the fix/dedup-symlinks-in-path branch December 11, 2020 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Install Failure -- Ubuntu 20.04 + pg_auto_failover 1.4
2 participants