From 96b190e24dc3e379e2f00a09e990b679232cfdd4 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 17 Nov 2010 10:10:31 +0000 Subject: [PATCH] Document isduid(3). Tweaks from jmc@ ok jmc@ krw@ --- src/lib/libutil/Makefile | 6 ++-- src/lib/libutil/isduid.3 | 61 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 src/lib/libutil/isduid.3 diff --git a/src/lib/libutil/Makefile b/src/lib/libutil/Makefile index b2599743..b7b5f6dd 100644 --- a/src/lib/libutil/Makefile +++ b/src/lib/libutil/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.32 2010/11/15 15:07:40 jsing Exp $ +# $OpenBSD: Makefile,v 1.33 2010/11/17 10:10:31 jsing Exp $ # $NetBSD: Makefile,v 1.8 1996/05/16 07:03:28 thorpej Exp $ LIB= util @@ -10,8 +10,8 @@ SRCS= check_expire.c duid.c getmaxpartitions.c getrawpartition.c login.c \ login_fbtab.c uucplock.c fparseln.c opendisk.c pidfile.c \ fmt_scaled.c imsg.c imsg-buffer.c -MAN= check_expire.3 getmaxpartitions.3 getrawpartition.3 login.3 opendev.3 \ - openpty.3 pw_init.3 pw_lock.3 readlabelfs.3 uucplock.3 \ +MAN= check_expire.3 getmaxpartitions.3 getrawpartition.3 isduid.3 login.3 \ + opendev.3 openpty.3 pw_init.3 pw_lock.3 readlabelfs.3 uucplock.3 \ fparseln.3 opendisk.3 login_fbtab.3 pidfile.3 fmt_scaled.3 imsg_init.3 MLINKS+=imsg_init.3 imsg_read.3 diff --git a/src/lib/libutil/isduid.3 b/src/lib/libutil/isduid.3 new file mode 100644 index 00000000..f7248a51 --- /dev/null +++ b/src/lib/libutil/isduid.3 @@ -0,0 +1,61 @@ +.\" $OpenBSD: isduid.3,v 1.1 2010/11/17 10:10:31 jsing Exp $ +.\" +.\" * Copyright (c) Joel Sing +.\" +.\" 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: November 17 2010 $ +.Dt ISDUID 3 +.Os +.Sh NAME +.Nm isduid +.Nd disklabel UID test +.Sh SYNOPSIS +.Fd #include +.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 hexidecimal 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 .