-
Notifications
You must be signed in to change notification settings - Fork 185
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
ENT-10347: Fixed changing perms noise in no-noise sequential test #5386
Conversation
@cf-bottom Jenkins please :) |
Sure, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/10107/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-10107/ |
c32ee0f
to
98948fa
Compare
d3c5ee9
to
2fea659
Compare
@@ -667,6 +655,7 @@ static int SetupRunagentSocket(const ExecdConfig *execd_config) | |||
} | |||
else | |||
{ | |||
safe_chmod(sock_info.sun_path, (mode_t) 0600); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think fchmod(runagent_socket,...)
would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fchmod()
did not seem to work. Tried locally with both fchmod()
and chmod()
using this little program:
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
#include <string.h>
#include <unistd.h>
int main(void) {
const char *path = "bogus.sock";
int sock = socket(AF_LOCAL, SOCK_STREAM, 0);
assert(sock >= 0);
struct sockaddr_un sock_info;
memset(&sock_info, 0, sizeof(struct sockaddr_un));
strncpy(sock_info.sun_path, path, sizeof(sock_info.sun_path));
sock_info.sun_family = AF_LOCAL;
unlink(path);
int ret = bind(sock, (const struct sockaddr *)&sock_info, sizeof(sock_info));
assert(ret == 0);
chmod(path, (mode_t) 0600);
close(sock);
return 0;
}
Only the latter one actually changed the permissions. Thus I'm changing it back to use safe_chmod()
.
@cf-bottom Jenkins please :) |
Alright, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/10109/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-10109/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
Happens on Debian 12: ``` info: Socket "/var/cfengine/state/./cf-execd.sockets/runagent.socket" had permissions 0700, changed it to 0600 info: Directory "/var/cfengine/state/./cf-execd.sockets" had permissions 0750, changed it to 0700 ``` Ticket: ENT-10347 Changelog: None Signed-off-by: Lars Erik Wik <[email protected]>
@cf-bottom jenkins please :) |
Alright, I triggered a build: Jenkins: https://ci.cfengine.com/job/pr-pipeline/10115/ Packages: http://buildcache.cfengine.com/packages/testing-pr/jenkins-pr-pipeline-10115/ |
^ Only known FR tests failures |
Happens on Debian 12:
Merge together with: