patch-2.1.73 linux/fs/smbfs/ioctl.c

Next file: linux/fs/smbfs/proc.c
Previous file: linux/fs/smbfs/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.72/linux/fs/smbfs/ioctl.c linux/fs/smbfs/ioctl.c
@@ -11,6 +11,7 @@
 #include <linux/ioctl.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
+
 #include <linux/smb_fs.h>
 #include <linux/smb_mount.h>
 
@@ -20,29 +21,33 @@
 smb_ioctl(struct inode *inode, struct file *filp,
 	  unsigned int cmd, unsigned long arg)
 {
+	struct smb_sb_info *server = SMB_SERVER(inode);
 	int result = -EINVAL;
 
 	switch (cmd)
 	{
 	case SMB_IOC_GETMOUNTUID:
-		result = put_user(SMB_SERVER(inode)->mnt->mounted_uid,
-				(uid_t *) arg);
+		result = put_user(server->mnt->mounted_uid, (uid_t *) arg);
 		break;
 
 	case SMB_IOC_NEWCONN:
 	{
 		struct smb_conn_opt opt;
 
-		if (arg == 0)
+		if (arg)
 		{
-			/* The process offers a new connection upon SIGUSR1 */
-			result = smb_offerconn(SMB_SERVER(inode));
+			result = -EFAULT;
+			if (!copy_from_user(&opt, (void *)arg, sizeof(opt)))
+				result = smb_newconn(server, &opt);
 		}
 		else
 		{
-			result = -EFAULT;
-			if (!copy_from_user(&opt, (void *)arg, sizeof(opt)))
-				result = smb_newconn(SMB_SERVER(inode), &opt);
+#if 0
+			/* obsolete option ... print a warning */
+			printk("SMBFS: ioctl deprecated, please upgrade "
+				"smbfs package\n");
+#endif
+			result = 0;
 		}
 		break;
 	}

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov