Conversation
This usually is very annoying to users who then cannot log in, so make sure we always warn if that happens (selinux, or whatever other reason). This reverts a790812.
| void *data, \ | ||
| void *userdata) { \ | ||
| \ | ||
| int function(GENERIC_PARSER_ARGS) { \ |
There was a problem hiding this comment.
Hmm, should we err on the side of keeping the argument list visible in this function definition, like the .c files? GENERIC_PARSER_ARGS works nicely in the big list of function declarations, but maybe we shouldn't use it outside of that. We could even #undef it immediately after the declarations.
There was a problem hiding this comment.
The macro is defined just a few lines above, so I think it is OK to also use the macro here.
There was a problem hiding this comment.
ehh. I'm not used to reading function definitions that way.
Just having #undef GENERIC_PARSER_ARGS somewhere would make me happier. It communicates the point made in the commit message, that we don't expect people to remember it. If you think the #undef would look ok placed after these two function definitions, then I defer to submitters judgement.
BTW apologies for clicking the wrong button, I was trying to do a full review from the start.
There was a problem hiding this comment.
It'd need to be undefined after DEFINE_CONFIG_PARSE_ENUM is used, so there doesn't seem to be a nice way to do this.
| unlinkat(dirfd(d), de->d_name, 0); | ||
| if (unlinkat(dirfd(d), de->d_name, 0) < 0) | ||
| log_warning("Failed to remove /run/systemd/seats/%s: %m", | ||
| de->d_name); |
There was a problem hiding this comment.
everybody's favourite task: adding error handling.
We've got a different approach for each of the three calls in this commit... and each call looks like it's filling the exact same role.
The journald one sounds a bit worrying, if it could later restore a stale stream with the wrong fd? Should the journald one be raised to LOG_WARNING as well?
I'm not really worried about the udev one being ignored.
There was a problem hiding this comment.
I made them both log_warning now.
| assert_se(utf8_n_codepoints("zażółcić gęślą jaźń") == 19); | ||
| assert_se(utf8_n_codepoints("串") == 1); | ||
| assert_se(utf8_n_codepoints("") == 0); | ||
| assert_se(utf8_n_codepoints("\xF1") == (size_t) -1); |
There was a problem hiding this comment.
hey, come on! you totally missed out on the chance to count the codepoints in an emoji infested string!
I mean, emojis! EMOJIS!
|
lgtm (except of course the massive missed opportunity of testing emoji strings in the utf8_n_codepoints() tests.) |
sourcejedi
left a comment
There was a problem hiding this comment.
Afraid I bounced off "do not initialize join_controllers by default", but I was able to review everything else.
Thanks for pulling in my suggested comment fix, and this looks nice generally. I have two sundry comments.
| assert(lvalue); | ||
| assert(rvalue); | ||
|
|
||
| arg_join_controllers = strv_free_free(arg_join_controllers); |
There was a problem hiding this comment.
Equally, having to use arg_join_controllers directly instead of through data was a sign we were being a bit weird. Nice cleanup :).
| void *data, \ | ||
| void *userdata) { \ | ||
| \ | ||
| int function(GENERIC_PARSER_ARGS) { \ |
There was a problem hiding this comment.
ehh. I'm not used to reading function definitions that way.
Just having #undef GENERIC_PARSER_ARGS somewhere would make me happier. It communicates the point made in the commit message, that we don't expect people to remember it. If you think the #undef would look ok placed after these two function definitions, then I defer to submitters judgement.
BTW apologies for clicking the wrong button, I was trying to do a full review from the start.
|
The CIs fail to start systemd... |
Coverity now started warning about this ("Calling unlinkat without checking
return value (as is done elsewhere 12 out of 15 times).", and it is right:
most of the time we should at list print a log message so people can figure
out something is wrong when this happens.
v2:
- use warning level in journald too (this is unlikely to happen ever, so it
should be safe to something that is visible by default).
The arguments have to be indentical everywhere, so let's use a macro to make things more readable. But only in the headers, in the .c files let's keep them verbose so that it's easy to see the argument list.
config_parse_join_controllers would free the destination argument on failure, which is contrary to our normal style, where failed parsing has no effect. Moving it to shared also allows a test to be added.
We're moving towards unified cgroup hierarchy where this is not necessary. This makes main.c a bit simpler.
Follow up for review of systemd#8184.
15a31cf to
e2cbc80
Compare
|
I fixed the important issue (lack of fancy shmancy unicode) and the other one (missing array terminator leading to a crash). |
No description provided.