CVS commit: src/usr.sbin/makefs

2024-02-29 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Feb 29 08:13:52 UTC 2024

Modified Files:
src/usr.sbin/makefs: msdos.c

Log Message:
makefs/msdos: Fix broken [extra-directory ...] case

"path + cur->name" is not same as "cur->root + cur->path + cur->name"
for extra-directory files, as extra-directory files are
in different location. Do what makefs ffs code does.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/makefs/msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/msdos.c
diff -u src/usr.sbin/makefs/msdos.c:1.24 src/usr.sbin/makefs/msdos.c:1.25
--- src/usr.sbin/makefs/msdos.c:1.24	Sun Feb 18 16:58:51 2024
+++ src/usr.sbin/makefs/msdos.c	Thu Feb 29 08:13:52 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: msdos.c,v 1.24 2024/02/18 16:58:51 christos Exp $	*/
+/*	$NetBSD: msdos.c,v 1.25 2024/02/29 08:13:52 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: msdos.c,v 1.24 2024/02/18 16:58:51 christos Exp $");
+__RCSID("$NetBSD: msdos.c,v 1.25 2024/02/29 08:13:52 tkusumi Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -226,8 +226,8 @@ msdos_populate_dir(const char *path, str
 	assert(fsopts != NULL);
 
 	for (cur = root->next; cur != NULL; cur = cur->next) {
-		if ((size_t)snprintf(pbuf, sizeof(pbuf), "%s/%s", path,
-		cur->name) >= sizeof(pbuf)) {
+		if ((size_t)snprintf(pbuf, sizeof(pbuf), "%s/%s/%s",
+		cur->root, cur->path, cur->name) >= sizeof(pbuf)) {
 			warnx("path %s too long", pbuf);
 			return -1;
 		}



CVS commit: src/usr.sbin/makefs

2024-02-29 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Feb 29 08:13:52 UTC 2024

Modified Files:
src/usr.sbin/makefs: msdos.c

Log Message:
makefs/msdos: Fix broken [extra-directory ...] case

"path + cur->name" is not same as "cur->root + cur->path + cur->name"
for extra-directory files, as extra-directory files are
in different location. Do what makefs ffs code does.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/makefs/msdos.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/autofs

2023-05-17 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Wed May 17 06:44:38 UTC 2023

Modified Files:
src/sys/fs/autofs: autofs.h

Log Message:
sys/fs/autofs: Remove unused APRINTF macro

Remove a debug print macro (originates from DragonFly autofs)
I had intentionally kept at the time.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/fs/autofs/autofs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/autofs/autofs.h
diff -u src/sys/fs/autofs/autofs.h:1.4 src/sys/fs/autofs/autofs.h:1.5
--- src/sys/fs/autofs/autofs.h:1.4	Sat Nov 23 17:13:46 2019
+++ src/sys/fs/autofs/autofs.h	Wed May 17 06:44:38 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: autofs.h,v 1.4 2019/11/23 17:13:46 tkusumi Exp $	*/
+/*	$NetBSD: autofs.h,v 1.5 2023/05/17 06:44:38 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -95,13 +95,6 @@ extern int autofs_interruptible;
 		}	\
 	} while (0)
 
-/*
- * APRINTF is only for debugging.
- */
-#define APRINTF(X, ...)	\
-	printf("### %s(%s): " X,			\
-	__func__, curproc->p_comm, ## __VA_ARGS__)
-
 struct autofs_node {
 	RB_ENTRY(autofs_node)		an_entry;
 	char*an_name;



CVS commit: src/sys/fs/autofs

2023-05-17 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Wed May 17 06:44:38 UTC 2023

Modified Files:
src/sys/fs/autofs: autofs.h

Log Message:
sys/fs/autofs: Remove unused APRINTF macro

Remove a debug print macro (originates from DragonFly autofs)
I had intentionally kept at the time.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/fs/autofs/autofs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/autofs

2022-05-04 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Wed May  4 11:27:54 UTC 2022

Modified Files:
src/usr.sbin/autofs: automount.c common.c

Log Message:
usr.sbin/autofs: Fix absolute path when creating a mountpoint

taken-from freebsd 63640b2f552c0476f50484635eb9888eafcd22dc


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/autofs/automount.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/autofs/common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/autofs/automount.c
diff -u src/usr.sbin/autofs/automount.c:1.3 src/usr.sbin/autofs/automount.c:1.4
--- src/usr.sbin/autofs/automount.c:1.3	Mon Jan 15 14:38:06 2018
+++ src/usr.sbin/autofs/automount.c	Wed May  4 11:27:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: automount.c,v 1.3 2018/01/15 14:38:06 christos Exp $	*/
+/*	$NetBSD: automount.c,v 1.4 2022/05/04 11:27:54 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: automount.c,v 1.3 2018/01/15 14:38:06 christos Exp $");
+__RCSID("$NetBSD: automount.c,v 1.4 2022/05/04 11:27:54 tkusumi Exp $");
 
 #include 
 #include 
@@ -83,18 +83,8 @@ mount_autofs(const char *from, const cha
 {
 	struct autofs_args args;
 	int error;
-	char *cwd;
 
-	/*
-	 * There is no guarantee we are at /, so chdir to /.
-	 */
-	cwd = getcwd(NULL, 0);
-	if (chdir("/") != 0)
-		log_warn("failed to chdir to /");
 	create_directory(fspath);
-	if (chdir(cwd) != 0)
-		log_warn("failed to restore cwd");
-	free(cwd);
 
 	log_debugx("mounting %s on %s, prefix \"%s\", options \"%s\"",
 	from, fspath, prefix, options);

Index: src/usr.sbin/autofs/common.c
diff -u src/usr.sbin/autofs/common.c:1.4 src/usr.sbin/autofs/common.c:1.5
--- src/usr.sbin/autofs/common.c:1.4	Tue Sep 14 20:40:55 2021
+++ src/usr.sbin/autofs/common.c	Wed May  4 11:27:54 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.c,v 1.4 2021/09/14 20:40:55 rillig Exp $	*/
+/*	$NetBSD: common.c,v 1.5 2022/05/04 11:27:54 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * $FreeBSD: head/usr.sbin/autofs/common.c 303527 2016-07-30 01:10:05Z bapt $
  */
 #include 
-__RCSID("$NetBSD: common.c,v 1.4 2021/09/14 20:40:55 rillig Exp $");
+__RCSID("$NetBSD: common.c,v 1.5 2022/05/04 11:27:54 tkusumi Exp $");
 
 #include 
 #include 
@@ -132,7 +132,7 @@ create_directory(const char *path)
 	 */
 	copy = tofree = checked_strdup(path + 1);
 
-	partial = checked_strdup("");
+	partial = checked_strdup("/");
 	for (;;) {
 		component = strsep(, "/");
 		if (component == NULL)



CVS commit: src/usr.sbin/autofs

2022-05-04 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Wed May  4 11:27:54 UTC 2022

Modified Files:
src/usr.sbin/autofs: automount.c common.c

Log Message:
usr.sbin/autofs: Fix absolute path when creating a mountpoint

taken-from freebsd 63640b2f552c0476f50484635eb9888eafcd22dc


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/autofs/automount.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/autofs/common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Re: CVS commit: src/usr.sbin/fstyp

2019-12-28 Thread Tomohiro Kusumi
2019年12月28日(土) 5:24 Warner Losh :
>
>
>
> On Fri, Dec 27, 2019 at 12:45 PM Sevan Janiyan  
> wrote:
>>
>> Hi tkusumi,
>> Thanks for the work you are doing.
>>
>> On 27/12/2019 11:06, Tomohiro Kusumi wrote:
>> > taken-from: FreeBSD 
>> > (freebsd/freebsd@b4d7ad9f787e74e712423def67de8bd76f71943a)
>>
>> One minor nit, could you please cite the revision in the svn repo which
>> is the source of truth and not the readonly git mirror, this is in case
>> something happens to the mirror and hashes end up changing in the future.
>
>
> FreeBSD is planning a conversion to git.

Yes, that's the reason I'm using Git hash here.
Nowadays I don't use their svn repo at all, so if recording Git hash
is not appropriate, I'll just note "taken-from: FreeBSD" without any
specific revision#.

> It's an open question at the moment what happens to the 'beta' readonly 
> export we're doing to github. There's a number of technical issues with it 
> which make using it for our source of truth difficult on an ongoing basis, so 
> there's a real chance the hashes will change for people just grabbing a 
> FreeBSD tree...
>
> Warner


CVS commit: src/sys/dev/dm

2019-11-29 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 30 05:35:57 UTC 2019

Modified Files:
src/sys/dev/dm: dm_ioctl.c

Log Message:
dm: Always initialize target's status string

Explicitly clear status string to prevent dmsetup(8) from
printing binary junk to stdout. Similar change has been
applied to DragonFlyBSD since 2015.

https://github.com/DragonFlyBSD/DragonFlyBSD/commit/a6cf54187fd7c3e994c573215806ec03572c038e

taken-from: DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/dm/dm_ioctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/dm

2019-11-29 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 30 05:35:57 UTC 2019

Modified Files:
src/sys/dev/dm: dm_ioctl.c

Log Message:
dm: Always initialize target's status string

Explicitly clear status string to prevent dmsetup(8) from
printing binary junk to stdout. Similar change has been
applied to DragonFlyBSD since 2015.

https://github.com/DragonFlyBSD/DragonFlyBSD/commit/a6cf54187fd7c3e994c573215806ec03572c038e

taken-from: DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/dev/dm/dm_ioctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/dm/dm_ioctl.c
diff -u src/sys/dev/dm/dm_ioctl.c:1.33 src/sys/dev/dm/dm_ioctl.c:1.34
--- src/sys/dev/dm/dm_ioctl.c:1.33	Sun Nov 11 10:21:11 2018
+++ src/sys/dev/dm/dm_ioctl.c	Sat Nov 30 05:35:57 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_ioctl.c,v 1.33 2018/11/11 10:21:11 mlelstv Exp $  */
+/* $NetBSD: dm_ioctl.c,v 1.34 2019/11/30 05:35:57 tkusumi Exp $  */
 
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.33 2018/11/11 10:21:11 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.34 2019/11/30 05:35:57 tkusumi Exp $");
 
 /*
  * Locking is used to synchronise between ioctl calls and between dm_table's
@@ -927,6 +927,12 @@ dm_table_status_ioctl(prop_dictionary_t 
 		prop_dictionary_set_int32(target_dict, DM_TABLE_STAT,
 		dmv->table_head.cur_active_table);
 
+		/*
+		 * Explicitly clear DM_TABLE_PARAMS to prevent dmsetup(8) from
+		 * printing junk when DM_TABLE_PARAMS was never initialized.
+		 */
+		prop_dictionary_set_cstring(target_dict, DM_TABLE_PARAMS, "");
+
 		if (flags & DM_STATUS_TABLE_FLAG) {
 			params = table_en->target->status
 			(table_en->target_config);



CVS commit: src/sys/fs/autofs

2019-11-26 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Tue Nov 26 16:17:31 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs_vfsops.c autofs_vnops.c

Log Message:
autofs: Use NULLVP for NULL vnode

I originally used NULL for NetBSD autofs, but it got mixed up with
NULLVP when merged with NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/fs/autofs/autofs_vfsops.c
cvs rdiff -u -r1.3 -r1.4 src/sys/fs/autofs/autofs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/autofs

2019-11-26 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Tue Nov 26 16:17:31 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs_vfsops.c autofs_vnops.c

Log Message:
autofs: Use NULLVP for NULL vnode

I originally used NULL for NetBSD autofs, but it got mixed up with
NULLVP when merged with NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/fs/autofs/autofs_vfsops.c
cvs rdiff -u -r1.3 -r1.4 src/sys/fs/autofs/autofs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/autofs/autofs_vfsops.c
diff -u src/sys/fs/autofs/autofs_vfsops.c:1.7 src/sys/fs/autofs/autofs_vfsops.c:1.8
--- src/sys/fs/autofs/autofs_vfsops.c:1.7	Sat Nov 23 15:17:46 2019
+++ src/sys/fs/autofs/autofs_vfsops.c	Tue Nov 26 16:17:31 2019
@@ -33,7 +33,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.7 2019/11/23 15:17:46 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.8 2019/11/26 16:17:31 tkusumi Exp $");
 
 
 #include "autofs.h"
@@ -273,7 +273,7 @@ autofs_root(struct mount *mp, struct vno
 	error = vn_lock(*vpp, LK_EXCLUSIVE);
 	if (error) {
 		vrele(*vpp);
-		*vpp = NULL;
+		*vpp = NULLVP;
 		return error;
 	}
 

Index: src/sys/fs/autofs/autofs_vnops.c
diff -u src/sys/fs/autofs/autofs_vnops.c:1.3 src/sys/fs/autofs/autofs_vnops.c:1.4
--- src/sys/fs/autofs/autofs_vnops.c:1.3	Sat Nov 23 17:13:46 2019
+++ src/sys/fs/autofs/autofs_vnops.c	Tue Nov 26 16:17:31 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: autofs_vnops.c,v 1.3 2019/11/23 17:13:46 tkusumi Exp $	*/
+/*	$NetBSD: autofs_vnops.c,v 1.4 2019/11/26 16:17:31 tkusumi Exp $	*/
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
  * Copyright (c) 2016 The DragonFly Project
@@ -34,7 +34,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.3 2019/11/23 17:13:46 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.4 2019/11/26 16:17:31 tkusumi Exp $");
 
 #include "autofs.h"
 
@@ -87,7 +87,7 @@ autofs_getattr(void *v)
 	if (autofs_mount_on_stat &&
 	autofs_cached(anp, NULL, 0) == false &&
 	autofs_ignore_thread() == false) {
-		struct vnode *newvp = NULL;
+		struct vnode *newvp = NULLVP;
 		int error = autofs_trigger_vn(vp, "", 0, );
 		if (error)
 			return error;
@@ -171,7 +171,7 @@ mounted:
 		return error;
 
 	if (!vp->v_mountedhere) {
-		*newvp = NULL;
+		*newvp = NULLVP;
 		return 0;
 	} else {
 		/*
@@ -212,7 +212,7 @@ autofs_lookup(void *v)
 	KASSERT(VOP_ISLOCKED(dvp));
 
 	anp = VTOI(dvp);
-	*vpp = NULL;
+	*vpp = NULLVP;
 
 	/* Check accessibility of directory. */
 	KASSERT(!VOP_ACCESS(dvp, VEXEC, cnp->cn_cred));
@@ -259,7 +259,7 @@ autofs_lookup(void *v)
 
 	if (autofs_cached(anp, cnp->cn_nameptr, cnp->cn_namelen) == false &&
 	autofs_ignore_thread() == false) {
-		struct vnode *newvp = NULL;
+		struct vnode *newvp = NULLVP;
 		error = autofs_trigger_vn(dvp, cnp->cn_nameptr, cnp->cn_namelen,
 		);
 		if (error)
@@ -468,7 +468,7 @@ autofs_readdir(void *v)
 
 	if (autofs_cached(anp, NULL, 0) == false &&
 	autofs_ignore_thread() == false) {
-		struct vnode *newvp = NULL;
+		struct vnode *newvp = NULLVP;
 		error = autofs_trigger_vn(vp, "", 0, );
 		if (error)
 			return error;
@@ -578,7 +578,7 @@ autofs_reclaim(void *v)
 	 * We do not free autofs_node here; instead we are
 	 * destroying them in autofs_node_delete().
 	 */
-	anp->an_vnode = NULL;
+	anp->an_vnode = NULLVP;
 	vp->v_data = NULL;
 
 	return 0;
@@ -630,7 +630,7 @@ autofs_node_new(struct autofs_node *pare
 	getnanotime(>an_ctime);
 	anp->an_parent = parent;
 	anp->an_mount = amp;
-	anp->an_vnode = NULL;
+	anp->an_vnode = NULLVP;
 	anp->an_cached = false;
 	anp->an_wildcards = false;
 	anp->an_retries = 0;



CVS commit: src/usr.sbin/autofs

2019-11-25 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Mon Nov 25 16:57:09 UTC 2019

Modified Files:
src/usr.sbin/autofs: automountd.8

Log Message:
autofs: Add missing description for automountd option -T


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/autofs/automountd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/autofs

2019-11-25 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Mon Nov 25 16:57:09 UTC 2019

Modified Files:
src/usr.sbin/autofs: automountd.8

Log Message:
autofs: Add missing description for automountd option -T


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/autofs/automountd.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/autofs/automountd.8
diff -u src/usr.sbin/autofs/automountd.8:1.4 src/usr.sbin/autofs/automountd.8:1.5
--- src/usr.sbin/autofs/automountd.8:1.4	Thu Nov 21 15:24:17 2019
+++ src/usr.sbin/autofs/automountd.8	Mon Nov 25 16:57:09 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: automountd.8,v 1.4 2019/11/21 15:24:17 tkusumi Exp $
+.\" $NetBSD: automountd.8,v 1.5 2019/11/25 16:57:09 tkusumi Exp $
 .\"
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2016 The DragonFly Project
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 25, 2017
+.Dd November 26, 2019
 .Dt AUTOMOUNTD 8
 .Os
 .Sh NAME
@@ -85,6 +85,9 @@ The default is 30.
 Specify mount options.
 Options specified here will be overridden by options entered in maps or
 .Xr auto_master 5 .
+.It Fl T
+Increase verbosity.
+For compatibility with other implementations, such as OS X.
 .It Fl v
 Increase verbosity.
 .El



CVS commit: src/sys/fs/autofs

2019-11-23 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 23 17:13:46 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs.h autofs_vnops.c

Log Message:
autofs: Remove unused autofs_node::an_vnode_lock

Unlike FreeBSD and DragonFlyBSD, this is unused in NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/fs/autofs/autofs.h
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/autofs/autofs.h
diff -u src/sys/fs/autofs/autofs.h:1.3 src/sys/fs/autofs/autofs.h:1.4
--- src/sys/fs/autofs/autofs.h:1.3	Sat Nov 23 08:00:59 2019
+++ src/sys/fs/autofs/autofs.h	Sat Nov 23 17:13:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: autofs.h,v 1.3 2019/11/23 08:00:59 tkusumi Exp $	*/
+/*	$NetBSD: autofs.h,v 1.4 2019/11/23 17:13:46 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -111,7 +111,6 @@ struct autofs_node {
 	autofs_node)		an_children;
 	struct autofs_mount		*an_mount;
 	struct vnode			*an_vnode;
-	kmutex_t			an_vnode_lock;
 	boolan_cached;
 	boolan_wildcards;
 	struct callout			an_callout;

Index: src/sys/fs/autofs/autofs_vnops.c
diff -u src/sys/fs/autofs/autofs_vnops.c:1.2 src/sys/fs/autofs/autofs_vnops.c:1.3
--- src/sys/fs/autofs/autofs_vnops.c:1.2	Sat Nov 23 15:17:46 2019
+++ src/sys/fs/autofs/autofs_vnops.c	Sat Nov 23 17:13:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: autofs_vnops.c,v 1.2 2019/11/23 15:17:46 tkusumi Exp $	*/
+/*	$NetBSD: autofs_vnops.c,v 1.3 2019/11/23 17:13:46 tkusumi Exp $	*/
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
  * Copyright (c) 2016 The DragonFly Project
@@ -34,7 +34,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.2 2019/11/23 15:17:46 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.3 2019/11/23 17:13:46 tkusumi Exp $");
 
 #include "autofs.h"
 
@@ -578,10 +578,8 @@ autofs_reclaim(void *v)
 	 * We do not free autofs_node here; instead we are
 	 * destroying them in autofs_node_delete().
 	 */
-	mutex_enter(>an_vnode_lock);
 	anp->an_vnode = NULL;
 	vp->v_data = NULL;
-	mutex_exit(>an_vnode_lock);
 
 	return 0;
 }
@@ -629,7 +627,6 @@ autofs_node_new(struct autofs_node *pare
 	anp->an_name = autofs_strndup(name, namelen, KM_SLEEP);
 	anp->an_ino = amp->am_last_ino++;
 	callout_init(>an_callout, 0);
-	mutex_init(>an_vnode_lock, MUTEX_DEFAULT, IPL_NONE);
 	getnanotime(>an_ctime);
 	anp->an_parent = parent;
 	anp->an_mount = amp;
@@ -681,7 +678,6 @@ autofs_node_delete(struct autofs_node *a
 	if (anp->an_parent)
 		RB_REMOVE(autofs_node_tree, >an_parent->an_children, anp);
 
-	mutex_destroy(>an_vnode_lock);
 	kmem_strfree(anp->an_name);
 	pool_put(_node_pool, anp);
 }



CVS commit: src/sys/fs/autofs

2019-11-23 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 23 17:13:46 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs.h autofs_vnops.c

Log Message:
autofs: Remove unused autofs_node::an_vnode_lock

Unlike FreeBSD and DragonFlyBSD, this is unused in NetBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/fs/autofs/autofs.h
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/autofs

2019-11-23 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 23 15:17:46 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs_vfsops.c autofs_vnops.c

Log Message:
autofs: Don't calculate dirent reclen twice

Taken-from: DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/fs/autofs/autofs_vfsops.c
cvs rdiff -u -r1.1 -r1.2 src/sys/fs/autofs/autofs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/autofs

2019-11-23 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 23 15:17:46 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs_vfsops.c autofs_vnops.c

Log Message:
autofs: Don't calculate dirent reclen twice

Taken-from: DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/fs/autofs/autofs_vfsops.c
cvs rdiff -u -r1.1 -r1.2 src/sys/fs/autofs/autofs_vnops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/autofs/autofs_vfsops.c
diff -u src/sys/fs/autofs/autofs_vfsops.c:1.6 src/sys/fs/autofs/autofs_vfsops.c:1.7
--- src/sys/fs/autofs/autofs_vfsops.c:1.6	Sat Nov 16 09:22:00 2019
+++ src/sys/fs/autofs/autofs_vfsops.c	Sat Nov 23 15:17:46 2019
@@ -33,7 +33,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.6 2019/11/16 09:22:00 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.7 2019/11/23 15:17:46 tkusumi Exp $");
 
 
 #include "autofs.h"
@@ -74,6 +74,7 @@ autofs_init(void)
 static void
 autofs_done(void)
 {
+
 	KASSERT(autofs_softc);
 	KASSERT(!autofs_softc->sc_dev_opened);
 

Index: src/sys/fs/autofs/autofs_vnops.c
diff -u src/sys/fs/autofs/autofs_vnops.c:1.1 src/sys/fs/autofs/autofs_vnops.c:1.2
--- src/sys/fs/autofs/autofs_vnops.c:1.1	Tue Jan  9 03:31:14 2018
+++ src/sys/fs/autofs/autofs_vnops.c	Sat Nov 23 15:17:46 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: autofs_vnops.c,v 1.1 2018/01/09 03:31:14 christos Exp $	*/
+/*	$NetBSD: autofs_vnops.c,v 1.2 2019/11/23 15:17:46 tkusumi Exp $	*/
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
  * Copyright (c) 2016 The DragonFly Project
@@ -34,7 +34,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.1 2018/01/09 03:31:14 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vnops.c,v 1.2 2019/11/23 15:17:46 tkusumi Exp $");
 
 #include "autofs.h"
 
@@ -413,8 +413,7 @@ autofs_print(void *v)
 }
 
 static int
-autofs_readdir_one(struct uio *uio, const char *name, ino_t ino,
-size_t *reclenp)
+autofs_readdir_one(struct uio *uio, const char *name, ino_t ino)
 {
 	struct dirent dirent;
 
@@ -424,9 +423,6 @@ autofs_readdir_one(struct uio *uio, cons
 	dirent.d_namlen = strlen(dirent.d_name);
 	dirent.d_reclen = _DIRENT_SIZE();
 
-	if (reclenp)
-		*reclenp = dirent.d_reclen;
-
 	if (!uio)
 		return 0;
 
@@ -439,11 +435,12 @@ autofs_readdir_one(struct uio *uio, cons
 static size_t
 autofs_dirent_reclen(const char *name)
 {
-	size_t reclen;
+	struct dirent dirent;
 
-	(void)autofs_readdir_one(NULL, name, -1, );
+	strlcpy(dirent.d_name, name, sizeof(dirent.d_name));
+	dirent.d_namlen = strlen(dirent.d_name);
 
-	return reclen;
+	return _DIRENT_SIZE();
 }
 
 static int
@@ -463,7 +460,7 @@ autofs_readdir(void *v)
 	struct autofs_mount *amp = VFSTOAUTOFS(vp->v_mount);
 	struct autofs_node *anp = VTOI(vp);
 	struct autofs_node *child;
-	size_t reclen, reclens;
+	size_t reclens;
 	int error;
 
 	if (vp->v_type != VDIR)
@@ -496,7 +493,7 @@ autofs_readdir(void *v)
 	 * Write out the directory entry for ".".
 	 */
 	if (uio->uio_offset == 0) {
-		error = autofs_readdir_one(uio, ".", anp->an_ino, );
+		error = autofs_readdir_one(uio, ".", anp->an_ino);
 		if (error)
 			goto out;
 	}
@@ -509,8 +506,7 @@ autofs_readdir(void *v)
 		if (uio->uio_offset != reclens)
 			return EINVAL;
 		error = autofs_readdir_one(uio, "..",
-		(anp->an_parent ? anp->an_parent->an_ino : anp->an_ino),
-		);
+		anp->an_parent ? anp->an_parent->an_ino : anp->an_ino);
 		if (error)
 			goto out;
 	}
@@ -538,9 +534,8 @@ autofs_readdir(void *v)
 			return EINVAL;
 		}
 
-		error = autofs_readdir_one(uio, child->an_name,
-		child->an_ino, );
-		reclens += reclen;
+		error = autofs_readdir_one(uio, child->an_name, child->an_ino);
+		reclens += autofs_dirent_reclen(child->an_name);
 		if (error) {
 			mutex_exit(>am_lock);
 			goto out;
@@ -562,7 +557,7 @@ out:
 	/*
 	 * Don't return an error if we managed to copy out some entries.
 	 */
-	if (uio->uio_resid < reclen)
+	if (uio->uio_resid < initial_resid)
 		return 0;
 
 	return error;



CVS commit: src/sys/fs/autofs

2019-11-23 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 23 08:30:39 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs_mount.h

Log Message:
autofs: Fix a comment on autofs_args

mount_autofs(8) also uses this.
mount_autofs(8) was added by NetBSD as an optional command (not needed to use 
autofs).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs_mount.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/autofs/autofs_mount.h
diff -u src/sys/fs/autofs/autofs_mount.h:1.2 src/sys/fs/autofs/autofs_mount.h:1.3
--- src/sys/fs/autofs/autofs_mount.h:1.2	Sun Jan 14 22:43:18 2018
+++ src/sys/fs/autofs/autofs_mount.h	Sat Nov 23 08:30:39 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: autofs_mount.h,v 1.2 2018/01/14 22:43:18 christos Exp $	*/
+/*	$NetBSD: autofs_mount.h,v 1.3 2019/11/23 08:30:39 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -36,7 +36,6 @@
 
 /*
  * Arguments to mount autofs filesystem.
- * This structure should only be used by automount(8).
  */
 struct autofs_args {
 	char	*from;



CVS commit: src/sys/fs/autofs

2019-11-23 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 23 08:30:39 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs_mount.h

Log Message:
autofs: Fix a comment on autofs_args

mount_autofs(8) also uses this.
mount_autofs(8) was added by NetBSD as an optional command (not needed to use 
autofs).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs_mount.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/autofs

2019-11-23 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 23 08:00:59 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs.h

Log Message:
autofs: u_int -> unsigned int


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/autofs

2019-11-23 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 23 08:00:59 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs.h

Log Message:
autofs: u_int -> unsigned int


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/fs/autofs/autofs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/autofs/autofs.h
diff -u src/sys/fs/autofs/autofs.h:1.2 src/sys/fs/autofs/autofs.h:1.3
--- src/sys/fs/autofs/autofs.h:1.2	Sat Nov 23 07:38:03 2019
+++ src/sys/fs/autofs/autofs.h	Sat Nov 23 08:00:59 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: autofs.h,v 1.2 2019/11/23 07:38:03 tkusumi Exp $	*/
+/*	$NetBSD: autofs.h,v 1.3 2019/11/23 08:00:59 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -145,7 +145,7 @@ struct autofs_request {
 	charar_key[AUTOFS_MAXPATHLEN];
 	charar_options[AUTOFS_MAXPATHLEN];
 	struct callout			ar_callout;
-	volatile u_int			ar_refcount;
+	volatile unsigned int		ar_refcount;
 };
 
 struct autofs_softc {



CVS commit: src/sys/fs/autofs

2019-11-22 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 23 07:38:03 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs.h

Log Message:
autofs: Drop unused autofs_mount field which originates from FreeBSD

Taken-from: DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/fs/autofs/autofs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/autofs/autofs.h
diff -u src/sys/fs/autofs/autofs.h:1.1 src/sys/fs/autofs/autofs.h:1.2
--- src/sys/fs/autofs/autofs.h:1.1	Tue Jan  9 03:31:14 2018
+++ src/sys/fs/autofs/autofs.h	Sat Nov 23 07:38:03 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: autofs.h,v 1.1 2018/01/09 03:31:14 christos Exp $	*/
+/*	$NetBSD: autofs.h,v 1.2 2019/11/23 07:38:03 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -120,7 +120,6 @@ struct autofs_node {
 };
 
 struct autofs_mount {
-	TAILQ_ENTRY(autofs_mount)	am_next;
 	struct autofs_node		*am_root;
 	struct mount			*am_mp;
 	kmutex_t			am_lock;



CVS commit: src/sys/fs/autofs

2019-11-22 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 23 07:38:03 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs.h

Log Message:
autofs: Drop unused autofs_mount field which originates from FreeBSD

Taken-from: DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/fs/autofs/autofs.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/autofs

2019-11-21 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Nov 21 16:45:05 UTC 2019

Modified Files:
src/usr.sbin/autofs: autounmountd.c

Log Message:
autofs: Change autounmountd(8) to use time_t for duration instead of double

The commit log from FreeBSD.
--
autounmountd(8) uses doubles to handle mount time durations.  However,
it must convert to integer types, time_t in particular, to do anything
meaningful.  Additionally, even though it's a floating-point value in
seconds, the sub-seconds component is never used, so it's unnecessary.

Switching type to time_t fixes an assertion on powerpc64, which checks
that a sleep value that's not -1.0 is greater than 0.  On powerpc64, it
happens that the value of -1.0 gets loaded as a float (perhaps a bug in
gcc), but gets compared to a double.  This compares as false, so follows
through the 'sleep != -1.0' path, and fails the assert.  Since the
sub-second component isn't used in the double, just drop it and deal
with whole-integer seconds.
--

Taken-from: FreeBSD and DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/autofs/autounmountd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/autofs

2019-11-21 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Nov 21 16:45:05 UTC 2019

Modified Files:
src/usr.sbin/autofs: autounmountd.c

Log Message:
autofs: Change autounmountd(8) to use time_t for duration instead of double

The commit log from FreeBSD.
--
autounmountd(8) uses doubles to handle mount time durations.  However,
it must convert to integer types, time_t in particular, to do anything
meaningful.  Additionally, even though it's a floating-point value in
seconds, the sub-seconds component is never used, so it's unnecessary.

Switching type to time_t fixes an assertion on powerpc64, which checks
that a sleep value that's not -1.0 is greater than 0.  On powerpc64, it
happens that the value of -1.0 gets loaded as a float (perhaps a bug in
gcc), but gets compared to a double.  This compares as false, so follows
through the 'sleep != -1.0' path, and fails the assert.  Since the
sub-second component isn't used in the double, just drop it and deal
with whole-integer seconds.
--

Taken-from: FreeBSD and DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/autofs/autounmountd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/autofs/autounmountd.c
diff -u src/usr.sbin/autofs/autounmountd.c:1.1 src/usr.sbin/autofs/autounmountd.c:1.2
--- src/usr.sbin/autofs/autounmountd.c:1.1	Tue Jan  9 03:31:15 2018
+++ src/usr.sbin/autofs/autounmountd.c	Thu Nov 21 16:45:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: autounmountd.c,v 1.1 2018/01/09 03:31:15 christos Exp $	*/
+/*	$NetBSD: autounmountd.c,v 1.2 2019/11/21 16:45:05 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  *
  */
 #include 
-__RCSID("$NetBSD: autounmountd.c,v 1.1 2018/01/09 03:31:15 christos Exp $");
+__RCSID("$NetBSD: autounmountd.c,v 1.2 2019/11/21 16:45:05 tkusumi Exp $");
 
 #include 
 #include 
@@ -175,12 +175,12 @@ do_unmount(const fsid_t fsid __unused, c
 	return error;
 }
 
-static double
-expire_automounted(double expiration_time)
+static time_t
+expire_automounted(time_t expiration_time)
 {
 	struct automounted_fs *af, *tmpaf;
 	time_t now;
-	double mounted_for, mounted_max = -1.0;
+	time_t mounted_for, mounted_max = -1;
 	int error;
 
 	now = time(NULL);
@@ -188,14 +188,14 @@ expire_automounted(double expiration_tim
 	log_debugx("expiring automounted filesystems");
 
 	TAILQ_FOREACH_SAFE(af, , af_next, tmpaf) {
-		mounted_for = difftime(now, af->af_mount_time);
+		mounted_for = (time_t)difftime(now, af->af_mount_time);
 
 		if (mounted_for < expiration_time) {
 			log_debugx("skipping %s (FSID:%d:%d), mounted "
-			"for %.0f seconds", af->af_mountpoint,
+			"for %jd seconds", af->af_mountpoint,
 			af->af_fsid.__fsid_val[0],
 			af->af_fsid.__fsid_val[1],
-			mounted_for);
+			(intmax_t)mounted_for);
 
 			if (mounted_for > mounted_max)
 mounted_max = mounted_for;
@@ -204,9 +204,9 @@ expire_automounted(double expiration_tim
 		}
 
 		log_debugx("filesystem mounted on %s (FSID:%d:%d), "
-		"was mounted for %.0f seconds; unmounting",
+		"was mounted for %jd seconds; unmounting",
 		af->af_mountpoint, af->af_fsid.__fsid_val[0],
-		af->af_fsid.__fsid_val[1], mounted_for);
+		af->af_fsid.__fsid_val[1], (intmax_t)mounted_for);
 		error = do_unmount(af->af_fsid, af->af_mountpoint);
 		if (error != 0) {
 			if (mounted_for > mounted_max)
@@ -227,19 +227,19 @@ usage_autounmountd(void)
 }
 
 static void
-do_wait(int kq, double sleep_time)
+do_wait(int kq, time_t sleep_time)
 {
 	struct timespec timeout;
 	struct kevent unused;
 	int nevents;
 
-	if (sleep_time != -1.0) {
-		assert(sleep_time > 0.0);
+	if (sleep_time != -1) {
+		assert(sleep_time > 0);
 		timeout.tv_sec = (int)sleep_time;
 		timeout.tv_nsec = 0;
 
-		log_debugx("waiting for filesystem event for %.0f seconds",
-		sleep_time);
+		log_debugx("waiting for filesystem event for %jd seconds",
+		(intmax_t)sleep_time);
 		nevents = kevent(kq, NULL, 0, , 1, );
 	} else {
 		log_debugx("waiting for filesystem event");
@@ -253,7 +253,7 @@ do_wait(int kq, double sleep_time)
 
 	if (nevents == 0) {
 		log_debugx("timeout reached");
-		assert(sleep_time > 0.0);
+		assert(sleep_time > 0);
 	} else {
 		log_debugx("got filesystem event");
 	}
@@ -264,7 +264,7 @@ main_autounmountd(int argc, char **argv)
 {
 	struct kevent event;
 	int ch, debug = 0, error, kq;
-	double expiration_time = 600, retry_time = 600, mounted_max, sleep_time;
+	time_t expiration_time = 600, retry_time = 600, mounted_max, sleep_time;
 	bool dont_daemonize = false;
 
 	while ((ch = getopt(argc, argv, "dr:t:v")) != -1) {
@@ -333,19 +333,18 @@ main_autounmountd(int argc, char **argv)
 	for (;;) {
 		refresh_automounted();
 		mounted_max = expire_automounted(expiration_time);
-		if (mounted_max == -1.0) {
+		if (mounted_max == -1) {
 			sleep_time = mounted_max;
 			log_debugx("no filesystems 

CVS commit: src

2019-11-21 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Nov 21 15:24:18 UTC 2019

Modified Files:
src/share/man/man5: autofs.5
src/usr.sbin/autofs: auto_master.5 automount.8 automountd.8
autounmountd.8
src/usr.sbin/fstyp: fstyp.8

Log Message:
autofs: Change my email address in man pages to netbsd.org


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man5/autofs.5
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/autofs/auto_master.5
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/autofs/automount.8
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/autofs/automountd.8 \
src/usr.sbin/autofs/autounmountd.8
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/fstyp/fstyp.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man5/autofs.5
diff -u src/share/man/man5/autofs.5:1.4 src/share/man/man5/autofs.5:1.5
--- src/share/man/man5/autofs.5:1.4	Mon Jan 22 09:45:32 2018
+++ src/share/man/man5/autofs.5	Thu Nov 21 15:24:17 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: autofs.5,v 1.4 2018/01/22 09:45:32 kamil Exp $
+.\" $NetBSD: autofs.5,v 1.5 2019/11/21 15:24:17 tkusumi Exp $
 .\"
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2016 The DragonFly Project
@@ -122,4 +122,4 @@ was ported to
 and
 .Nx
 by
-.An Tomohiro Kusumi Aq Mt kusumi.tomoh...@gmail.com .
+.An Tomohiro Kusumi Aq Mt tkus...@netbsd.org .

Index: src/usr.sbin/autofs/auto_master.5
diff -u src/usr.sbin/autofs/auto_master.5:1.7 src/usr.sbin/autofs/auto_master.5:1.8
--- src/usr.sbin/autofs/auto_master.5:1.7	Sat Nov 16 12:26:54 2019
+++ src/usr.sbin/autofs/auto_master.5	Thu Nov 21 15:24:17 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: auto_master.5,v 1.7 2019/11/16 12:26:54 tkusumi Exp $
+.\"	$NetBSD: auto_master.5,v 1.8 2019/11/21 15:24:17 tkusumi Exp $
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2016 The DragonFly Project
 .\" Copyright (c) 2014 The FreeBSD Foundation
@@ -393,7 +393,7 @@ configuration file functionality was por
 and
 .Nx
 by
-.An Tomohiro Kusumi Aq Mt kusumi.tomoh...@gmail.com .
+.An Tomohiro Kusumi Aq Mt tkus...@netbsd.org .
 .Sh BUGS
 The
 .Li -media

Index: src/usr.sbin/autofs/automount.8
diff -u src/usr.sbin/autofs/automount.8:1.5 src/usr.sbin/autofs/automount.8:1.6
--- src/usr.sbin/autofs/automount.8:1.5	Sun Jan 14 03:14:46 2018
+++ src/usr.sbin/autofs/automount.8	Thu Nov 21 15:24:17 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: automount.8,v 1.5 2018/01/14 03:14:46 uwe Exp $
+.\"	$NetBSD: automount.8,v 1.6 2019/11/21 15:24:17 tkusumi Exp $
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2016 The DragonFly Project
 .\" Copyright (c) 2014 The FreeBSD Foundation
@@ -131,4 +131,4 @@ was ported to
 and
 .Nx
 by
-.An Tomohiro Kusumi Aq Mt kusumi.tomoh...@gmail.com .
+.An Tomohiro Kusumi Aq Mt tkus...@netbsd.org .

Index: src/usr.sbin/autofs/automountd.8
diff -u src/usr.sbin/autofs/automountd.8:1.3 src/usr.sbin/autofs/automountd.8:1.4
--- src/usr.sbin/autofs/automountd.8:1.3	Sun Jan 14 03:17:28 2018
+++ src/usr.sbin/autofs/automountd.8	Thu Nov 21 15:24:17 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: automountd.8,v 1.3 2018/01/14 03:17:28 uwe Exp $
+.\" $NetBSD: automountd.8,v 1.4 2019/11/21 15:24:17 tkusumi Exp $
 .\"
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2016 The DragonFly Project
@@ -124,4 +124,4 @@ was ported to
 and
 .Nx
 by
-.An Tomohiro Kusumi Aq Mt kusumi.tomoh...@gmail.com .
+.An Tomohiro Kusumi Aq Mt tkus...@netbsd.org .
Index: src/usr.sbin/autofs/autounmountd.8
diff -u src/usr.sbin/autofs/autounmountd.8:1.3 src/usr.sbin/autofs/autounmountd.8:1.4
--- src/usr.sbin/autofs/autounmountd.8:1.3	Sun Jan 14 03:17:28 2018
+++ src/usr.sbin/autofs/autounmountd.8	Thu Nov 21 15:24:17 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: autounmountd.8,v 1.3 2018/01/14 03:17:28 uwe Exp $
+.\" $NetBSD: autounmountd.8,v 1.4 2019/11/21 15:24:17 tkusumi Exp $
 .\"
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2016 The DragonFly Project
@@ -110,4 +110,4 @@ was ported to
 and
 .Nx
 by
-.An Tomohiro Kusumi Aq Mt kusumi.tomoh...@gmail.com .
+.An Tomohiro Kusumi Aq Mt tkus...@netbsd.org .

Index: src/usr.sbin/fstyp/fstyp.8
diff -u src/usr.sbin/fstyp/fstyp.8:1.3 src/usr.sbin/fstyp/fstyp.8:1.4
--- src/usr.sbin/fstyp/fstyp.8:1.3	Mon Nov 18 14:53:34 2019
+++ src/usr.sbin/fstyp/fstyp.8	Thu Nov 21 15:24:17 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: fstyp.8,v 1.3 2019/11/18 14:53:34 tkusumi Exp $
+.\" $NetBSD: fstyp.8,v 1.4 2019/11/21 15:24:17 tkusumi Exp $
 .\"
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2016 The DragonFly Project
@@ -142,7 +142,7 @@ utility was ported to
 and
 .Nx
 by
-.An Tomohiro Kusumi Aq Mt kusumi.tomoh...@gmail.com .
+.An Tomohiro Kusumi Aq Mt tkus...@netbsd.org .
 .Sh BUGS
 geli and hammer are currently unsupported on
 .Nx .



CVS commit: src

2019-11-21 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Nov 21 15:24:18 UTC 2019

Modified Files:
src/share/man/man5: autofs.5
src/usr.sbin/autofs: auto_master.5 automount.8 automountd.8
autounmountd.8
src/usr.sbin/fstyp: fstyp.8

Log Message:
autofs: Change my email address in man pages to netbsd.org


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/share/man/man5/autofs.5
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/autofs/auto_master.5
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/autofs/automount.8
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/autofs/automountd.8 \
src/usr.sbin/autofs/autounmountd.8
cvs rdiff -u -r1.3 -r1.4 src/usr.sbin/fstyp/fstyp.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/mount_autofs

2019-11-20 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Wed Nov 20 17:29:51 UTC 2019

Modified Files:
src/sbin/mount_autofs: mount_autofs.8

Log Message:
mount_autofs: Sync man page with DragonFlyBSD

Taken-from: DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sbin/mount_autofs/mount_autofs.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/mount_autofs/mount_autofs.8
diff -u src/sbin/mount_autofs/mount_autofs.8:1.6 src/sbin/mount_autofs/mount_autofs.8:1.7
--- src/sbin/mount_autofs/mount_autofs.8:1.6	Wed Jan 24 12:04:47 2018
+++ src/sbin/mount_autofs/mount_autofs.8	Wed Nov 20 17:29:51 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: mount_autofs.8,v 1.6 2018/01/24 12:04:47 uwe Exp $
+.\" $NetBSD: mount_autofs.8,v 1.7 2019/11/20 17:29:51 tkusumi Exp $
 .\"
 .\" Copyright (c) 2018 The DragonFly Project
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd January 23, 2018
+.Dd November 21, 2019
 .Dt MOUNT_AUTOFS 8
 .Os
 .Sh NAME
@@ -33,9 +33,9 @@
 .Sh SYNOPSIS
 .Nm
 .Op Fl f Ar from
-.Op Fl O Ar master_options
 .Op Fl o Ar options
-.Op Fl p Ar prefix
+.Op Fl O Ar master_options
+.Op Fl p Ar master_prefix
 .Ar autofs
 .Ar mount_point
 .Sh DESCRIPTION
@@ -45,6 +45,16 @@ command should not usually be called by 
 Use
 .Xr automount 8
 instead.
+.Xr autofs 5
+is mountable using
+.Xr automount 8
+which incorporates
+.Xr auto_master 5
+parser, without having to specify
+.Xr autofs 5
+mount options via command line.
+.\" and that was the original intention of FreeBSD/autofs.
+.\" This is a low level version without auto_master(5) involved.
 .Pp
 The
 .Nm
@@ -93,6 +103,7 @@ prefix, below which the file system(s) w
 .El
 .Sh SEE ALSO
 .Xr autofs 5 ,
+.Xr auto_master 5 ,
 .Xr fstab 5 ,
 .Xr automount 8 ,
 .Xr mount 8



CVS commit: src/sbin/mount_autofs

2019-11-20 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Wed Nov 20 17:29:51 UTC 2019

Modified Files:
src/sbin/mount_autofs: mount_autofs.8

Log Message:
mount_autofs: Sync man page with DragonFlyBSD

Taken-from: DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sbin/mount_autofs/mount_autofs.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/mount_autofs

2019-11-20 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Wed Nov 20 17:18:35 UTC 2019

Modified Files:
src/sbin/mount_autofs: mount_autofs.c

Log Message:
mount_autofs: Remove blank line with trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/mount_autofs/mount_autofs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/mount_autofs

2019-11-20 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Wed Nov 20 17:18:35 UTC 2019

Modified Files:
src/sbin/mount_autofs: mount_autofs.c

Log Message:
mount_autofs: Remove blank line with trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sbin/mount_autofs/mount_autofs.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/mount_autofs/mount_autofs.c
diff -u src/sbin/mount_autofs/mount_autofs.c:1.3 src/sbin/mount_autofs/mount_autofs.c:1.4
--- src/sbin/mount_autofs/mount_autofs.c:1.3	Tue Jan 23 15:02:03 2018
+++ src/sbin/mount_autofs/mount_autofs.c	Wed Nov 20 17:18:35 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount_autofs.c,v 1.3 2018/01/23 15:02:03 wiz Exp $	*/
+/*	$NetBSD: mount_autofs.c,v 1.4 2019/11/20 17:18:35 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 #include 
 #ifndef lint
-__RCSID("$NetBSD: mount_autofs.c,v 1.3 2018/01/23 15:02:03 wiz Exp $");
+__RCSID("$NetBSD: mount_autofs.c,v 1.4 2019/11/20 17:18:35 tkusumi Exp $");
 #endif /* not lint */
 
 #include 
@@ -91,7 +91,6 @@ mount_autofs_parseargs(int argc, char *a
 		case 'p':
 			strlcpy(am->master_prefix, optarg, MAXPATHLEN);
 			break;
-			
 		case '?':
 		default:
 			usage();



CVS commit: src/usr.sbin/fstyp

2019-11-18 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Mon Nov 18 14:53:34 UTC 2019

Modified Files:
src/usr.sbin/fstyp: Makefile fstyp.8 fstyp.c fstyp.h
Added Files:
src/usr.sbin/fstyp: exfat.c

Log Message:
fstyp: Add exFAT support

Taken-from: FreeBSD and DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/fstyp/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/fstyp/exfat.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/fstyp.8 \
src/usr.sbin/fstyp/fstyp.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/fstyp/fstyp.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/fstyp/Makefile
diff -u src/usr.sbin/fstyp/Makefile:1.5 src/usr.sbin/fstyp/Makefile:1.6
--- src/usr.sbin/fstyp/Makefile:1.5	Mon Jun 24 08:27:21 2019
+++ src/usr.sbin/fstyp/Makefile	Mon Nov 18 14:53:34 2019
@@ -1,9 +1,9 @@
-#	$NetBSD: Makefile,v 1.5 2019/06/24 08:27:21 hannken Exp $
+#	$NetBSD: Makefile,v 1.6 2019/11/18 14:53:34 tkusumi Exp $
 
 .include 
 
 PROG=	fstyp
-SRCS=	cd9660.c ext2fs.c fstyp.c msdosfs.c ntfs.c ufs.c
+SRCS=	cd9660.c exfat.c ext2fs.c fstyp.c msdosfs.c ntfs.c ufs.c
 
 .if (${MKZFS} != "no")
 SRCS+=	zfs.c

Index: src/usr.sbin/fstyp/fstyp.8
diff -u src/usr.sbin/fstyp/fstyp.8:1.2 src/usr.sbin/fstyp/fstyp.8:1.3
--- src/usr.sbin/fstyp/fstyp.8:1.2	Tue Jan  9 09:41:29 2018
+++ src/usr.sbin/fstyp/fstyp.8	Mon Nov 18 14:53:34 2019
@@ -1,4 +1,4 @@
-.\" $NetBSD: fstyp.8,v 1.2 2018/01/09 09:41:29 wiz Exp $
+.\" $NetBSD: fstyp.8,v 1.3 2019/11/18 14:53:34 tkusumi Exp $
 .\"
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2016 The DragonFly Project
@@ -34,7 +34,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 25, 2017
+.Dd November 19, 2019
 .Dt FSTYP 8
 .Os
 .Sh NAME
@@ -48,7 +48,7 @@
 The
 .Nm
 utility is used to determine the file system type on a given device.
-It can recognize ISO-9660, Ext2, FAT, NTFS, and UFS file systems.
+It can recognize ISO-9660, exFAT, Ext2, FAT, NTFS, and UFS file systems.
 When the
 .Fl u
 flag is specified,
@@ -64,6 +64,8 @@ as, respectively:
 .It
 cd9660
 .It
+exfat
+.It
 ext2fs
 .It
 msdosfs
Index: src/usr.sbin/fstyp/fstyp.c
diff -u src/usr.sbin/fstyp/fstyp.c:1.2 src/usr.sbin/fstyp/fstyp.c:1.3
--- src/usr.sbin/fstyp/fstyp.c:1.2	Tue Jan  9 10:47:57 2018
+++ src/usr.sbin/fstyp/fstyp.c	Mon Nov 18 14:53:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstyp.c,v 1.2 2018/01/09 10:47:57 martin Exp $	*/
+/*	$NetBSD: fstyp.c,v 1.3 2019/11/18 14:53:34 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  *
  */
 #include 
-__RCSID("$NetBSD: fstyp.c,v 1.2 2018/01/09 10:47:57 martin Exp $");
+__RCSID("$NetBSD: fstyp.c,v 1.3 2019/11/18 14:53:34 tkusumi Exp $");
 
 #include 
 #include 
@@ -64,6 +64,7 @@ static struct {
 	bool		unmountable;
 } fstypes[] = {
 	{ "cd9660", _cd9660, false },
+	{ "exfat", _exfat, false },
 	{ "ext2fs", _ext2fs, false },
 	{ "msdosfs", _msdosfs, false },
 	{ "ntfs", _ntfs, false },

Index: src/usr.sbin/fstyp/fstyp.h
diff -u src/usr.sbin/fstyp/fstyp.h:1.1 src/usr.sbin/fstyp/fstyp.h:1.2
--- src/usr.sbin/fstyp/fstyp.h:1.1	Tue Jan  9 03:31:15 2018
+++ src/usr.sbin/fstyp/fstyp.h	Mon Nov 18 14:53:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: fstyp.h,v 1.1 2018/01/09 03:31:15 christos Exp $	*/
+/*	$NetBSD: fstyp.h,v 1.2 2019/11/18 14:53:34 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -44,6 +44,7 @@ char	*checked_strdup(const char *);
 void	rtrim(char *, size_t);
 
 int	fstyp_cd9660(FILE *, char *, size_t);
+int	fstyp_exfat(FILE *fp, char *label, size_t size);
 int	fstyp_ext2fs(FILE *, char *, size_t);
 int	fstyp_msdosfs(FILE *, char *, size_t);
 int	fstyp_ntfs(FILE *, char *, size_t);

Added files:

Index: src/usr.sbin/fstyp/exfat.c
diff -u /dev/null src/usr.sbin/fstyp/exfat.c:1.1
--- /dev/null	Mon Nov 18 14:53:34 2019
+++ src/usr.sbin/fstyp/exfat.c	Mon Nov 18 14:53:34 2019
@@ -0,0 +1,78 @@
+/*	$NetBSD: exfat.c,v 1.1 2019/11/18 14:53:34 tkusumi Exp $	*/
+
+/*
+ * Copyright (c) 2017 Conrad Meyer 
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 

CVS commit: src/usr.sbin/fstyp

2019-11-18 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Mon Nov 18 14:53:34 UTC 2019

Modified Files:
src/usr.sbin/fstyp: Makefile fstyp.8 fstyp.c fstyp.h
Added Files:
src/usr.sbin/fstyp: exfat.c

Log Message:
fstyp: Add exFAT support

Taken-from: FreeBSD and DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/fstyp/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.sbin/fstyp/exfat.c
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/fstyp/fstyp.8 \
src/usr.sbin/fstyp/fstyp.c
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/fstyp/fstyp.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/autofs

2019-11-16 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 16 12:26:54 UTC 2019

Modified Files:
src/usr.sbin/autofs: auto_master.5 defined.c

Log Message:
autofs: Support DOLLAR for $ literal

taken-from FreeBSD and DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/autofs/auto_master.5
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/autofs/defined.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/autofs/auto_master.5
diff -u src/usr.sbin/autofs/auto_master.5:1.6 src/usr.sbin/autofs/auto_master.5:1.7
--- src/usr.sbin/autofs/auto_master.5:1.6	Thu Jan 25 19:15:10 2018
+++ src/usr.sbin/autofs/auto_master.5	Sat Nov 16 12:26:54 2019
@@ -1,4 +1,4 @@
-.\"	$NetBSD: auto_master.5,v 1.6 2018/01/25 19:15:10 uwe Exp $
+.\"	$NetBSD: auto_master.5,v 1.7 2019/11/16 12:26:54 tkusumi Exp $
 .\" Copyright (c) 2017 The NetBSD Foundation, Inc.
 .\" Copyright (c) 2016 The DragonFly Project
 .\" Copyright (c) 2014 The FreeBSD Foundation
@@ -33,7 +33,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 25, 2017
+.Dd November 16, 2019
 .Dt AUTO_MASTER 5
 .Os
 .Sh NAME
@@ -195,6 +195,8 @@ Expands to the output of
 .It Dv CPU
 Same as
 .Dv ARCH .
+.It Dv DOLLAR
+A literal $ sign.
 .It Dv HOST
 Expands to the output of
 .Li "uname -n" .

Index: src/usr.sbin/autofs/defined.c
diff -u src/usr.sbin/autofs/defined.c:1.1 src/usr.sbin/autofs/defined.c:1.2
--- src/usr.sbin/autofs/defined.c:1.1	Tue Jan  9 03:31:15 2018
+++ src/usr.sbin/autofs/defined.c	Sat Nov 16 12:26:54 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: defined.c,v 1.1 2018/01/09 03:31:15 christos Exp $	*/
+/*	$NetBSD: defined.c,v 1.2 2019/11/16 12:26:54 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  *
  */
 #include 
-__RCSID("$NetBSD: defined.c,v 1.1 2018/01/09 03:31:15 christos Exp $");
+__RCSID("$NetBSD: defined.c,v 1.2 2019/11/16 12:26:54 tkusumi Exp $");
 
 /*
  * All the "defined" stuff is for handling variables,
@@ -256,6 +256,7 @@ defined_init(void)
 
 	defined_add("ARCH", name.machine);
 	defined_add("CPU", name.machine);
+	defined_add("DOLLAR", "$");
 	defined_add("HOST", name.nodename);
 	defined_add("OSNAME", name.sysname);
 	defined_add("OSREL", name.release);



CVS commit: src/usr.sbin/autofs

2019-11-16 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 16 12:26:54 UTC 2019

Modified Files:
src/usr.sbin/autofs: auto_master.5 defined.c

Log Message:
autofs: Support DOLLAR for $ literal

taken-from FreeBSD and DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/autofs/auto_master.5
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/autofs/defined.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/autofs

2019-11-16 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 16 12:21:06 UTC 2019

Modified Files:
src/usr.sbin/autofs: common.c

Log Message:
autofs: Fix segfault that could occur on "automount -LL"


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/autofs/common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/autofs/common.c
diff -u src/usr.sbin/autofs/common.c:1.2 src/usr.sbin/autofs/common.c:1.3
--- src/usr.sbin/autofs/common.c:1.2	Sat Nov 16 11:56:29 2019
+++ src/usr.sbin/autofs/common.c	Sat Nov 16 12:21:06 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.c,v 1.2 2019/11/16 11:56:29 tkusumi Exp $	*/
+/*	$NetBSD: common.c,v 1.3 2019/11/16 12:21:06 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * $FreeBSD: head/usr.sbin/autofs/common.c 303527 2016-07-30 01:10:05Z bapt $
  */
 #include 
-__RCSID("$NetBSD: common.c,v 1.2 2019/11/16 11:56:29 tkusumi Exp $");
+__RCSID("$NetBSD: common.c,v 1.3 2019/11/16 12:21:06 tkusumi Exp $");
 
 #include 
 #include 
@@ -357,7 +357,7 @@ expand_ampersand(char *string, const cha
 		 * of characters before the '&'.
 		 */
 		before_len = i;
-		//assert(i + 1 < strlen(string));
+		//assert(i < strlen(string));
 
 		ret = asprintf(, "%.*s%s%s",
 		(int)before_len, string, key, string + before_len + 1);
@@ -372,6 +372,8 @@ expand_ampersand(char *string, const cha
 		 */
 		string = expanded;
 		i = before_len + strlen(key);
+		if (i == strlen(string))
+			break;
 		backslashed = false;
 		//assert(i < strlen(string));
 	}



CVS commit: src/usr.sbin/autofs

2019-11-16 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 16 12:21:06 UTC 2019

Modified Files:
src/usr.sbin/autofs: common.c

Log Message:
autofs: Fix segfault that could occur on "automount -LL"


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/autofs/common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/autofs

2019-11-16 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 16 11:56:29 UTC 2019

Modified Files:
src/usr.sbin/autofs: common.c

Log Message:
autofs: Remove unneeded header include

common.c doesn't depend on autofs or its ioctls.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/autofs/common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/autofs

2019-11-16 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 16 11:56:29 UTC 2019

Modified Files:
src/usr.sbin/autofs: common.c

Log Message:
autofs: Remove unneeded header include

common.c doesn't depend on autofs or its ioctls.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.sbin/autofs/common.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/autofs/common.c
diff -u src/usr.sbin/autofs/common.c:1.1 src/usr.sbin/autofs/common.c:1.2
--- src/usr.sbin/autofs/common.c:1.1	Tue Jan  9 03:31:15 2018
+++ src/usr.sbin/autofs/common.c	Sat Nov 16 11:56:29 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: common.c,v 1.1 2018/01/09 03:31:15 christos Exp $	*/
+/*	$NetBSD: common.c,v 1.2 2019/11/16 11:56:29 tkusumi Exp $	*/
 
 /*-
  * Copyright (c) 2017 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * $FreeBSD: head/usr.sbin/autofs/common.c 303527 2016-07-30 01:10:05Z bapt $
  */
 #include 
-__RCSID("$NetBSD: common.c,v 1.1 2018/01/09 03:31:15 christos Exp $");
+__RCSID("$NetBSD: common.c,v 1.2 2019/11/16 11:56:29 tkusumi Exp $");
 
 #include 
 #include 
@@ -50,7 +50,6 @@ __RCSID("$NetBSD: common.c,v 1.1 2018/01
 #include 
 #include 
 #include 
-#include 
 
 #include "common.h"
 



CVS commit: src/sys/fs/autofs

2019-11-16 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 16 09:22:00 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs_vfsops.c

Log Message:
autofs: Fix change by r1.3 "prevent assert on unmount."

Must delete all nodes on unmount, otherwise automounts with >1 level of 
directories can't be deleted.
taken-from: FreeBSD and DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/fs/autofs/autofs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/fs/autofs

2019-11-16 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Sat Nov 16 09:22:00 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs_vfsops.c

Log Message:
autofs: Fix change by r1.3 "prevent assert on unmount."

Must delete all nodes on unmount, otherwise automounts with >1 level of 
directories can't be deleted.
taken-from: FreeBSD and DragonFlyBSD


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/fs/autofs/autofs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/fs/autofs/autofs_vfsops.c
diff -u src/sys/fs/autofs/autofs_vfsops.c:1.5 src/sys/fs/autofs/autofs_vfsops.c:1.6
--- src/sys/fs/autofs/autofs_vfsops.c:1.5	Thu Nov 14 08:45:24 2019
+++ src/sys/fs/autofs/autofs_vfsops.c	Sat Nov 16 09:22:00 2019
@@ -33,7 +33,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.5 2019/11/14 08:45:24 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autofs_vfsops.c,v 1.6 2019/11/16 09:22:00 tkusumi Exp $");
 
 
 #include "autofs.h"
@@ -232,13 +232,14 @@ autofs_unmount(struct mount *mp, int mnt
 	mutex_enter(>am_lock);
 	while (!RB_EMPTY(>am_root->an_children)) {
 		struct autofs_node *anp;
+		/*
+		 * Force delete all nodes when more than one level of
+		 * directories are created via indirect map. Autofs doesn't
+		 * support rmdir(2), thus this is the only way to get out.
+		 */
 		anp = RB_MIN(autofs_node_tree, >am_root->an_children);
-		if (!RB_EMPTY(>an_children)) {
-			AUTOFS_DEBUG("%s: %s has children", __func__,
-			anp->an_name);
-			mutex_exit(>am_lock);
-			return EBUSY;
-		}
+		while (!RB_EMPTY(>an_children))
+			anp = RB_MIN(autofs_node_tree, >an_children);
 		autofs_node_delete(anp);
 	}
 	autofs_node_delete(amp->am_root);



CVS commit: src/sys/fs/autofs

2019-11-14 Thread Tomohiro Kusumi
Module Name:src
Committed By:   tkusumi
Date:   Thu Nov 14 08:45:24 UTC 2019

Modified Files:
src/sys/fs/autofs: autofs_vfsops.c

Log Message:
autofs: Whitespace fix


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/fs/autofs/autofs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.