lastlog2 - Y2038 safe version of lastlog#2508
Conversation
|
There are some missing sqlite3 in the buildsystem now. What has been expected :-) How to fix it ? |
The way I recommend to start with only one of the buildsystems and get it to work and reviewed. |
But this would mean that lastlog2 gets never tested, as you have to completely disable it in the build process for all CI tests. |
sqlite3 should already be pulled in transitively (it should also be added explicitly, though). It then fails during linking because the makefiles just don't link with libsqlite. |
|
Could you also hook up the tests to the testsuite in |
I have added it. |
That's correct for the application, but
You cannot call the time functions with int64_t as argument, at least s390 would break horrible this way. That's why there are a few places in the code which use time_t and not int64_t. That's the only way to make sure that the time functions work correct on all architectures. |
liblastlog2 is not calling any time functions, or?
These are currently failing to build on i386 exactly because it's passing mismatched pointers around.
Sounds good. |
t-8ch
left a comment
There was a problem hiding this comment.
A few more comments.
Those can also be done after the merge if preferred.
Except the problem that the tests are not built under meson.
Yes indeed ! I have fixed it. |
|
Hi, |
t-8ch
left a comment
There was a problem hiding this comment.
There are still unaddressed old review comments.
Even though some are marked as resolved.
Ups yes, I have found them and will take care about it. Thanks ! |
|
It looks good. I have some notes: I think the best design for APIs is to use some generic opaque handler. The reason is that such a library is possible to extend/change in arbitrary ways with minimal impact on the library's backward compatibility. (For example, I can imagine that one day, you decide on a different layout for the DB table or/and you will want to support multiple tables in the DB. You will be happy with a handler to change a table name for all ll2_ API functions.) In the case of liblastlog2, You can also support NULL as context to get a default hardcoded behavior. ( It seems the context would be usable, for example, as an application-defined pointer for sqlite3_exec() to generate an error message in the callback() on broken entries. Now it prints to stderr. -- |
I like the name "context" :-) and have adapted your suggestion to the API.
Yes, good point. I have removed all stdout,stderr calls. |
|
Hm, somehow three tests are failing: fdisk/mbr-nondos-mode But I think that it is not an issue of this PR because other PRs have the same problems. e.g.: So far I have tried to adapt all your request to the code. Thank you for your hints ! |
|
Thanks! I have a few notes:
struct ll2_context;
#include "lastlog2.h"
struct ll2_context {
char *lastlog2_path;
};
|
Yes, thanks for the hint ! |
|
The wall.c problem should be fixed now; it's not your fault. |
|
One last design discussion: @schubi2 That last rebase seems to have gone wrong. |
pam_lastlog2 - PAM module which logs user login with lastlog2
2cc49ae to
c2e299d
Compare
Hm, I like that way. But it is up to you what you are prefering. :-)
Yes, "git rebase" is sometimes tricky. At least for me ;-) |
|
Regarding the build error. Some other PRs have the same problem like: |
|
See #2718 |
For more information have a look to liblastlog2/README.md.
Requested by:
#2164 (comment)