1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
.\" $OpenBSD: isduid.3,v 1.3 2015/07/15 15:16:59 sobrado Exp $
.\"
.\" * Copyright (c) Joel Sing <jsing@openbsd.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd $Mdocdate: July 15 2015 $
.Dt ISDUID 3
.Os
.Sh NAME
.Nm isduid
.Nd disklabel UID test
.Sh SYNOPSIS
.In util.h
.Ft int
.Fn isduid "char *duid" "int dflags"
.Sh DESCRIPTION
The
.Fn isduid
function tests the string
.Fa duid
to see if it is a valid
.Xr disklabel 8
UID.
The
.Fa dflags
are specified using the same flags as used by
.Xr opendev 3 .
.Pp
If the OPENDEV_PART flag is included in
.Fa dflags
the disklabel UID must consist of a 16-character hexadecimal string.
Otherwise the disklabel UID must consist of a 16-character hexadecimal string
followed by a
.Sq \&.
and a partition letter.
.Sh RETURN VALUES
The
.Fn isduid
function returns non-zero if
.Fa duid
is a valid DUID, otherwise zero is returned.
.Sh SEE ALSO
.Xr opendev 3 ,
.Xr disklabel 5 ,
.Xr disklabel 8
.Sh HISTORY
The
.Fn isduid
function first appeared in
.Ox 4.9 .
|