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