NetBSD Problem Report #61014

From koguler-bsd@yahoo.com  Mon Nov 16 01:41:15 2026
Return-Path: <koguler-bsd@yahoo.com>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits)
	 client-signature RSA-PSS (2048 bits))
	(Client CN "mail.netbsd.org", Issuer "YR1" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5A36F1A923B
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 16 Nov 2026 01:41:15 +0000 (UTC)
Message-Id: <20261116014103.69876AC35F3@home.arpa>
Date: Mon, 16 Nov 2026 02:41:03 +0100 (CET)
From: koguler-bsd@yahoo.com
Reply-To: koguler-bsd@yahoo.com
To: gnats-bugs@NetBSD.org
Subject: Amd mounts CD-ROM without any permission
References: <20261116014103.69876AC35F3.ref@home.arpa>
X-Send-Pr-Version: 3.95
X-From4GNATS: "koguler-bsd@yahoo.com via gnats" <gnats-admin@NetBSD.org>

>Number:         61014
>Category:       bin
>Synopsis:       Amd mounts CD-ROM without any permission.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 16 01:45:00 +0000 2026
>Originator:     Kogulé Ryo
>Release:        NetBSD 11.0
>Organization:
>Environment:
System: NetBSD vnetbsd 11.0 NetBSD 11.0 (GENERIC) #0: Thu Jul 30 15:23:12 UTC 2026 mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
As my message <http://mail-index.netbsd.org/netbsd-users/2026/11/09/msg035242.html> to netbsd-users, /usr/sbin/amd mounts CD-ROMs improperly.  It mounts automatically CD-ROMs but drops all permissions.
>How-To-Repeat:
1. Place proper /etc/amd.conf and /etc/amd/cd.

2. Start amd.

3. Insert (or attach) a CD-ROM to the host.

4. Access files/directories inside that CD-ROM.

For the detail, see the typescript included in the message above.

>Fix:
Following RVP's suggestion, I made sure the below patch works fine.


Index: ops_cdfs.c
===================================================================
RCS file: /cvsroot/src/external/bsd/am-utils/dist/amd/ops_cdfs.c,v
retrieving revision 1.4
diff -u -d -b -w -r1.4 ops_cdfs.c
--- ops_cdfs.c	17 Jan 2015 17:46:31 -0000	1.4
+++ ops_cdfs.c	16 Nov 2026 01:05:15 -0000
@@ -46,6 +46,7 @@
 #ifdef HAVE_CONFIG_H
 # include <config.h>
 #endif /* HAVE_CONFIG_H */
+#include <sys/stat.h>
 #include <am_defs.h>
 #include <amd.h>

@@ -209,6 +210,7 @@
   cdfs_args.fspec = fs_name;
 #endif /* HAVE_CDFS_ARGS_T_FSPEC */

+  cdfs_args.fmask = cdfs_args.dmask = S_IRWXU | S_IRWXG | S_IRWXO;
   /*
    * Call generic mount routine
    */

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.