As j...@freenode found out, the salt file needs to be 128 bytes (or larger),
but no part of mount_vnd seem to mention the size requirements, so if we
require
128 bytes, then this diff should help people use salt files:

Index: mount_vnd.8
===================================================================
RCS file: /cvs/src/sbin/mount_vnd/mount_vnd.8,v
retrieving revision 1.17
diff -u -r1.17 mount_vnd.8
--- mount_vnd.8 15 Apr 2010 23:19:14 -0000      1.17
+++ mount_vnd.8 26 Nov 2010 09:19:29 -0000
@@ -206,6 +206,7 @@
 .Fl K
 is used, specify the
 .Pa saltfile .
+Make sure the salt file is 128 bytes or larger.
 .It Fl t Ar disktype
 Specify a
 .Ar disktype
Index: mount_vnd.c
===================================================================
RCS file: /cvs/src/sbin/mount_vnd/mount_vnd.c,v
retrieving revision 1.9
diff -u -r1.9 mount_vnd.c
--- mount_vnd.c 12 Apr 2010 01:44:08 -0000      1.9
+++ mount_vnd.c 26 Nov 2010 09:19:29 -0000
@@ -231,8 +231,9 @@
                } else {
                        if (read(fd, saltbuf, sizeof(saltbuf))
                            != sizeof(saltbuf))
-                               err(1, "Unable to read salt file: '%s'",
-                                   saltfile);
+                               err(1, "Unable to read salt file: '%s' "
+                                       "or salt file smaller than %d
bytes",
+                                   saltfile, sizeof(saltbuf));
                }
                close(fd);
        }


to test, create a less-than-128-byte salt file in /tmp named small, and go:

# mount_vnd -K 1292 -S /tmp/small /path/to/some/file vnd0

/ jj@

-- 
 To our sweethearts and wives.  May they never meet. -- 19th century toast

Reply via email to