-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Upstream: Replace sprintf()->snprintf() strcpy()->strlcpy() #10400
Conversation
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.
Looks sane, my minor complaints notwithstanding.
Threw some of the repeated math into a local variable, hopefully that is a little more readable. |
Corrected the #ifdefs around the _set_impl functions. But could get rid of them entirely if there is a solution for the |
Codecov Report
@@ Coverage Diff @@
## master #10400 +/- ##
==========================================
- Coverage 79.56% 79.36% -0.20%
==========================================
Files 391 391
Lines 123624 123628 +4
==========================================
- Hits 98357 98123 -234
- Misses 25267 25505 +238
Continue to review full report at Codecov.
|
4434ec2
to
a19fd0f
Compare
Look's like some cstyle warnings. Aside from that, this looks good to me. We had a CI glitch so I went and resubmitted the unexpected failed builds to see if there were real issues. |
If other platforms miss snprintf, we should add a #define to sprintf, likewise strlcpy(). Biggest change is adding another size parameter to zfs_id_to_fuidstr(). The various *_impl_get() functions have been taken out for macOS, using I am unsure of its size. If someone with Linux background knows the size, I can update the PR. (It will not even compile using strcpy). Signed-off-by: Jorgen Lundman <lundman@lundman.net>
cstyle corrected, also, it seems |
The strcpy() and sprintf() functions are deprecated on some platforms. Care is needed to ensure correct size is used. If some platforms miss snprintf, we can add a #define to sprintf, likewise strlcpy(). The biggest change is adding a size parameter to zfs_id_to_fuidstr(). The various *_impl_get() functions are only used on linux and have not yet been updated. Reviewed by: Sean Eric Fagan <sef@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Jorgen Lundman <lundman@lundman.net> Closes openzfs#10400
The strcpy() and sprintf() functions are deprecated on some platforms. Care is needed to ensure correct size is used. If some platforms miss snprintf, we can add a #define to sprintf, likewise strlcpy(). The biggest change is adding a size parameter to zfs_id_to_fuidstr(). The various *_impl_get() functions are only used on linux and have not yet been updated. Reviewed by: Sean Eric Fagan <sef@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Jorgen Lundman <lundman@lundman.net> Closes #10400
The strcpy() and sprintf() functions are deprecated on some platforms. Care is needed to ensure correct size is used. If some platforms miss snprintf, we can add a #define to sprintf, likewise strlcpy(). The biggest change is adding a size parameter to zfs_id_to_fuidstr(). The various *_impl_get() functions are only used on linux and have not yet been updated. Reviewed by: Sean Eric Fagan <sef@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Jorgen Lundman <lundman@lundman.net> Closes openzfs#10400 (cherry picked from commit c9e319f)
The strcpy() and sprintf() functions are deprecated on some platforms. Care is needed to ensure correct size is used. If some platforms miss snprintf, we can add a #define to sprintf, likewise strlcpy(). The biggest change is adding a size parameter to zfs_id_to_fuidstr(). The various *_impl_get() functions are only used on linux and have not yet been updated. Reviewed by: Sean Eric Fagan <sef@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Jorgen Lundman <lundman@lundman.net> Closes openzfs#10400
The strcpy() and sprintf() functions are deprecated on some platforms. Care is needed to ensure correct size is used. If some platforms miss snprintf, we can add a #define to sprintf, likewise strlcpy(). The biggest change is adding a size parameter to zfs_id_to_fuidstr(). The various *_impl_get() functions are only used on linux and have not yet been updated. Reviewed by: Sean Eric Fagan <sef@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Jorgen Lundman <lundman@lundman.net> Closes openzfs#10400
strcpy() and sprintf() are deprecated on some platforms.
Care is needed to ensure correct size is used.
Motivation and Context
Unfortunately, compiling stops with error when attempting to use deprecated
functions on macOS.
Description
If other platforms miss snprintf, we should add a #define to
sprintf, likewise strlcpy().
Biggest change is adding another size parameter to zfs_id_to_fuidstr().
The various *_impl_get() functions have been taken out for macOS, using
#ifdefs as the string is passed to ZFS from the Linux kernel. I am unsure of its size. If someone with Linux background knows the size, I can update the PR. (It will not even compile using strcpy).
Did git just eat part of the commit message? Oh heh, '#' is comment.
How Has This Been Tested?
Extensive testing of zfs-test on macOS. Other platforms unknown.
Types of changes
Checklist:
Signed-off-by
.