diff -u --recursive --new-file v1.1.43/linux/Makefile linux/Makefile
--- v1.1.43/linux/Makefile	Thu Aug 11 20:42:59 1994
+++ linux/Makefile	Thu Aug 11 20:45:15 1994
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 1
-SUBLEVEL = 43
+SUBLEVEL = 44
 
 all:	Version zImage
 
diff -u --recursive --new-file v1.1.43/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
--- v1.1.43/linux/drivers/block/floppy.c	Thu Aug 11 20:43:01 1994
+++ linux/drivers/block/floppy.c	Thu Aug 11 20:38:50 1994
@@ -1523,7 +1523,7 @@
 {
 	struct fparm {
 		unsigned char track,head,sect,size;
-	} *here = (void *)floppy_track_buffer;
+	} *here = (struct fparm *)floppy_track_buffer;
 	int ssize,il,n;
 	int count,head_shift,track_shift;
 
diff -u --recursive --new-file v1.1.43/linux/drivers/block/hd.c linux/drivers/block/hd.c
--- v1.1.43/linux/drivers/block/hd.c	Thu Aug 11 20:43:01 1994
+++ linux/drivers/block/hd.c	Thu Aug 11 20:38:50 1994
@@ -278,7 +278,7 @@
 			id.cyls*id.heads*id.sectors/2048, id.buf_size/2,
 			hd_info[dev].cyl, hd_info[dev].head, hd_info[dev].sect, id.max_multsect);
 		/* save drive info for later query via HDIO_GETIDENTITY */
-		if (NULL != (hd_ident_info[dev] = kmalloc(sizeof(id),GFP_ATOMIC)))
+		if (NULL != (hd_ident_info[dev] = (struct hd_driveid *)kmalloc(sizeof(id),GFP_ATOMIC)))
 			*hd_ident_info[dev] = id;
 		
 		/* flush remaining 384 (reserved/undefined) ID bytes: */
diff -u --recursive --new-file v1.1.43/linux/drivers/char/console.c linux/drivers/char/console.c
--- v1.1.43/linux/drivers/char/console.c	Thu Aug 11 20:43:03 1994
+++ linux/drivers/char/console.c	Thu Aug 11 20:38:50 1994
@@ -1103,7 +1103,7 @@
 {
 	int c, n = 0;
 	unsigned int currcons;
-	struct vt_struct *vt = tty->driver_data;
+	struct vt_struct *vt = (struct vt_struct *)tty->driver_data;
 
 	currcons = vt->vc_num;
 	if (currcons >= NR_CONSOLES) {
@@ -1834,7 +1834,7 @@
 static void highlight_pointer(const int currcons, const int where)
 {
         unsigned char *p;
-	static char *prev=NULL;
+	static unsigned char *prev=NULL;
 
 	if (where==-1) /* remove the pointer */
 	{
diff -u --recursive --new-file v1.1.43/linux/drivers/char/serial.c linux/drivers/char/serial.c
--- v1.1.43/linux/drivers/char/serial.c	Thu Aug 11 20:43:04 1994
+++ linux/drivers/char/serial.c	Thu Aug 11 20:38:51 1994
@@ -290,7 +290,7 @@
  */
 static void rs_stop(struct tty_struct *tty)
 {
-	struct async_struct *info = tty->driver_data;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
 	if (serial_paranoia_check(info, tty->device, "rs_stop"))
@@ -306,7 +306,7 @@
 
 static void rs_start(struct tty_struct *tty)
 {
-	struct async_struct *info = tty->driver_data;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 	
 	if (serial_paranoia_check(info, tty->device, "rs_start"))
@@ -694,9 +694,9 @@
 	run_task_queue(&tq_serial);
 }
 
-static void do_softint(void *private)
+static void do_softint(void *private_)
 {
-	struct async_struct	*info = (struct async_struct *) private;
+	struct async_struct	*info = (struct async_struct *) private_;
 	struct tty_struct	*tty;
 	
 	tty = info->tty;
@@ -1185,7 +1185,7 @@
 
 static void rs_put_char(struct tty_struct *tty, unsigned char ch)
 {
-	struct async_struct *info = tty->driver_data;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 
 	if (serial_paranoia_check(info, tty->device, "rs_put_char"))
@@ -1208,7 +1208,7 @@
 
 static void rs_flush_chars(struct tty_struct *tty)
 {
-	struct async_struct *info = tty->driver_data;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 				
 	if (serial_paranoia_check(info, tty->device, "rs_flush_chars"))
@@ -1228,7 +1228,7 @@
 		    unsigned char *buf, int count)
 {
 	int	c, total = 0;
-	struct async_struct *info = tty->driver_data;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	unsigned long flags;
 				
 	if (serial_paranoia_check(info, tty->device, "rs_write"))
@@ -1272,7 +1272,7 @@
 
 static int rs_write_room(struct tty_struct *tty)
 {
-	struct async_struct *info = tty->driver_data;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
 	int	ret;
 				
 	if (serial_paranoia_check(info, tty->device, "rs_write_room"))
@@ -1285,7 +1285,7 @@
 
 static int rs_chars_in_buffer(struct tty_struct *tty)
 {
-	struct async_struct *info = tty->driver_data;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
 				
 	if (serial_paranoia_check(info, tty->device, "rs_chars_in_buffer"))
 		return 0;
@@ -1294,7 +1294,7 @@
 
 static void rs_flush_buffer(struct tty_struct *tty)
 {
-	struct async_struct *info = tty->driver_data;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
 				
 	if (serial_paranoia_check(info, tty->device, "rs_flush_buffer"))
 		return;
@@ -1317,7 +1317,7 @@
  */
 static void rs_throttle(struct tty_struct * tty)
 {
-	struct async_struct *info = tty->driver_data;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
 #ifdef SERIAL_DEBUG_THROTTLE
 	char	buf[64];
 	
@@ -1340,7 +1340,7 @@
 
 static void rs_unthrottle(struct tty_struct * tty)
 {
-	struct async_struct *info = tty->driver_data;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
 #ifdef SERIAL_DEBUG_THROTTLE
 	char	buf[64];
 	
@@ -1627,7 +1627,7 @@
 		    unsigned int cmd, unsigned long arg)
 {
 	int error;
-	struct async_struct * info = tty->driver_data;
+	struct async_struct * info = (struct async_struct *)tty->driver_data;
 	int retval;
 
 	if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
@@ -1718,7 +1718,7 @@
 
 static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
 {
-	struct async_struct *info = tty->driver_data;
+	struct async_struct *info = (struct async_struct *)tty->driver_data;
 
 	if (tty->termios->c_cflag == old_termios->c_cflag)
 		return;
@@ -1748,7 +1748,7 @@
  */
 static void rs_close(struct tty_struct *tty, struct file * filp)
 {
-	struct async_struct * info = tty->driver_data;
+	struct async_struct * info = (struct async_struct *)tty->driver_data;
 
 	if (!info || serial_paranoia_check(info, tty->device, "rs_close"))
 		return;
@@ -1822,7 +1822,7 @@
  */
 void rs_hangup(struct tty_struct *tty)
 {
-	struct async_struct * info = tty->driver_data;
+	struct async_struct * info = (struct async_struct *)tty->driver_data;
 	
 	if (serial_paranoia_check(info, tty->device, "rs_hangup"))
 		return;
diff -u --recursive --new-file v1.1.43/linux/drivers/char/tpqic02.c linux/drivers/char/tpqic02.c
--- v1.1.43/linux/drivers/char/tpqic02.c	Thu Aug 11 20:43:05 1994
+++ linux/drivers/char/tpqic02.c	Thu Aug 11 20:27:45 1994
@@ -2832,7 +2832,7 @@
 	 */
 
 	/* get IRQ */
-	if (request_irq(QIC02_TAPE_IRQ, qic02_tape_interrupt, SA_INTERRUP, "QIC-02")) {
+	if (request_irq(QIC02_TAPE_IRQ, qic02_tape_interrupt, SA_INTERRUPT, "QIC-02")) {
 		printk(TPQIC02_NAME ": can't allocate IRQ%d for QIC-02 tape\n",
 			QIC02_TAPE_IRQ);
 		status_zombie = YES;
diff -u --recursive --new-file v1.1.43/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- v1.1.43/linux/drivers/char/tty_io.c	Thu Aug 11 20:43:06 1994
+++ linux/drivers/char/tty_io.c	Thu Aug 11 20:38:51 1994
@@ -634,7 +634,7 @@
 	int i;
 	struct tty_struct * tty;
 
-	tty = file->private_data;
+	tty = (struct tty_struct *)file->private_data;
 	if (tty_paranoia_check(tty, inode->i_rdev, "tty_read"))
 		return -EIO;
 	if (!tty || (tty->flags & (1 << TTY_IO_ERROR)))
@@ -676,7 +676,7 @@
 	if (is_console && redirect)
 		tty = redirect;
 	else
-		tty = file->private_data;
+		tty = (struct tty_struct *)file->private_data;
 	if (tty_paranoia_check(tty, inode->i_rdev, "tty_write"))
 		return -EIO;
 	if (!tty || !tty->driver.write || (tty->flags & (1 << TTY_IO_ERROR)))
@@ -886,7 +886,7 @@
 	int	idx;
 	
 
-	tty = filp->private_data;
+	tty = (struct tty_struct *)filp->private_data;
 	if (tty_paranoia_check(tty, filp->f_inode->i_rdev, "release_dev"))
 		return;
 
@@ -1136,7 +1136,7 @@
 {
 	struct tty_struct * tty;
 
-	tty = filp->private_data;
+	tty = (struct tty_struct *)filp->private_data;
 	if (tty_paranoia_check(tty, inode->i_rdev, "tty_select"))
 		return 0;
 
@@ -1150,7 +1150,7 @@
 	struct tty_struct * tty;
 	struct fasync_struct *fa, *prev;
 
-	tty = filp->private_data;
+	tty = (struct tty_struct *)filp->private_data;
 	if (tty_paranoia_check(tty, inode->i_rdev, "tty_fasync"))
 		return 0;
 
@@ -1162,7 +1162,7 @@
 	if (on) {
 		if (fa)
 			return 0;
-		fa = kmalloc(sizeof(struct fasync_struct), GFP_KERNEL);
+		fa = (struct fasync_struct *)kmalloc(sizeof(struct fasync_struct), GFP_KERNEL);
 		if (!fa)
 			return -ENOMEM;
 		fa->magic = FASYNC_MAGIC;
@@ -1228,7 +1228,7 @@
 	unsigned char	ch;
 	char	mbz = 0;
 	
-	tty = file->private_data;
+	tty = (struct tty_struct *)file->private_data;
 	if (tty_paranoia_check(tty, inode->i_rdev, "tty_ioctl"))
 		return -EINVAL;
 
@@ -1466,9 +1466,9 @@
  * This routine is called out of the software interrupt to flush data
  * from the flip buffer to the line discipline.
  */
-static void flush_to_ldisc(void *private)
+static void flush_to_ldisc(void *private_)
 {
-	struct tty_struct *tty = private;
+	struct tty_struct *tty = (struct tty_struct *) private_;
 	unsigned char	*cp;
 	char		*fp;
 	int		count;
diff -u --recursive --new-file v1.1.43/linux/drivers/char/vt.c linux/drivers/char/vt.c
--- v1.1.43/linux/drivers/char/vt.c	Tue May 24 00:34:49 1994
+++ linux/drivers/char/vt.c	Thu Aug 11 20:38:51 1994
@@ -121,7 +121,7 @@
 	int console, i;
 	unsigned char ucval;
 	struct kbd_struct * kbd;
-	struct vt_struct *vt = tty->driver_data;
+	struct vt_struct *vt = (struct vt_struct *)tty->driver_data;
 
 	console = vt->vc_num;
 
diff -u --recursive --new-file v1.1.43/linux/drivers/net/8390.c linux/drivers/net/8390.c
--- v1.1.43/linux/drivers/net/8390.c	Thu Aug 11 20:43:07 1994
+++ linux/drivers/net/8390.c	Thu Aug 11 20:42:14 1994
@@ -134,15 +134,12 @@
 	   the board has died and kick it. */
 
     if (dev->tbusy) {	/* Do timeouts, just like the 8003 driver. */
-		int txsr = inb(e8390_base+EN0_TSR), isr, cmd;
+		int txsr = inb(e8390_base+EN0_TSR), isr;
 		int tickssofar = jiffies - dev->trans_start;
 		if (tickssofar < 10	||	(tickssofar < 15 && ! (txsr & ENTSR_PTX))) {
 			return 1;
 		}
 		isr = inb(e8390_base+EN0_ISR);
-		cmd = inb(e8390_base+E8390_CMD) & (E8390_STOP|E8390_START);
-		if ((cmd == 0) || (cmd == (E8390_STOP|E8390_START)))
-			return 1;
 		printk(KERN_DEBUG "%s: transmit timed out, TX status %#2x, ISR %#2x.\n",
 			   dev->name, txsr, isr);
 		/* Does the 8390 thinks it has posted an interrupt? */
@@ -245,7 +242,7 @@
     int irq = -(((struct pt_regs *)reg_ptr)->orig_eax+2);
     struct device *dev = (struct device *)(irq2dev_map[irq]);
     int e8390_base;
-    int interrupts, cmd, boguscount = 0;
+    int interrupts, boguscount = 0;
     struct ei_device *ei_local;
     
     if (dev == NULL) {
@@ -277,12 +274,6 @@
     /* !!Assumption!! -- we stay in page 0.	 Don't break this. */
     while ((interrupts = inb_p(e8390_base + EN0_ISR)) != 0
 		   && ++boguscount < 9) {
-		cmd = inb(e8390_base+E8390_CMD) & (E8390_STOP|E8390_START);
-		if ((cmd == 0) || (cmd == (E8390_STOP|E8390_START))) {
-			printk("%s: card not present\n", dev->name);
-			interrupts = 0;
-			break;
-			}
 		if (interrupts & ENISR_RDC) {
 			/* Ack meaningless DMA complete. */
 			outb_p(ENISR_RDC, e8390_base + EN0_ISR);
diff -u --recursive --new-file v1.1.43/linux/drivers/net/plip.c linux/drivers/net/plip.c
--- v1.1.43/linux/drivers/net/plip.c	Thu Aug 11 20:43:13 1994
+++ linux/drivers/net/plip.c	Thu Aug 11 20:38:51 1994
@@ -232,7 +232,7 @@
 
     dev->priv = kmalloc(sizeof (struct net_local), GFP_KERNEL);
     memset(dev->priv, 0, sizeof(struct net_local));
-    pl=dev->priv;
+    pl = (struct net_local *) dev->priv;
     
     pl->trigger_us	=	PLIP_TRIGGER_WAIT;
     pl->nibble_us	=	PLIP_NIBBLE_WAIT;
@@ -693,7 +693,7 @@
 plip_interrupt(int reg_ptr)
 {
     int irq = -(((struct pt_regs *)reg_ptr)->orig_eax+2);
-    struct device *dev = irq2dev_map[irq];
+    struct device *dev = (struct device *) irq2dev_map[irq];
     struct net_local *lp = (struct net_local *)dev->priv;
     struct plip_local *rcv = &lp->rcv_data;
     struct plip_local *snd = &lp->snd_data;
diff -u --recursive --new-file v1.1.43/linux/drivers/net/ppp.c linux/drivers/net/ppp.c
--- v1.1.43/linux/drivers/net/ppp.c	Thu Aug 11 20:43:13 1994
+++ linux/drivers/net/ppp.c	Thu Aug 11 20:38:51 1994
@@ -550,7 +550,7 @@
   }
 
   /* Allocate a user-level receive buffer */
-  ppp->us_rbuff = kmalloc (RBUFSIZE, GFP_KERNEL);
+  ppp->us_rbuff = (unsigned char *) kmalloc (RBUFSIZE, GFP_KERNEL);
   if (ppp->us_rbuff == NULL) {
     PRINTKN (1,(KERN_ERR "ppp: no space for user receive buffer\n"));
     ppp_release (ppp);
@@ -2013,7 +2013,7 @@
 
   set_fs (seg);
 
-  if (name != (char *) NULL)
+  if (name != NULL)
     PRINTK ((KERN_DEBUG "ppp: %s, count = %d\n", name, count));
 
   while (count > 8) {
diff -u --recursive --new-file v1.1.43/linux/drivers/net/slip.c linux/drivers/net/slip.c
--- v1.1.43/linux/drivers/net/slip.c	Fri Jul  8 13:26:35 1994
+++ linux/drivers/net/slip.c	Thu Aug 11 20:38:51 1994
@@ -986,7 +986,7 @@
 	/* Allow stty to read, but not set, the serial port */
 	case TCGETS:
 	case TCGETA:
-		return n_tty_ioctl(tty, file, cmd, (unsigned long) arg);
+		return n_tty_ioctl(tty, (struct file *) file, cmd, (unsigned long) arg);
 		
 	default:
 		return -ENOIOCTLCMD;
diff -u --recursive --new-file v1.1.43/linux/drivers/scsi/hosts.c linux/drivers/scsi/hosts.c
--- v1.1.43/linux/drivers/scsi/hosts.c	Wed Aug  3 09:32:29 1994
+++ linux/drivers/scsi/hosts.c	Thu Aug 11 20:38:52 1994
@@ -197,7 +197,7 @@
 
 struct Scsi_Host * scsi_register(Scsi_Host_Template * tpnt, int j){
 	struct Scsi_Host * retval, *shpnt;
-	retval = scsi_init_malloc(sizeof(struct Scsi_Host) + j);
+	retval = (struct Scsi_Host *)scsi_init_malloc(sizeof(struct Scsi_Host) + j);
 	retval->host_busy = 0;
 	if(j > 0xffff) panic("Too many extra bytes requested\n");
 	retval->extra_bytes = j;
diff -u --recursive --new-file v1.1.43/linux/drivers/scsi/scsicam.c linux/drivers/scsi/scsicam.c
--- v1.1.43/linux/drivers/scsi/scsicam.c	Wed Aug  3 09:32:30 1994
+++ linux/drivers/scsi/scsicam.c	Thu Aug 11 20:38:52 1994
@@ -182,7 +182,7 @@
       	    cylinders = capacity / temp;/* Compute number of cylinders */ 
       	} 
     } 
-    if (cylinders == 0) rv=-1; 		/* Give error if 0 cylinders */ 
+    if (cylinders == 0) rv=(unsigned)-1;/* Give error if 0 cylinders */ 
 
     *cyls = (unsigned int) cylinders;	/* Stuff return values */ 
     *secs = (unsigned int) sectors; 
diff -u --recursive --new-file v1.1.43/linux/drivers/sound/soundcard.c linux/drivers/sound/soundcard.c
--- v1.1.43/linux/drivers/sound/soundcard.c	Thu Aug 11 20:43:23 1994
+++ linux/drivers/sound/soundcard.c	Thu Aug 11 17:35:35 1994
@@ -219,7 +219,7 @@
 {
   int             retcode;
 
-  retcode = request_irq(interrupt_level, &hndlr,
+  retcode = request_irq(interrupt_level, hndlr,
 #ifdef SND_SA_INTERRUPT
 	SA_INTERRUPT,
 #else
diff -u --recursive --new-file v1.1.43/linux/fs/buffer.c linux/fs/buffer.c
--- v1.1.43/linux/fs/buffer.c	Tue Aug  9 17:20:33 1994
+++ linux/fs/buffer.c	Thu Aug 11 20:38:52 1994
@@ -880,7 +880,7 @@
 	struct wait_queue * wait;
 
 	wait = ((volatile struct buffer_head *) bh)->b_wait;
-	memset((void *) bh,0,sizeof(*bh));
+	memset(bh,0,sizeof(*bh));
 	((volatile struct buffer_head *) bh)->b_wait = wait;
 	bh->b_next_free = unused_list;
 	unused_list = bh;
diff -u --recursive --new-file v1.1.43/linux/fs/exec.c linux/fs/exec.c
--- v1.1.43/linux/fs/exec.c	Sun Aug  7 03:30:41 1994
+++ linux/fs/exec.c	Thu Aug 11 17:03:51 1994
@@ -612,8 +612,7 @@
 	}
 	i = bprm.inode->i_mode;
 	if (IS_NOSUID(bprm.inode) && (((i & S_ISUID) && bprm.inode->i_uid != current->
-	    euid) || ((i & S_ISGID) && !in_group_p(bprm.inode->i_gid))) &&
-	    !suser()) {
+	    euid) || ((i & S_ISGID) && !in_group_p(bprm.inode->i_gid))) && !suser()) {
 		retval = -EPERM;
 		goto exec_error2;
 	}
@@ -816,8 +815,8 @@
 		(current->mm->start_code = N_TXTADDR(ex)))));
 	current->mm->rss = 0;
 	current->mm->mmap = NULL;
-	current->suid = current->euid = bprm->e_uid;
-	current->sgid = current->egid = bprm->e_gid;
+	current->suid = current->euid = current->fsuid = bprm->e_uid;
+	current->sgid = current->egid = current->fsgid = bprm->e_gid;
 	if (N_MAGIC(ex) == OMAGIC) {
 		do_mmap(NULL, 0, ex.a_text+ex.a_data,
 			PROT_READ|PROT_WRITE|PROT_EXEC,
diff -u --recursive --new-file v1.1.43/linux/fs/ext/freelists.c linux/fs/ext/freelists.c
--- v1.1.43/linux/fs/ext/freelists.c	Tue Apr 19 10:53:20 1994
+++ linux/fs/ext/freelists.c	Thu Aug 11 17:13:07 1994
@@ -289,8 +289,8 @@
 	inode->i_count = 1;
 	inode->i_nlink = 1;
 	inode->i_dev = sb->s_dev;
-	inode->i_uid = current->euid;
-	inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->egid;
+	inode->i_uid = current->fsuid;
+	inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid;
 	inode->i_dirt = 1;
 	inode->i_ino = j;
 	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
diff -u --recursive --new-file v1.1.43/linux/fs/ext/namei.c linux/fs/ext/namei.c
--- v1.1.43/linux/fs/ext/namei.c	Tue Jul 19 10:19:13 1994
+++ linux/fs/ext/namei.c	Thu Aug 11 17:11:07 1994
@@ -361,7 +361,7 @@
 		iput(dir);
 		return -ENOSPC;
 	}
-	inode->i_uid = current->euid;
+	inode->i_uid = current->fsuid;
 	inode->i_mode = mode;
 	inode->i_op = NULL;
 	if (S_ISREG(inode->i_mode))
@@ -544,9 +544,9 @@
 	retval = -EPERM;
 	if (!(inode = iget(dir->i_sb, de->inode)))
 		goto end_rmdir;
-        if ((dir->i_mode & S_ISVTX) && !suser() &&
-            current->euid != inode->i_uid &&
-            current->euid != dir->i_uid)
+        if ((dir->i_mode & S_ISVTX) && !fsuser() &&
+            current->fsuid != inode->i_uid &&
+            current->fsuid != dir->i_uid)
 		goto end_rmdir;
 	if (inode->i_dev != dir->i_dev)
 		goto end_rmdir;
@@ -598,9 +598,9 @@
 	if (!(inode = iget(dir->i_sb, de->inode)))
 		goto end_unlink;
 	retval = -EPERM;
-	if ((dir->i_mode & S_ISVTX) && !suser() &&
-	    current->euid != inode->i_uid &&
-	    current->euid != dir->i_uid)
+	if ((dir->i_mode & S_ISVTX) && !fsuser() &&
+	    current->fsuid != inode->i_uid &&
+	    current->fsuid != dir->i_uid)
 		goto end_unlink;
 	if (S_ISDIR(inode->i_mode))
 		goto end_unlink;
@@ -791,8 +791,8 @@
 		goto end_rename;
 	retval = -EPERM;
 	if ((old_dir->i_mode & S_ISVTX) && 
-	    current->euid != old_inode->i_uid &&
-	    current->euid != old_dir->i_uid && !suser())
+	    current->fsuid != old_inode->i_uid &&
+	    current->fsuid != old_dir->i_uid && !fsuser())
 		goto end_rename;
 	new_bh = ext_find_entry(new_dir,new_name,new_len,&new_de,NULL,NULL);
 	if (new_bh) {
@@ -812,8 +812,8 @@
 	}
 	retval = -EPERM;
 	if (new_inode && (new_dir->i_mode & S_ISVTX) && 
-	    current->euid != new_inode->i_uid &&
-	    current->euid != new_dir->i_uid && !suser())
+	    current->fsuid != new_inode->i_uid &&
+	    current->fsuid != new_dir->i_uid && !fsuser())
 		goto end_rename;
 	if (S_ISDIR(old_inode->i_mode)) {
 		retval = -EEXIST;
diff -u --recursive --new-file v1.1.43/linux/fs/ext2/acl.c linux/fs/ext2/acl.c
--- v1.1.43/linux/fs/ext2/acl.c	Fri Dec 31 11:59:47 1993
+++ linux/fs/ext2/acl.c	Thu Aug 11 17:11:50 1994
@@ -29,12 +29,12 @@
 	/*
 	 * Special case, access is always granted for root
 	 */
-	if (suser ())
+	if (fsuser())
 		return 1;
 	/*
 	 * If no ACL, checks using the file mode
 	 */
-	else if (current->euid == inode->i_uid)
+	else if (current->fsuid == inode->i_uid)
 		mode >>= 6;
 	else if (in_group_p (inode->i_gid))
 		mode >>= 3;
diff -u --recursive --new-file v1.1.43/linux/fs/ext2/balloc.c linux/fs/ext2/balloc.c
--- v1.1.43/linux/fs/ext2/balloc.c	Thu Aug 11 20:43:24 1994
+++ linux/fs/ext2/balloc.c	Thu Aug 11 17:12:12 1994
@@ -352,7 +352,7 @@
 	}
 	lock_super (sb);
 	es = sb->u.ext2_sb.s_es;
-	if (es->s_free_blocks_count <= es->s_r_blocks_count && !suser()) {
+	if (es->s_free_blocks_count <= es->s_r_blocks_count && !fsuser()) {
 		unlock_super (sb);
 		return 0;
 	}
diff -u --recursive --new-file v1.1.43/linux/fs/ext2/ialloc.c linux/fs/ext2/ialloc.c
--- v1.1.43/linux/fs/ext2/ialloc.c	Tue Apr 19 10:53:22 1994
+++ linux/fs/ext2/ialloc.c	Thu Aug 11 17:13:25 1994
@@ -475,7 +475,7 @@
 	inode->i_count = 1;
 	inode->i_nlink = 1;
 	inode->i_dev = sb->s_dev;
-	inode->i_uid = current->euid;
+	inode->i_uid = current->fsuid;
 	if (test_opt (sb, GRPID))
 		inode->i_gid = dir->i_gid;
 	else if (dir->i_mode & S_ISGID) {
@@ -483,7 +483,7 @@
 		if (S_ISDIR(mode))
 			mode |= S_ISGID;
 	} else
-		inode->i_gid = current->egid;
+		inode->i_gid = current->fsgid;
 	inode->i_dirt = 1;
 	inode->i_ino = j;
 	inode->i_blksize = sb->s_blocksize;
diff -u --recursive --new-file v1.1.43/linux/fs/ext2/ioctl.c linux/fs/ext2/ioctl.c
--- v1.1.43/linux/fs/ext2/ioctl.c	Mon Mar 21 16:13:13 1994
+++ linux/fs/ext2/ioctl.c	Thu Aug 11 17:14:03 1994
@@ -28,7 +28,7 @@
 		put_fs_long (inode->u.ext2_i.i_flags, (long *) arg);
 		return 0;
 	case EXT2_IOC_SETFLAGS:
-		if ((current->euid != inode->i_uid) && !suser())
+		if ((current->fsuid != inode->i_uid) && !fsuser())
 			return -EPERM;
 		if (IS_RDONLY(inode))
 			return -EROFS;
@@ -42,7 +42,7 @@
 		put_fs_long (inode->u.ext2_i.i_version, (long *) arg);
 		return 0;
 	case EXT2_IOC_SETVERSION:
-		if ((current->euid != inode->i_uid) && !suser())
+		if ((current->fsuid != inode->i_uid) && !fsuser())
 			return -EPERM;
 		if (IS_RDONLY(inode))
 			return -EROFS;
diff -u --recursive --new-file v1.1.43/linux/fs/ext2/namei.c linux/fs/ext2/namei.c
--- v1.1.43/linux/fs/ext2/namei.c	Thu Aug 11 20:43:24 1994
+++ linux/fs/ext2/namei.c	Thu Aug 11 17:11:07 1994
@@ -430,7 +430,7 @@
 		iput (dir);
 		return -ENOSPC;
 	}
-	inode->i_uid = current->euid;
+	inode->i_uid = current->fsuid;
 	inode->i_mode = mode;
 	inode->i_op = NULL;
 	if (S_ISREG(inode->i_mode))
@@ -630,9 +630,9 @@
 		schedule();
 		goto repeat;
 	}
-        if ((dir->i_mode & S_ISVTX) && !suser() &&
-            current->euid != inode->i_uid &&
-            current->euid != dir->i_uid)
+        if ((dir->i_mode & S_ISVTX) && !fsuser() &&
+            current->fsuid != inode->i_uid &&
+            current->fsuid != dir->i_uid)
 		goto end_rmdir;
 	if (inode == dir)	/* we may not delete ".", but "../dir" is ok */
 		goto end_rmdir;
@@ -711,9 +711,9 @@
 		schedule();
 		goto repeat;
 	}
-	if ((dir->i_mode & S_ISVTX) && !suser() &&
-	    current->euid != inode->i_uid &&
-	    current->euid != dir->i_uid)
+	if ((dir->i_mode & S_ISVTX) && !fsuser() &&
+	    current->fsuid != inode->i_uid &&
+	    current->fsuid != dir->i_uid)
 		goto end_unlink;
 	if (!inode->i_nlink) {
 		ext2_warning (inode->i_sb, "ext2_unlink",
@@ -946,8 +946,8 @@
 		goto end_rename;
 	retval = -EPERM;
 	if ((old_dir->i_mode & S_ISVTX) && 
-	    current->euid != old_inode->i_uid &&
-	    current->euid != old_dir->i_uid && !suser())
+	    current->fsuid != old_inode->i_uid &&
+	    current->fsuid != old_dir->i_uid && !fsuser())
 		goto end_rename;
 	new_bh = ext2_find_entry (new_dir, new_name, new_len, &new_de);
 	if (new_bh) {
@@ -977,8 +977,8 @@
 	}
 	retval = -EPERM;
 	if (new_inode && (new_dir->i_mode & S_ISVTX) &&
-	    current->euid != new_inode->i_uid &&
-	    current->euid != new_dir->i_uid && !suser())
+	    current->fsuid != new_inode->i_uid &&
+	    current->fsuid != new_dir->i_uid && !fsuser())
 		goto end_rename;
 	if (S_ISDIR(old_inode->i_mode)) {
 		retval = -ENOTDIR;
diff -u --recursive --new-file v1.1.43/linux/fs/inode.c linux/fs/inode.c
--- v1.1.43/linux/fs/inode.c	Tue Aug  2 11:27:44 1994
+++ linux/fs/inode.c	Thu Aug 11 16:54:57 1994
@@ -414,8 +414,8 @@
 	PIPE_LOCK(*inode) = 0;
 	inode->i_pipe = 1;
 	inode->i_mode |= S_IFIFO | S_IRUSR | S_IWUSR;
-	inode->i_uid = current->euid;
-	inode->i_gid = current->egid;
+	inode->i_uid = current->fsuid;
+	inode->i_gid = current->fsgid;
 	inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
 	return inode;
 }
diff -u --recursive --new-file v1.1.43/linux/fs/minix/bitmap.c linux/fs/minix/bitmap.c
--- v1.1.43/linux/fs/minix/bitmap.c	Tue Apr 19 10:53:23 1994
+++ linux/fs/minix/bitmap.c	Thu Aug 11 17:14:27 1994
@@ -213,8 +213,8 @@
 	inode->i_count = 1;
 	inode->i_nlink = 1;
 	inode->i_dev = sb->s_dev;
-	inode->i_uid = current->euid;
-	inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->egid;
+	inode->i_uid = current->fsuid;
+	inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid;
 	inode->i_dirt = 1;
 	inode->i_ino = j;
 	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
diff -u --recursive --new-file v1.1.43/linux/fs/minix/namei.c linux/fs/minix/namei.c
--- v1.1.43/linux/fs/minix/namei.c	Fri May 27 10:49:13 1994
+++ linux/fs/minix/namei.c	Thu Aug 11 17:11:07 1994
@@ -265,7 +265,7 @@
 		iput(dir);
 		return -ENOSPC;
 	}
-	inode->i_uid = current->euid;
+	inode->i_uid = current->fsuid;
 	inode->i_mode = mode;
 	inode->i_op = NULL;
 	if (S_ISREG(inode->i_mode))
@@ -443,9 +443,9 @@
 	retval = -EPERM;
 	if (!(inode = iget(dir->i_sb, de->inode)))
 		goto end_rmdir;
-        if ((dir->i_mode & S_ISVTX) && !suser() &&
-            current->euid != inode->i_uid &&
-            current->euid != dir->i_uid)
+        if ((dir->i_mode & S_ISVTX) && !fsuser() &&
+            current->fsuid != inode->i_uid &&
+            current->fsuid != dir->i_uid)
 		goto end_rmdir;
 	if (inode->i_dev != dir->i_dev)
 		goto end_rmdir;
@@ -509,9 +509,9 @@
 		schedule();
 		goto repeat;
 	}
-	if ((dir->i_mode & S_ISVTX) && !suser() &&
-	    current->euid != inode->i_uid &&
-	    current->euid != dir->i_uid)
+	if ((dir->i_mode & S_ISVTX) && !fsuser() &&
+	    current->fsuid != inode->i_uid &&
+	    current->fsuid != dir->i_uid)
 		goto end_unlink;
 	if (de->inode != inode->i_ino) {
 		retval = -ENOENT;
@@ -700,8 +700,8 @@
 		goto end_rename;
 	retval = -EPERM;
 	if ((old_dir->i_mode & S_ISVTX) && 
-	    current->euid != old_inode->i_uid &&
-	    current->euid != old_dir->i_uid && !suser())
+	    current->fsuid != old_inode->i_uid &&
+	    current->fsuid != old_dir->i_uid && !fsuser())
 		goto end_rename;
 	new_bh = minix_find_entry(new_dir,new_name,new_len,&new_de);
 	if (new_bh) {
@@ -731,8 +731,8 @@
 	}
 	retval = -EPERM;
 	if (new_inode && (new_dir->i_mode & S_ISVTX) && 
-	    current->euid != new_inode->i_uid &&
-	    current->euid != new_dir->i_uid && !suser())
+	    current->fsuid != new_inode->i_uid &&
+	    current->fsuid != new_dir->i_uid && !fsuser())
 		goto end_rename;
 	if (S_ISDIR(old_inode->i_mode)) {
 		retval = -ENOTDIR;
diff -u --recursive --new-file v1.1.43/linux/fs/namei.c linux/fs/namei.c
--- v1.1.43/linux/fs/namei.c	Tue Jul 26 21:39:45 1994
+++ linux/fs/namei.c	Thu Aug 11 17:01:19 1994
@@ -68,8 +68,9 @@
  *	permission()
  *
  * is used to check for read/write/execute permissions on a file.
- * I don't know if we should look at just the euid or both euid and
- * uid, but that should be easily changed.
+ * We use "fsuid" for this, letting us set arbitrary permissions
+ * permissions for filesystem access without changing the "normal"
+ * uids which are used for other things..
  */
 int permission(struct inode * inode,int mask)
 {
@@ -77,11 +78,11 @@
 
 	if (inode->i_op && inode->i_op->permission)
 		return inode->i_op->permission(inode, mask);
-	else if (current->euid == inode->i_uid)
+	else if (current->fsuid == inode->i_uid)
 		mode >>= 6;
 	else if (in_group_p(inode->i_gid))
 		mode >>= 3;
-	if (((mode & mask & 0007) == mask) || suser())
+	if (((mode & mask & 0007) == mask) || fsuser())
 		return 1;
 	return 0;
 }
@@ -418,7 +419,7 @@
 	int error;
 	char * tmp;
 
-	if (S_ISDIR(mode) || (!S_ISFIFO(mode) && !suser()))
+	if (S_ISDIR(mode) || (!S_ISFIFO(mode) && !fsuser()))
 		return -EPERM;
 	switch (mode & S_IFMT) {
 	case 0:
diff -u --recursive --new-file v1.1.43/linux/fs/nfs/proc.c linux/fs/nfs/proc.c
--- v1.1.43/linux/fs/nfs/proc.c	Tue May 24 00:34:53 1994
+++ linux/fs/nfs/proc.c	Thu Aug 11 17:16:06 1994
@@ -225,7 +225,7 @@
 		PRINTK("NFS reply getattr\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -260,7 +260,7 @@
 		PRINTK("NFS reply setattr\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -300,7 +300,7 @@
 		PRINTK("NFS reply lookup\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -338,7 +338,7 @@
 			PRINTK("NFS reply readlink %s\n", res);
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -381,7 +381,7 @@
 			PRINTK("NFS reply read %d\n", len);
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -419,7 +419,7 @@
 		PRINTK("NFS reply write\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -457,7 +457,7 @@
 		PRINTK("NFS reply create\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -490,7 +490,7 @@
 		PRINTK("NFS reply remove\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -527,7 +527,7 @@
 		PRINTK("NFS reply rename\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -562,7 +562,7 @@
 		PRINTK("NFS reply link\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -598,7 +598,7 @@
 		PRINTK("NFS reply symlink\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -636,7 +636,7 @@
 		PRINTK("NFS reply mkdir\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -669,7 +669,7 @@
 		PRINTK("NFS reply rmdir\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -723,7 +723,7 @@
 		}
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -757,7 +757,7 @@
 		PRINTK("NFS reply statfs\n");
 	}
 	else {
-		if (!ruid && current->euid == 0 && current->uid != 0) {
+		if (!ruid && current->fsuid == 0 && current->uid != 0) {
 			ruid = 1;
 			goto retry;
 		}
@@ -792,7 +792,7 @@
 	p1 = p++;
 	*p++ = htonl(CURRENT_TIME); /* traditional, could be anything */
 	p = xdr_encode_string(p, (char *) sys);
-	*p++ = htonl(ruid ? current->uid : current->euid);
+	*p++ = htonl(ruid ? current->uid : current->fsuid);
 	*p++ = htonl(current->egid);
 	p2 = p++;
 	for (i = 0; i < 16 && i < NGROUPS && current->groups[i] != NOGROUP; i++)
diff -u --recursive --new-file v1.1.43/linux/fs/open.c linux/fs/open.c
--- v1.1.43/linux/fs/open.c	Fri Jul  8 13:26:41 1994
+++ linux/fs/open.c	Thu Aug 11 21:35:49 1994
@@ -128,7 +128,7 @@
 		return -EROFS;
 	}
 	if (times) {
-		if ((current->euid != inode->i_uid) && !suser()) {
+		if ((current->fsuid != inode->i_uid) && !fsuser()) {
 			iput(inode);
 			return -EPERM;
 		}
@@ -136,7 +136,7 @@
 		modtime = get_fs_long((unsigned long *) &times->modtime);
 		inode->i_ctime = CURRENT_TIME;
 	} else {
-		if ((current->euid != inode->i_uid) &&
+		if ((current->fsuid != inode->i_uid) &&
 		    !permission(inode,MAY_WRITE)) {
 			iput(inode);
 			return -EACCES;
@@ -152,41 +152,30 @@
 }
 
 /*
- * XXX we should use the real ids for checking _all_ components of the
- * path.  Now we only use them for the final component of the path.
+ * access() needs to use the real uid/gid, not the effective uid/gid.
+ * We do this by temporarily setting fsuid/fsgid to the wanted values
  */
-asmlinkage int sys_access(const char * filename,int mode)
+asmlinkage int sys_access(const char * filename, int mode)
 {
 	struct inode * inode;
-	int res, i_mode;
+	int old_fsuid, old_fsgid;
+	int res;
 
 	if (mode != (mode & S_IRWXO))	/* where's F_OK, X_OK, W_OK, R_OK? */
 		return -EINVAL;
+	old_fsuid = current->fsuid;
+	old_fsgid = current->fsgid;
+	current->fsuid = current->uid;
+	current->fsgid = current->gid;
 	res = namei(filename,&inode);
-	if (res)
-		return res;
-	i_mode = inode->i_mode;
-	res = i_mode & S_IRWXUGO;
-	if (current->uid == inode->i_uid)
-		res >>= 6;		/* needs cleaning? */
-	else if (in_group_p(inode->i_gid))
-		res >>= 3;		/* needs cleaning? */
-	iput(inode);
-	if ((res & mode) == mode)
-		return 0;
-	/*
-	 * XXX we are doing this test last because we really should be
-	 * swapping the effective with the real user id (temporarily),
-	 * and then calling suser() routine.  If we do call the
-	 * suser() routine, it needs to be called last. 
-	 *
-	 * XXX nope.  suser() is inappropriate and swapping the ids while
-	 * decomposing the path would be racy.
-	 */
-	if ((!current->uid) &&
-	    (S_ISDIR(i_mode) || !(mode & S_IXOTH) || (i_mode & S_IXUGO)))
-		return 0;
-	return -EACCES;
+	if (!res) {
+		if (!permission(inode, mode))
+			res = -EACCES;
+		iput(inode);
+	}
+	current->fsuid = old_fsuid;
+	current->fsgid = old_fsgid;
+	return res;
 }
 
 asmlinkage int sys_chdir(const char * filename)
@@ -241,7 +230,7 @@
 		iput(inode);
 		return -ENOTDIR;
 	}
-	if (!suser()) {
+	if (!fsuser()) {
 		iput(inode);
 		return -EPERM;
 	}
@@ -259,14 +248,14 @@
 		return -EBADF;
 	if (!(inode = file->f_inode))
 		return -ENOENT;
-	if ((current->euid != inode->i_uid) && !suser())
+	if ((current->fsuid != inode->i_uid) && !fsuser())
 		return -EPERM;
 	if (IS_RDONLY(inode))
 		return -EROFS;
 	if (mode == (mode_t) -1)
 		mode = inode->i_mode;
 	inode->i_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
-	if (!suser() && !in_group_p(inode->i_gid))
+	if (!fsuser() && !in_group_p(inode->i_gid))
 		inode->i_mode &= ~S_ISGID;
 	inode->i_ctime = CURRENT_TIME;
 	inode->i_dirt = 1;
@@ -281,7 +270,7 @@
 	error = namei(filename,&inode);
 	if (error)
 		return error;
-	if ((current->euid != inode->i_uid) && !suser()) {
+	if ((current->fsuid != inode->i_uid) && !fsuser()) {
 		iput(inode);
 		return -EPERM;
 	}
@@ -292,7 +281,7 @@
 	if (mode == (mode_t) -1)
 		mode = inode->i_mode;
 	inode->i_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO);
-	if (!suser() && !in_group_p(inode->i_gid))
+	if (!fsuser() && !in_group_p(inode->i_gid))
 		inode->i_mode &= ~S_ISGID;
 	inode->i_ctime = CURRENT_TIME;
 	inode->i_dirt = 1;
@@ -316,9 +305,9 @@
 		user = inode->i_uid;
 	if (group == (gid_t) -1)
 		group = inode->i_gid;
-	if ((current->euid == inode->i_uid && user == inode->i_uid &&
+	if ((current->fsuid == inode->i_uid && user == inode->i_uid &&
 	     (in_group_p(group) || group == inode->i_gid)) ||
-	    suser()) {
+	    fsuser()) {
 		inode->i_uid = user;
 		inode->i_gid = group;
 		inode->i_ctime = CURRENT_TIME;
@@ -344,9 +333,9 @@
 		user = inode->i_uid;
 	if (group == (gid_t) -1)
 		group = inode->i_gid;
-	if ((current->euid == inode->i_uid && user == inode->i_uid &&
+	if ((current->fsuid == inode->i_uid && user == inode->i_uid &&
 	     (in_group_p(group) || group == inode->i_gid)) ||
-	    suser()) {
+	    fsuser()) {
 		inode->i_uid = user;
 		inode->i_gid = group;
 		inode->i_ctime = CURRENT_TIME;
diff -u --recursive --new-file v1.1.43/linux/fs/sysv/ialloc.c linux/fs/sysv/ialloc.c
--- v1.1.43/linux/fs/sysv/ialloc.c	Tue Apr 19 10:53:25 1994
+++ linux/fs/sysv/ialloc.c	Thu Aug 11 17:16:42 1994
@@ -135,8 +135,8 @@
 	inode->i_count = 1;
 	inode->i_nlink = 1;
 	inode->i_dev = sb->s_dev;
-	inode->i_uid = current->euid;
-	inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->egid;
+	inode->i_uid = current->fsuid;
+	inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid;
 	inode->i_dirt = 1;
 	inode->i_ino = ino;
 	inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
diff -u --recursive --new-file v1.1.43/linux/fs/sysv/namei.c linux/fs/sysv/namei.c
--- v1.1.43/linux/fs/sysv/namei.c	Fri May 27 10:49:14 1994
+++ linux/fs/sysv/namei.c	Thu Aug 11 17:11:07 1994
@@ -265,7 +265,7 @@
 		iput(dir);
 		return -ENOSPC;
 	}
-	inode->i_uid = current->euid;
+	inode->i_uid = current->fsuid;
 	inode->i_mode = mode;
 	inode->i_op = NULL;
 	if (S_ISREG(inode->i_mode))
@@ -447,9 +447,9 @@
 	retval = -EPERM;
 	if (!(inode = iget(dir->i_sb, de->inode)))
 		goto end_rmdir;
-        if ((dir->i_mode & S_ISVTX) && !suser() &&
-            current->euid != inode->i_uid &&
-            current->euid != dir->i_uid)
+        if ((dir->i_mode & S_ISVTX) && !fsuser() &&
+            current->fsuid != inode->i_uid &&
+            current->fsuid != dir->i_uid)
 		goto end_rmdir;
 	if (inode->i_dev != dir->i_dev)
 		goto end_rmdir;
@@ -513,9 +513,9 @@
 		schedule();
 		goto repeat;
 	}
-	if ((dir->i_mode & S_ISVTX) && !suser() &&
-	    current->euid != inode->i_uid &&
-	    current->euid != dir->i_uid)
+	if ((dir->i_mode & S_ISVTX) && !fsuser() &&
+	    current->fsuid != inode->i_uid &&
+	    current->fsuid != dir->i_uid)
 		goto end_unlink;
 	if (de->inode != inode->i_ino) {
 		retval = -ENOENT;
@@ -708,8 +708,8 @@
 		goto end_rename;
 	retval = -EPERM;
 	if ((old_dir->i_mode & S_ISVTX) && 
-	    current->euid != old_inode->i_uid &&
-	    current->euid != old_dir->i_uid && !suser())
+	    current->fsuid != old_inode->i_uid &&
+	    current->fsuid != old_dir->i_uid && !fsuser())
 		goto end_rename;
 	new_bh = sysv_find_entry(new_dir,new_name,new_len,&new_de);
 	if (new_bh) {
@@ -739,8 +739,8 @@
 	}
 	retval = -EPERM;
 	if (new_inode && (new_dir->i_mode & S_ISVTX) && 
-	    current->euid != new_inode->i_uid &&
-	    current->euid != new_dir->i_uid && !suser())
+	    current->fsuid != new_inode->i_uid &&
+	    current->fsuid != new_dir->i_uid && !fsuser())
 		goto end_rename;
 	if (S_ISDIR(old_inode->i_mode)) {
 		retval = -ENOTDIR;
diff -u --recursive --new-file v1.1.43/linux/fs/umsdos/namei.c linux/fs/umsdos/namei.c
--- v1.1.43/linux/fs/umsdos/namei.c	Thu Aug 11 20:43:29 1994
+++ linux/fs/umsdos/namei.c	Thu Aug 11 17:09:51 1994
@@ -216,9 +216,9 @@
 			info.entry.mode = mode;
 			info.entry.rdev = rdev;
 			info.entry.flags = flags;
-			info.entry.uid = current->euid;
+			info.entry.uid = current->fsuid;
 			info.entry.gid = (dir->i_mode & S_ISGID)
-				? dir->i_gid : current->egid;
+				? dir->i_gid : current->fsgid;
 			info.entry.ctime = info.entry.atime = info.entry.mtime
 				= CURRENT_TIME;
 			info.entry.nlink = 1;
@@ -659,9 +659,9 @@
 		if (ret == 0){
 			info.entry.mode = mode | S_IFDIR;
 			info.entry.rdev = 0;
-			info.entry.uid = current->euid;
+			info.entry.uid = current->fsuid;
 			info.entry.gid = (dir->i_mode & S_ISGID)
-				? dir->i_gid : current->egid;
+				? dir->i_gid : current->fsgid;
 			info.entry.ctime = info.entry.atime = info.entry.mtime
 				= CURRENT_TIME;
 			info.entry.flags = 0;
diff -u --recursive --new-file v1.1.43/linux/fs/xiafs/bitmap.c linux/fs/xiafs/bitmap.c
--- v1.1.43/linux/fs/xiafs/bitmap.c	Tue Apr 19 10:53:26 1994
+++ linux/fs/xiafs/bitmap.c	Thu Aug 11 17:17:22 1994
@@ -329,8 +329,8 @@
     inode->i_count = 1;
     inode->i_nlink = 1;
     inode->i_dev = sb->s_dev;
-    inode->i_uid = current->euid;
-    inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->egid;
+    inode->i_uid = current->fsuid;
+    inode->i_gid = (dir->i_mode & S_ISGID) ? dir->i_gid : current->fsgid;
     inode->i_dirt = 1;
     inode->i_ino = tmp;
     inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME;
diff -u --recursive --new-file v1.1.43/linux/fs/xiafs/namei.c linux/fs/xiafs/namei.c
--- v1.1.43/linux/fs/xiafs/namei.c	Fri May 27 10:49:14 1994
+++ linux/fs/xiafs/namei.c	Thu Aug 11 17:11:07 1994
@@ -294,7 +294,7 @@
         iput(dir);
 	return -ENOSPC;
     }
-    inode->i_uid = current->euid;
+    inode->i_uid = current->fsuid;
     inode->i_mode = mode;
     inode->i_op = NULL;
     if (S_ISREG(inode->i_mode))
@@ -496,9 +496,9 @@
     retval = -EPERM;
     if (!(inode = iget(dir->i_sb, de->d_ino)))
         goto end_rmdir;
-    if ((dir->i_mode & S_ISVTX) && !suser() &&
-            current->euid != inode->i_uid &&
-            current->euid != dir->i_uid)
+    if ((dir->i_mode & S_ISVTX) && !fsuser() &&
+            current->fsuid != inode->i_uid &&
+            current->fsuid != dir->i_uid)
         goto end_rmdir;
     if (inode->i_dev != dir->i_dev)
         goto end_rmdir;
@@ -558,9 +558,9 @@
 	schedule();
 	goto repeat;
     }
-    if ((dir->i_mode & S_ISVTX) && !suser() &&
-	    current->euid != inode->i_uid &&
-	    current->euid != dir->i_uid)
+    if ((dir->i_mode & S_ISVTX) && !fsuser() &&
+	    current->fsuid != inode->i_uid &&
+	    current->fsuid != dir->i_uid)
         goto end_unlink;
     if (!inode->i_nlink) {
         printk("XIA-FS: Deleting nonexistent file (%s %d)\n", WHERE_ERR);
@@ -730,8 +730,8 @@
         goto end_rename;
     retval = -EPERM;
     if ((old_dir->i_mode & S_ISVTX) && 
-	    current->euid != old_inode->i_uid &&
-	    current->euid != old_dir->i_uid && !suser())
+	    current->fsuid != old_inode->i_uid &&
+	    current->fsuid != old_dir->i_uid && !fsuser())
         goto end_rename;
     new_bh = xiafs_find_entry(new_dir, new_name, new_len, &new_de, NULL);
     if (new_bh) {
@@ -751,8 +751,8 @@
     }
     retval = -EPERM;
     if (new_inode && (new_dir->i_mode & S_ISVTX) && 
-	    current->euid != new_inode->i_uid &&
- 	    current->euid != new_dir->i_uid && !suser())
+	    current->fsuid != new_inode->i_uid &&
+ 	    current->fsuid != new_dir->i_uid && !fsuser())
         goto end_rename;
     if (S_ISDIR(old_inode->i_mode)) {
         retval = -EEXIST;
diff -u --recursive --new-file v1.1.43/linux/include/asm/segment.h linux/include/asm/segment.h
--- v1.1.43/linux/include/asm/segment.h	Thu Aug 11 20:43:29 1994
+++ linux/include/asm/segment.h	Thu Aug 11 20:38:52 1994
@@ -149,7 +149,7 @@
 			return;
 		case 3:
 			*(short *) to = get_user_word((const short *) from);
-			*(char *) to = get_user_byte(2+(const char *) from);
+			*((char *) to + 2) = get_user_byte(2+(const char *) from);
 			return;
 		case 4:
 			*(int *) to = get_user_long((const int *) from);
diff -u --recursive --new-file v1.1.43/linux/include/linux/kernel.h linux/include/linux/kernel.h
--- v1.1.43/linux/include/linux/kernel.h	Wed Aug  3 09:32:32 1994
+++ linux/include/linux/kernel.h	Thu Aug 11 17:00:17 1994
@@ -60,8 +60,13 @@
  * BSD-style accounting where the process is flagged if it uses root
  * privs).  The implication of this is that you should do normal
  * permissions checks first, and check suser() last.
+ *
+ * "suser()" checks against the effective user id, while "fsuser()"
+ * is used for file permission checking and checks against the fsuid..
  */
 #define suser() (current->euid == 0)
+#define fsuser() (current->fsuid == 0)
+
 extern int splx (int new_ipl);
 #endif /* __KERNEL__ */
 
diff -u --recursive --new-file v1.1.43/linux/include/linux/sched.h linux/include/linux/sched.h
--- v1.1.43/linux/include/linux/sched.h	Thu Aug 11 20:43:33 1994
+++ linux/include/linux/sched.h	Thu Aug 11 16:31:57 1994
@@ -270,8 +270,8 @@
 	 */
 	struct task_struct *p_opptr, *p_pptr, *p_cptr, *p_ysptr, *p_osptr;
 	struct wait_queue *wait_chldexit;	/* for wait4() */
-	unsigned short uid,euid,suid;
-	unsigned short gid,egid,sgid;
+	unsigned short uid,euid,suid,fsuid;
+	unsigned short gid,egid,sgid,fsgid;
 	unsigned long timeout;
 	unsigned long it_real_value, it_prof_value, it_virt_value;
 	unsigned long it_real_incr, it_prof_incr, it_virt_incr;
@@ -332,7 +332,7 @@
 /* pid etc.. */	0,0,0,0, \
 /* suppl grps*/ {NOGROUP,}, \
 /* proc links*/ &init_task,&init_task,NULL,NULL,NULL,NULL, \
-/* uid etc */	0,0,0,0,0,0, \
+/* uid etc */	0,0,0,0,0,0,0,0, \
 /* timeout */	0,0,0,0,0,0,0,0,0,0,0,0, \
 /* rlimits */   { {LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX},  \
 		  {LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX},  \
diff -u --recursive --new-file v1.1.43/linux/include/linux/skbuff.h linux/include/linux/skbuff.h
--- v1.1.43/linux/include/linux/skbuff.h	Tue Jun 21 14:16:25 1994
+++ linux/include/linux/skbuff.h	Thu Aug 11 20:38:52 1994
@@ -46,7 +46,7 @@
   volatile unsigned long	when;	/* used to compute rtt's	*/
   struct timeval		stamp;
   struct device			*dev;
-  void				*mem_addr;
+  struct sk_buff		*mem_addr;
   union {
 	struct tcphdr	*th;
 	struct ethhdr	*eth;
diff -u --recursive --new-file v1.1.43/linux/include/linux/string.h linux/include/linux/string.h
--- v1.1.43/linux/include/linux/string.h	Tue Aug  9 17:20:35 1994
+++ linux/include/linux/string.h	Thu Aug 11 20:38:52 1994
@@ -11,8 +11,12 @@
 extern "C" {
 #endif
 
+#ifdef i386
+
 #include <asm/string.h>		/* inline functions for i386.. */
 
+#else
+
 extern char * strcpy(char *, const char *);
 extern char * strncpy(char *, const char *, size_t);
 extern char * strcat(char *, const char *);
@@ -32,6 +36,8 @@
 extern int memcmp(const void *, const void *, size_t);
 extern void * memchr(const void *, char, size_t);
 extern void * memset(void *, char, size_t);
+
+#endif
 
 #ifdef __cplusplus
 }
diff -u --recursive --new-file v1.1.43/linux/include/linux/unistd.h linux/include/linux/unistd.h
--- v1.1.43/linux/include/linux/unistd.h	Fri Jul 22 16:41:02 1994
+++ linux/include/linux/unistd.h	Thu Aug 11 16:40:28 1994
@@ -144,6 +144,8 @@
 #define __NR_sysfs		135
 #define __NR_personality	136
 #define __NR_afs_syscall	137 /* Syscall for Andrew File System */
+#define __NR_setfsuid		138
+#define __NR_setfsgid		139
 
 extern int errno;
 
diff -u --recursive --new-file v1.1.43/linux/kernel/sys.c linux/kernel/sys.c
--- v1.1.43/linux/kernel/sys.c	Tue Aug  9 17:20:37 1994
+++ linux/kernel/sys.c	Thu Aug 11 17:05:30 1994
@@ -233,6 +233,7 @@
 	if (rgid != (gid_t) -1 ||
 	    (egid != (gid_t) -1 && egid != old_rgid))
 		current->sgid = current->egid;
+	current->fsgid = current->egid;
 	return 0;
 }
 
@@ -242,9 +243,9 @@
 asmlinkage int sys_setgid(gid_t gid)
 {
 	if (suser())
-		current->gid = current->egid = current->sgid = gid;
+		current->gid = current->egid = current->sgid = current->fsgid = gid;
 	else if ((gid == current->gid) || (gid == current->sgid))
-		current->egid = gid;
+		current->egid = current->fsgid = gid;
 	else
 		return -EPERM;
 	return 0;
@@ -321,6 +322,7 @@
 	if (ruid != (uid_t) -1 ||
 	    (euid != (uid_t) -1 && euid != old_ruid))
 		current->suid = current->euid;
+	current->fsuid = euid;
 	return 0;
 }
 
@@ -338,14 +340,43 @@
 asmlinkage int sys_setuid(uid_t uid)
 {
 	if (suser())
-		current->uid = current->euid = current->suid = uid;
+		current->uid = current->euid = current->suid = current->fsuid = uid;
 	else if ((uid == current->uid) || (uid == current->suid))
-		current->euid = uid;
+		current->fsuid = current->euid = uid;
 	else
 		return -EPERM;
 	return(0);
 }
 
+/*
+ * "setfsuid()" sets the fsuid - the uid used for filesystem checks. This
+ * is used for "access()" and for the NFS deamon (letting nfsd stay at
+ * whatever uid it wants to). It normally shadows "euid", except when
+ * explicitly set by setfsuid() or for access..
+ */
+asmlinkage int sys_setfsuid(uid_t uid)
+{
+	int old_fsuid = current->fsuid;
+
+	if (uid == current->uid || uid == current->euid ||
+	    uid == current->suid || uid == current->fsuid || suser())
+		current->fsuid = uid;
+	return old_fsuid;
+}
+
+/*
+ * Samma på svenska..
+ */
+asmlinkage int sys_setfsgid(gid_t gid)
+{
+	int old_fsgid = current->fsgid;
+
+	if (gid == current->gid || gid == current->egid ||
+	    gid == current->sgid || gid == current->fsgid || suser())
+		current->fsgid = gid;
+	return old_fsgid;
+}
+
 asmlinkage int sys_times(struct tms * tbuf)
 {
 	if (tbuf) {
@@ -542,7 +573,7 @@
 {
 	int	i;
 
-	if (grp == current->egid)
+	if (grp == current->fsgid)
 		return 1;
 
 	for (i = 0; i < NGROUPS; i++) {
diff -u --recursive --new-file v1.1.43/linux/kernel/sys_call.S linux/kernel/sys_call.S
--- v1.1.43/linux/kernel/sys_call.S	Tue Aug  9 17:20:37 1994
+++ linux/kernel/sys_call.S	Thu Aug 11 16:41:05 1994
@@ -538,5 +538,7 @@
 	.long _sys_sysfs		/* 135 */
 	.long _sys_personality
 	.long 0				/* for afs_syscall */
+	.long _sys_setfsuid
+	.long _sys_setfsgid
 
 	.space (NR_syscalls-137)*4
diff -u --recursive --new-file v1.1.43/linux/mm/mmap.c linux/mm/mmap.c
--- v1.1.43/linux/mm/mmap.c	Tue Aug  9 17:20:38 1994
+++ linux/mm/mmap.c	Thu Aug 11 20:38:52 1994
@@ -121,7 +121,8 @@
 		else
 			mask |= PAGE_SHARED;
 
-	vma = kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
+	vma = (struct vm_area_struct *)kmalloc(sizeof(struct vm_area_struct),
+		GFP_KERNEL);
 	if (!vma)
 		return -ENOMEM;
 
diff -u --recursive --new-file v1.1.43/linux/mm/mprotect.c linux/mm/mprotect.c
--- v1.1.43/linux/mm/mprotect.c	Tue Jul 26 21:39:47 1994
+++ linux/mm/mprotect.c	Thu Aug 11 20:38:52 1994
@@ -63,20 +63,20 @@
 	unsigned long end,
 	int newflags, int prot)
 {
-	struct vm_area_struct * new;
+	struct vm_area_struct * n;
 
-	new = kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
-	if (!new)
+	n = (struct vm_area_struct *) kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
+	if (!n)
 		return -ENOMEM;
-	*new = *vma;
+	*n = *vma;
 	vma->vm_start = end;
-	new->vm_end = end;
-	vma->vm_offset += vma->vm_start - new->vm_start;
-	new->vm_flags = newflags;
-	new->vm_page_prot = prot;
-	if (new->vm_inode)
-		new->vm_inode->i_count++;
-	insert_vm_struct(current, new);
+	n->vm_end = end;
+	vma->vm_offset += vma->vm_start - n->vm_start;
+	n->vm_flags = newflags;
+	n->vm_page_prot = prot;
+	if (n->vm_inode)
+		n->vm_inode->i_count++;
+	insert_vm_struct(current, n);
 	merge_segments(current->mm->mmap);
 	return 0;
 }
@@ -85,20 +85,20 @@
 	unsigned long start,
 	int newflags, int prot)
 {
-	struct vm_area_struct * new;
+	struct vm_area_struct * n;
 
-	new = kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
-	if (!new)
+	n = (struct vm_area_struct *) kmalloc(sizeof(struct vm_area_struct), GFP_KERNEL);
+	if (!n)
 		return -ENOMEM;
-	*new = *vma;
+	*n = *vma;
 	vma->vm_end = start;
-	new->vm_start = start;
-	new->vm_offset += new->vm_start - vma->vm_start;
-	new->vm_flags = newflags;
-	new->vm_page_prot = prot;
-	if (new->vm_inode)
-		new->vm_inode->i_count++;
-	insert_vm_struct(current, new);
+	n->vm_start = start;
+	n->vm_offset += n->vm_start - vma->vm_start;
+	n->vm_flags = newflags;
+	n->vm_page_prot = prot;
+	if (n->vm_inode)
+		n->vm_inode->i_count++;
+	insert_vm_struct(current, n);
 	merge_segments(current->mm->mmap);
 	return 0;
 }
diff -u --recursive --new-file v1.1.43/linux/net/inet/eth.c linux/net/inet/eth.c
--- v1.1.43/linux/net/inet/eth.c	Thu Aug 11 20:43:38 1994
+++ linux/net/inet/eth.c	Thu Aug 11 20:38:53 1994
@@ -166,7 +166,7 @@
 unsigned short eth_type_trans(struct sk_buff *skb, struct device *dev)
 {
 	struct ethhdr *eth = (struct ethhdr *) skb->data;
-	char *rawp;
+	unsigned char *rawp;
 	
 	if(*eth->h_dest&1)
 	{
