Bug 3290 - /sbin/mount.smb uses USER variable which is set even when user option not used
/sbin/mount.smb uses USER variable which is set even when user option not used
Status: CLOSED NEXTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: distribution (Show other bugs)
6.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-06-05 16:25 EDT by jasons
Modified: 2014-03-16 22:09 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-06-14 13:26:03 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description jasons 1999-06-05 16:25:09 EDT
/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 13:26:59 EDT
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.