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)
Tue, Nov 5, 8:31 AM
Unknown Object (File)
Mon, Nov 4, 6:26 AM
Unknown Object (File)
Wed, Oct 30, 12:46 PM
Unknown Object (File)
Mon, Oct 28, 11:42 AM
Unknown Object (File)
Tue, Oct 22, 5:28 PM
Unknown Object (File)
Tue, Oct 22, 9:57 AM
Unknown Object (File)
Mon, Oct 21, 1:12 PM
Unknown Object (File)
Oct 8 2024, 1:20 PM
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?