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

Why do saferead and safewrite sometimes ignore the file descriptor that is passed to them? #270

Open
DerDakon opened this issue Mar 8, 2024 · 0 comments · May be fixed by #272
Open

Why do saferead and safewrite sometimes ignore the file descriptor that is passed to them? #270

DerDakon opened this issue Mar 8, 2024 · 0 comments · May be fixed by #272
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@DerDakon
Copy link
Member

DerDakon commented Mar 8, 2024

The new GEN_SAFE_TIMEOUTREAD and GEN_SAFE_TIMEOUTWRITE makros allow to pass the name of a filedescriptor. This one is used to actually do the underlying read and write operations. However these functions get a fd argument passed. In some cases the descriptor passed to these makros actually is fd. This is not specific to the makros, the code was actually the same before.

Actually using fd are:

  • qmail-pop3d.c
  • qmail-popup.c
  • qmail-smtpd.c

The argument is ignored and a hardcoded descriptor is used in:

  • qmail-qmqpc.c
  • qmail-remote.c

However I think that they are actually always identical, i.e. these functions could just use the fd argument and remove the makro argument entirely.

@DerDakon DerDakon added help wanted Extra attention is needed question Further information is requested labels Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant