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

libsubid/api.c: make Prog not static #466

Closed

Conversation

hallyn
Copy link
Member

@hallyn hallyn commented Dec 21, 2021

Closes #465

It'll be used by libmisc/ etc.

Signed-off-by: Serge Hallyn [email protected]

@hallyn
Copy link
Member Author

hallyn commented Dec 21, 2021

With this:

ubuntu@shadow:~/shadow$ cat test.c
#include <shadow/subid.h>
#include <stdlib.h>

int main() {
        struct subid_range *ranges = NULL;
        subid_init("test", NULL);
        int i, n;
#if SUBID_ABI_MAJOR >= 4
        n = subid_get_uid_ranges("root", &ranges);
#else
        n = get_subuid_ranges("root", &ranges);
#endif
        for (i = 0; i < n; i++)
                printf("%d: %ld - %ld\n", i, ranges[i].start, ranges[i].count);

        free(ranges);
        return 0;
}
ubuntu@shadow:~/shadow$ gcc -o test test.c -lsubid
ubuntu@shadow:~/shadow$ ./test
0: 200000 - 65536

(I really need to get the CI tests working again)

Copy link
Collaborator

@ikerexxe ikerexxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in api.c look good to me, but I'm worried about the configuration changes.

autogen.sh Outdated Show resolved Hide resolved
autogen.sh Outdated Show resolved Hide resolved
Closes shadow-maint#465

It'll be used by libmisc/ etc.

Signed-off-by: Serge Hallyn <[email protected]>
@hallyn hallyn force-pushed the 2021-12-21/libsubid-prog-notstatic branch from 4823f81 to 330b952 Compare December 22, 2021 20:29
@ikerexxe
Copy link
Collaborator

LGTM. Thanks!

@rbalint
Copy link
Contributor

rbalint commented Dec 23, 2021

@hallyn please finish the fix for #444 instead. This is still ugly and the proper fix will need an ABI bump again. :-(

@hallyn
Copy link
Member Author

hallyn commented Dec 23, 2021

@hallyn please finish the fix for #444 instead. This is still ugly and the proper fix will need an ABI bump again. :-(

I thought that was already merged! ok let me finish that first and see where that gets us.

Then I may do another release, and hopefully set this aside for awhile so I can focus a on the rust impl.

@hallyn hallyn marked this pull request as draft December 23, 2021 20:39
@hallyn hallyn closed this Dec 23, 2021
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.

libsubid-4 lost some symbols
3 participants