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

Softlinks were not getting created properly earlier. --always-softlin… #2813

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rmittal87
Copy link
Contributor

…k option is now fully functional

Change-Id: I21e1c9ac4214065b551272bef788611c91917796

@jonashaag
Copy link
Contributor

Is there a way to test this using a unit test?

@rmittal87
Copy link
Contributor Author

fixes #1429

@rmittal87
Copy link
Contributor Author

@jonashaag .. need to add elfutils in the reipe of micromamba-feedstock recipe for unix. Without that build is failing.

@jonashaag
Copy link
Contributor

Why do we need elfutils to check if a file is executable?

@rmittal87
Copy link
Contributor Author

We are using elf library to check if a file is execulatble or not
Elf* elf = elf_begin(fd, ELF_C_READ, NULL);
if (!elf)
{
LOG_DEBUG << path.string() << " error calling elf_begin";
close(fd);
return false;
}

    Elf_Kind ek = elf_kind(elf);
    if (ek != ELF_K_ELF)
    {
        LOG_DEBUG << path.string() << " not an ELF file";
        close(fd);
        return false;
    }

    Elf64_Ehdr* elfhdr = elf64_getehdr(elf);
    if (!elfhdr)
    {
        LOG_DEBUG << path.string() << " error reading ELF header";
        close(fd);
        return false;
    }
    bool rc = elfhdr->e_type == ET_EXEC;

@jonashaag
Copy link
Contributor

Why not just look at the executable bit or the elf header bytes?

…k option is now fully functional

Change-Id: I21e1c9ac4214065b551272bef788611c91917796
Change-Id: Iab648a8324289b90b3ce5d05409ff64f25b4592d
Change-Id: Iea39f1637a5f42304622bbb9a6d831b2568c16ac
@rmittal87
Copy link
Contributor Author

fixed the crash, added the testcase/ package for which it was crashing. @jonashaag kidnly review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants