NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/61014: Amd mounts CD-ROM without any permission



>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@localhost:/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
    */




Home | Main Index | Thread Index | Old Index