Skip to content

Conversation

@Anonymous-AAA
Copy link
Contributor

Fixes #8378

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)

@drinkcat
Copy link
Collaborator

drinkcat commented Aug 11, 2025

Thanks! MacOS and FreeBSD are unhappy ,-(

Copy link
Collaborator

@drinkcat drinkcat left a comment

Choose a reason for hiding this comment

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

Forgot to press submit review...

#[cfg(unix)]
pub fn make_socket(path: &Path) -> std::io::Result<()> {
let name = CString::new(path.to_str().unwrap()).unwrap();
let err = unsafe { mknod(name.as_ptr(), S_IFSOCK, 0) };
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should you still set permissions? e.g. S_IFSOCK | 0o666?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I saw permissions are set from the source file after file creation. So I thought I could skip them here or did I miss something?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's tricky, it depends on the exact set of flags passed to cp I believe.

log_info("mksocket", &full_path);
unsafe {
let socket_name: CString = CString::new(full_path).expect("CString creation failed.");
libc::mknod(socket_name.as_ptr(), libc::S_IFSOCK, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same question about permissions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same here

@Anonymous-AAA
Copy link
Contributor Author

The issue seems to be that mknod requires super user privileges in freebsd/macos. I will open a new pull request with necessary changes.

@drinkcat
Copy link
Collaborator

The issue seems to be that mknod requires super user privileges in freebsd/macos. I will open a new pull request with necessary changes.

You can just add commits here. No need to create a new PR.

Also, it would probably be acceptable to skip those tests on FreeBSD/MacOS if needed.

@Anonymous-AAA
Copy link
Contributor Author

My bad :( I already opened a pull request #8478 . Had to change the implementation.

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.

different behaviour in copying a socket file in a directory

2 participants