Page MenuHomeFreeBSD

bin/uuidgen: add support for v4 uuids
ClosedPublic

Authored by tcberner on Dec 14 2022, 6:02 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 6, 5:33 AM
Unknown Object (File)
Fri, May 3, 5:17 AM
Unknown Object (File)
Mon, Apr 22, 10:43 AM
Unknown Object (File)
Mar 9 2024, 4:45 AM
Unknown Object (File)
Mar 9 2024, 4:45 AM
Unknown Object (File)
Mar 9 2024, 4:45 AM
Unknown Object (File)
Mar 9 2024, 4:41 AM
Unknown Object (File)
Mar 8 2024, 2:19 AM
Subscribers

Diff Detail

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

Event Timeline

only small style issue.

bin/uuidgen/uuidgen.1
57

You probably don't want this, as your version does not call the uuidgen(2) syscall.

bin/uuidgen/uuidgen.c
54

style issue: should be return(-1)

56

to respect style, this should be declare at the top of the function.

58

same, this should be declare at the top of the function, followed by an empty line.

71

should be return (0);

Should this version become the default? On the one hand, it has POLA violation potential, on the other hand, it's what the command does under another system.

bin/uuidgen/uuidgen.1
55

This grammar looks wrong. It doesn't help that the terms as defined by the RFC are confusing.

57

Do we want to remove the other cross reference a couple of lines below?

bin/uuidgen/uuidgen.c
54

bapt missed the space, he meant return (-1).

60

style(9) doesn't allow this comment style yet.

133

If you want to improve style of the cast, just remove it.

Should this version become the default? On the one hand, it has POLA violation potential, on the other hand, it's what the command does under another system.

I would do it in 2 steps, first implement v4 and MFC this change everywhere.

2, make v4 the default (meaning we need an argument for the v1). and document it for 14.0R

  • bin/uuidgen: follow style(9)
  • bin/uuidgen: fix manpage
bin/uuidgen/uuidgen.c
64

Is this the* a typo?

beside the typo @pstef points at, LGTM please before pushing don't forget to bump the date of the manpage, and I think you can mark this as "MFC after: 1 week"

This revision is now accepted and ready to land.Dec 15 2022, 7:50 AM
This revision was automatically updated to reflect the committed changes.
In D37695#857273, @bapt wrote:

2, make v4 the default (meaning we need an argument for the v1). and document it for 14.0R

Only uuidgen(1), the utility? I'd like uuidgen(2), the syscall, to use V4 by default, similar to NetBSD. For example, wlroots gave up on uuid_create(3) because it's not random compared to OpenBSD and NetBSD. For another example, uuidgen(2) leaks MAC-based UUIDs into GPT labels, ZFS hostid, etc. that maybe shared with untrusted parties and not configurable unlike, say, IPv6 via net.inet6.ip6.use_tempaddr=1.

In D37695#857273, @bapt wrote:

2, make v4 the default (meaning we need an argument for the v1). and document it for 14.0R

Only uuidgen(1), the utility? I'd like uuidgen(2), the syscall, to use V4 by default, similar to NetBSD. For example, wlroots gave up on uuid_create(3) because it's not random compared to OpenBSD and NetBSD. For another example, uuidgen(2) leaks MAC-based UUIDs into GPT labels, ZFS hostid, etc. that maybe shared with untrusted parties and not configurable unlike, say, IPv6 via net.inet6.ip6.use_tempaddr=1.

shall I create a review to change the syscall?