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

ENT-12511: Fixed bug where cf-net.exe get fails to create file #231

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

larsewi
Copy link
Contributor

@larsewi larsewi commented Dec 18, 2024

When calling fdopen() in safe_fopen_create_perms() using the "wx"
mode we get...

warning: Invalid parameter passed to C runtime function.

...on Windows. Looking in both Linux man pages and Win32 API, I see that
the mode argument "x" is not specified as a valid argument in either
of them. Hence, it is probably not supported. Maybe Unix systems simply
ignore it, while Windows returns error? Either way, I believe it is safe
to omit it, given that we already called open() with the O_EXCL
flag, and that we are getting the file stream from that same file
descriptor.

Ticket: ENT-12511
Changelog: Title
Signed-off-by: Lars Erik Wik [email protected]

Build Status

  • Manually tested on Windows Server 2019 & Ubuntu 24

@mender-test-bot
Copy link

There was an error running your pipeline, see logs for details.

@mender-test-bot
Copy link

There was an error running your pipeline, see logs for details.

@mender-test-bot
Copy link

There was an error running your pipeline, see logs for details.

libutils/file_lib.c Outdated Show resolved Hide resolved
libutils/file_lib.c Outdated Show resolved Hide resolved
libutils/file_lib.c Outdated Show resolved Hide resolved
@mender-test-bot
Copy link

There was an error running your pipeline, see logs for details.

Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

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

Thanks for following up on this.

libutils/file_lib.c Outdated Show resolved Hide resolved
libutils/file_lib.c Outdated Show resolved Hide resolved
libutils/file_lib.c Outdated Show resolved Hide resolved
@mender-test-bot
Copy link

There was an error running your pipeline, see logs for details.

@larsewi
Copy link
Contributor Author

larsewi commented Dec 20, 2024

@cf-bottom jenkins please :)

@cf-bottom
Copy link

@larsewi
Copy link
Contributor Author

larsewi commented Dec 20, 2024

Here we go Build Status

libutils/file_lib.c Outdated Show resolved Hide resolved
@mender-test-bot
Copy link

There was an error running your pipeline, see logs for details.

@larsewi
Copy link
Contributor Author

larsewi commented Dec 20, 2024

@cf-bottom Jenkins please :)

@larsewi larsewi force-pushed the atomic branch 2 times, most recently from 142fbab to 0fc2ba7 Compare December 20, 2024 09:17
@mender-test-bot
Copy link

There was an error running your pipeline, see logs for details.

When calling `fdopen()` in `safe_fopen_create_perms()` using the `"wx"`
mode we get...

```
warning: Invalid parameter passed to C runtime function.
```

...on Windows. Looking in both Linux man pages and Win32 API, I see that
the mode argument `"x"` is not specified as a valid argument in either
of them. Hence, it is probably not supported. Maybe Unix systems simply
ignore it, while Windows returns error? Either way, I believe it is safe
to omit it, given that we already called `open()` with the `O_EXCL`
flag, and that we are getting the file stream from that same file
descriptor.

Ticket: ENT-12511
Changelog: Title
Signed-off-by: Lars Erik Wik <[email protected]>
@mender-test-bot
Copy link

There was an error running your pipeline, see logs for details.

Copy link
Contributor

@vpodzime vpodzime left a comment

Choose a reason for hiding this comment

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

Looks good to me now.

@NorthernTechHQ NorthernTechHQ deleted a comment from cf-bottom Dec 20, 2024
@cf-bottom
Copy link

@larsewi
Copy link
Contributor Author

larsewi commented Dec 20, 2024

Build Status

@larsewi larsewi merged commit 3b5afdb into NorthernTechHQ:master Dec 20, 2024
4 checks passed
@larsewi larsewi deleted the atomic branch January 13, 2025 12:57
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.

5 participants