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

Next file: linux/fs/smbfs/mmap.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.51/linux/fs/smbfs/ioctl.c linux/fs/smbfs/ioctl.c
@@ -2,6 +2,7 @@
  *  ioctl.c
  *
  *  Copyright (C) 1995, 1996 by Volker Lendecke
+ *  Copyright (C) 1997 by Volker Lendecke
  *
  */
 
@@ -21,8 +22,29 @@
 	switch (cmd)
 	{
 	case SMB_IOC_GETMOUNTUID:
-		return put_user(SMB_SERVER(inode)->m.mounted_uid, (uid_t *) arg);
+		return put_user(SMB_SERVER(inode)->m.mounted_uid,
+				(uid_t *) arg);
 
+	case SMB_IOC_NEWCONN:
+	{
+		struct smb_conn_opt opt;
+		int result;
+
+		if (arg == 0)
+		{
+			/* The process offers a new connection upon SIGUSR1 */
+			return smb_offerconn(SMB_SERVER(inode));
+		}
+
+		if ((result = verify_area(VERIFY_READ, (uid_t *) arg,
+					  sizeof(opt))) != 0)
+		{
+			return result;
+		}
+		copy_from_user(&opt, (void *)arg, sizeof(opt));
+
+		return smb_newconn(SMB_SERVER(inode), &opt);
+	}
 	default:
 		return -EINVAL;
 	}

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