patch-2.1.102 linux/drivers/block/nbd.c
Next file: linux/drivers/char/cyclades.c
Previous file: linux/drivers/block/ide.c
Back to the patch index
Back to the overall index
- Lines: 21
- Date:
Mon May 11 14:38:28 1998
- Orig file:
v2.1.101/linux/drivers/block/nbd.c
- Orig date:
Thu May 7 22:51:48 1998
diff -u --recursive --new-file v2.1.101/linux/drivers/block/nbd.c linux/drivers/block/nbd.c
@@ -316,6 +316,8 @@
struct nbd_device *lo;
int dev, error;
+ /* Anyone capable of this syscall can do *real bad* things */
+
if (!capable(CAP_SYS_ADMIN))
return -EPERM;
if (!inode)
@@ -422,6 +424,11 @@
int nbd_init(void)
{
int i;
+
+ if (sizeof(struct nbd_request) != 24) {
+ printk(KERN_CRIT "Sizeof nbd_request needs to be 24 in order to work!\n" );
+ return -EIO;
+ }
if (register_blkdev(MAJOR_NR, "nbd", &nbd_fops)) {
printk("Unable to get major number %d for NBD\n",
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov