Page MenuHomeFreeBSD

LinuxKPI: Add linux/string_helpers.h header
ClosedPublic

Authored by wulf on Nov 28 2023, 8:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 26, 1:31 AM
Unknown Object (File)
Sat, Dec 21, 12:20 AM
Unknown Object (File)
Nov 28 2024, 3:32 AM
Unknown Object (File)
Nov 28 2024, 3:32 AM
Unknown Object (File)
Nov 28 2024, 3:32 AM
Unknown Object (File)
Nov 28 2024, 3:32 AM
Unknown Object (File)
Nov 28 2024, 3:01 AM
Unknown Object (File)
Nov 24 2024, 6:31 PM

Details

Summary

Sponsored by: Serenity Cyber Security, LLC
Obtained from: OpenBSD
MFC after: 1 week

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

wulf requested review of this revision.Nov 28 2023, 8:44 PM
This revision is now accepted and ready to land.Nov 29 2023, 6:08 AM
bz requested changes to this revision.Dec 8 2023, 4:30 PM
bz added inline comments.
sys/compat/linuxkpi/common/include/linux/string_helpers.h
3

_LINUXKPI_LINUX_..

This revision now requires changes to proceed.Dec 8 2023, 4:30 PM

Add LINUXKPI to guard #define

wulf marked an inline comment as done.Dec 9 2023, 9:04 AM
This revision is now accepted and ready to land.Dec 12 2023, 1:44 AM
sys/compat/linuxkpi/common/include/linux/string_helpers.h
1

Public domain sometimes causes grief, perhaps we should use 0BSD. (In D43014 I suggested BSD-2-Clause but 0 clause BSD is basically public domain equivalent and is perhaps good for trivial things like this.)

sys/compat/linuxkpi/common/include/linux/string_helpers.h
1

Likely taken from OpenBSD so we can't change the licence I think

imp added inline comments.
sys/compat/linuxkpi/common/include/linux/string_helpers.h
1

tl;dr: it's fine as public domain...

too long:

Small nit to pick. It's not entirely true we can't change it. Public domain means you can do anything you want, including copyrighting the work and licensing it for money (cf Disney). We are allowed to do 0BSD, but we don't have to do 0BSD.

If it is from OpenBSD with this license, though, it may be that we can't change it due to politics rather than legal issues :). I'd feel better with this as 0BSD on the abstract level... but there's little enough creative content in this file to worry overmuch. These routines are implemented in one of the few sensible ways to do this. There's no comments for creative content. The guard header names are just the path. There's not a lot here to protect, so conversely, there's not much risk.

The bigger issue is credit... and that's well covered by the Obtained From: line in the commit message. That's likely sufficient to give them credit (because it's the nice thing to do) as well as give people a way to track this back to the source should there ever be an issue that's litigated (which is possible, but very, very remote).

3

#pragma once
has become my new favorite for these things...

But it's changing the OpenBSD code and while that may be fine for this file, others are less trivial and it sets a bad precident.

sys/compat/linuxkpi/common/include/linux/string_helpers.h
1

The bigger issue is credit... and that's well covered by the Obtained From: line in the commit message. That's likely sufficient to give them credit (because it's the nice thing to do) as well as give people a way to track this back to the source should there ever be an issue that's litigated (which is possible, but very, very remote).

One thing I would do though possibly is to reference the path to the file and the revision it was taken from.

But this is also not the first LinuxKPI file under "Public Domain" which makes it in this way and not the last (more even in the current batch).

Heh. @dumbbell already committed other version of str_yes_no() under BSD license.