In the current spirit of making stuff DUID capable i found that
umount(8) was still not so.

Diff makes use of "unrawname()" from fsck/fsutils.[ch]. Not sure if
this is what and how we want it, so no man page changes included so far.

Thoughts? OK's? Manpage diffs? ;-)

/Alexander


Index: Makefile
===================================================================
RCS file: /cvs/src/sbin/umount/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- Makefile    21 Sep 1997 11:38:25 -0000      1.3
+++ Makefile    6 May 2011 02:07:01 -0000
@@ -1,6 +1,11 @@
 #      $OpenBSD: Makefile,v 1.3 1997/09/21 11:38:25 deraadt Exp $
 
 PROG=  umount
+SRCS=  umount.c fsutil.c
+.PATH:  ${.CURDIR}/../fsck
+CFLAGS+= -I${.CURDIR}/../fsck
+DPADD= ${LIBUTIL}
+LDADD= -lutil
 MAN=   umount.8
 
 .include <bsd.prog.mk>
Index: umount.c
===================================================================
RCS file: /cvs/src/sbin/umount/umount.c,v
retrieving revision 1.21
diff -u -p -r1.21 umount.c
--- umount.c    27 Oct 2009 23:59:34 -0000      1.21
+++ umount.c    6 May 2011 02:07:01 -0000
@@ -44,10 +44,14 @@
 #include <nfs/rpcv2.h>
 
 #include <err.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <util.h>
+
+#include "fsutil.h"
 
 typedef enum { MNTON, MNTFROM } mntwhat;
 
@@ -149,7 +153,7 @@ umountfs(char *oname)
        struct stat sb;
        struct timeval pertry, try;
        CLIENT *clp;
-       int so;
+       int so, devfd;
        char *delimp, *hostp, *mntpt;
        char *name, *newname, rname[MAXPATHLEN], type[MFSNAMELEN];
 
@@ -170,6 +174,12 @@ umountfs(char *oname)
                warnx("%s: not a directory or special device", name);
                return (1);
            }
+       }
+
+       /* Special treatment for DUIDs (and short form device names) */
+       if ((devfd = opendev(oname, O_RDONLY, 0, &name)) >= 0) {
+               close(devfd);
+               unrawname(name);
        }
 
        /*

Reply via email to