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

zgenhostid: accept hostid arguments equal to zero. #11189

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cmd/zgenhostid/zgenhostid.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ usage(void)
" -h\t\t print this usage and exit\n"
" -o <filename>\t write hostid to this file\n\n"
"If hostid file is not present, store a hostid in it.\n"
"The optional value must be an 8-digit hex number between"
"1 and 2^32-1.\n"
"If no value is provided, a random one will"
"be generated.\n"
"The optional value should be an 8-digit hex number between"
" 1 and 2^32-1.\n"
"If the value is 0 or no value is provided, a random one"
" will be generated.\n"
"The value must be unique among your systems.\n");
exit(EXIT_FAILURE);
/* NOTREACHED */
Expand Down Expand Up @@ -108,7 +108,7 @@ main(int argc, char **argv)
exit(EXIT_FAILURE);
}

if (input_i < 0x1 || input_i > UINT32_MAX) {
if (input_i > UINT32_MAX) {
fprintf(stderr, "%s\n", strerror(ERANGE));
usage();
}
Expand Down
3 changes: 2 additions & 1 deletion man/man8/zgenhostid.8
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ instead of default
.It Ar hostid
Specifies the value to be placed in
.Pa /etc/hostid .
It must be a number with a value between 1 and 2^32-1.
It should be a number with a value between 1 and 2^32-1.
If it is 0, zgenhostid will generate a random hostid.
This value
.Sy must
be unique among your systems.
Expand Down