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

Always leave a trailing zero at the end of sun_path #436

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kalvdans
Copy link

@kalvdans kalvdans commented Sep 3, 2023

According to the unix(7) manpage on Linux:

   When binding a socket to a pathname, a few rules should be observed for maximum portability and ease of coding:
   *  The pathname in sun_path should be null-terminated.
   *  The length of the pathname, including the terminating null byte, should not exceed the size of sun_path.
   *  The addrlen argument that describes the enclosing sockaddr_un structure should have a value of at least:
          offsetof(struct sockaddr_un, sun_path)+strlen(addr.sun_path)+1
      or, more simply, addrlen can be specified as sizeof(struct sockaddr_un).

readconf.h Show resolved Hide resolved
Christian Häggström added 2 commits September 5, 2023 21:47
It simplifies things, being able to check length with strlen, and
allow copying with strlcpy.
To be maximum portable among systems
@kalvdans
Copy link
Author

kalvdans commented Sep 5, 2023

I need some help to reproduce the CI failures. I could not reproduce on a mac at work:

insight@mac openssh-portable % mkdir -p /tmp/usr/local/etc/
insight@mac openssh-portable % ./ssh-keygen -A -f /tmp     
ssh-keygen: generating new host keys: ED25519 
insight@mac openssh-portable % sw_vers -productVersion                 
13.4

But then, the CI environment is quite different. Can you try on your end, @oliverkurth ?

@oliverkurth
Copy link

But then, the CI environment is quite different. Can you try on your end, @oliverkurth

I saw that, and tried to reproduce on my Mac, but it works fine for me too.

The CI is a mess, and I have failures for the unix socket PR that I am not able to reproduce. It's very frustrating.

@kalvdans
Copy link
Author

kalvdans commented Sep 5, 2023

But then, the CI environment is quite different. Can you try on your end, @oliverkurth

I saw that, and tried to reproduce on my Mac, but it works fine for me too.

Thanks a lot for trying to reproduce!

The CI is a mess, and I have failures for the unix socket PR that I am not able to reproduce. It's very frustrating.

I force-pushed to re-trigger CI, but the failure is consistent. Good that it isn't intermittent at least :)

@oliverkurth
Copy link

Looks like the segfault in ssh-keygen on MacOS is a known issue: https://bugzilla.mindrot.org/show_bug.cgi?id=3584

It's not your fault 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants