Subject: pkg/14430: Mounting CD's etc from KDE2 when /sbin isn't in your path
To: None <gnats-bugs@gnats.netbsd.org>
From: Mark Davies <mark@mcs.vuw.ac.nz>
List: netbsd-bugs
Date: 11/02/2001 13:36:31
>Number:         14430
>Category:       pkg
>Synopsis:       Mounting CD's etc from KDE2 when /sbin isn't in your path
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 01 16:37:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Mark Davies
>Release:        NetBSD 1.5Y 29/10/2001
>Organization:
Dept. of Comp. Sci., Victoria Uni. of Wellington, New Zealand.
>Environment:
	
	
System: NetBSD turakirae.mcs.vuw.ac.nz 1.5Y NetBSD 1.5Y (MCS_WORKSTATION) #1: Tue Oct 30 22:54:21 NZDT 2001 mark@turakirae.mcs.vuw.ac.nz:/src/work/src/sys/arch/i386/compile/MCS_WORKSTATION i386
Architecture: i386
Machine: i386
>Description:
	Mounting and unmounting of CD's, floppys, etc from the KDE2 Desktop
	icons only works if the user has /sbin in their path and gives a
	confusing response to the user if it isn't.

>How-To-Repeat:
	Use a desktop icon to try to mount a CD without /sbin in your path.

>Fix:
	Add the following as a patch in the kdelibs2 package.
	(It would probably be better to leave the path out of the
	individual invocations and rather add "/sbin" to the effective path
	for the system() call, but I dont see how to easily do that):


--- kio/file/file.cc~	Wed Sep  5 11:08:16 2001
+++ kio/file/file.cc	Thu Oct 25 17:19:48 2001
@@ -1077,18 +1077,18 @@
     {
         // Mount using device only if no fstype nor mountpoint (KDE-1.x like)
         if ( !_dev.isEmpty() && _point.isEmpty() && fstype.isEmpty() )
-            buffer.sprintf( "mount %s 2>%s", dev.data(), tmp );
+            buffer.sprintf( "/sbin/mount %s 2>%s", dev.data(), tmp );
         else
           // Mount using the mountpoint, if no fstype nor device (impossible in first step)
           if ( !_point.isEmpty() && _dev.isEmpty() && fstype.isEmpty() )
-            buffer.sprintf( "mount %s 2>%s", point.data(), tmp );
+            buffer.sprintf( "/sbin/mount %s 2>%s", point.data(), tmp );
           else
             // mount giving device + mountpoint but no fstype
             if ( !_point.isEmpty() && !_dev.isEmpty() && fstype.isEmpty() )
-              buffer.sprintf( "mount %s %s %s 2>%s", readonly.data(), dev.data(), point.data(), tmp );
+              buffer.sprintf( "/sbin/mount %s %s %s 2>%s", readonly.data(), dev.data(), point.data(), tmp );
             else
               // mount giving device + mountpoint + fstype
-              buffer.sprintf( "mount %s -t %s %s %s 2>%s", readonly.data(),
+              buffer.sprintf( "/sbin/mount %s -t %s %s %s 2>%s", readonly.data(),
                               fstype.data(), dev.data(), point.data(), tmp );
 
         kdDebug(7101) << buffer << endl;
@@ -1232,7 +1232,7 @@
 		return;
 	}
 #else
-    buffer.sprintf( "umount %s 2>%s", QFile::encodeName(_point).data(), tmp );
+    buffer.sprintf( "/sbin/umount %s 2>%s", QFile::encodeName(_point).data(), tmp );
     system( buffer.ascii() );
 #endif /* HAVE_VOLMGT */
 

cheers
mark
>Release-Note:
>Audit-Trail:
>Unformatted: