Bug 3290 - /sbin/mount.smb uses USER variable which is set even when user option not used
Summary: /sbin/mount.smb uses USER variable which is set even when user option not used
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: distribution
Version: 6.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-06-05 20:25 UTC by jasons
Modified: 2014-03-17 02:09 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1999-06-14 17:26:03 UTC


Attachments (Terms of Use)

Description jasons 1999-06-05 20:25:09 UTC
/sbin/mount.smb uses USER variable which is set even when
user option not used (since it is the shell variable for the
current user).  This causes mounting smbfs filesystems
without a user to fail since "root" is put on the command
line to smbmount, instead of no user.  Also, since USER
should be in the form of "-U user", smbmount is being told
to make root the password.

The patch below changes USER to SMBUSER.

--- old/mount.smb	Sat Jun  5 15:17:28 1999
+++ new/mount.smb	Sat Jun  5 15:17:07 1999
@@ -28,7 +28,7 @@
 	      COMMAND="$COMMAND -u$MUID"
 	      ;;
 	  user=*)
-	      USER="-U `echo $arg | cut -d '=' -f 2-`"
+	      SMBUSER="-U `echo $arg | cut -d '=' -f 2-`"
 	      ;;
           passwd=*)
               PASSWD=`echo $arg | cut -d '=' -f 2-`
@@ -39,7 +39,7 @@
 done

 if [ -n "$PASSWD" ]; then
-      exec smbmount "$1" $USER $PASSWD -c "$COMMAND"
+      exec smbmount "$1" $SMBUSER $PASSWD -c "$COMMAND"
 else
-      exec smbmount "$1" -N $USER -c "$COMMAND"
+      exec smbmount "$1" -N $SMBUSER -c "$COMMAND"
 fi

Comment 1 Bill Nottingham 1999-06-14 17:26:59 UTC
fixed in the next samba release (2.0.4b-4, or greater.)


Note You need to log in before you can comment on or make changes to this bug.