Subject: compat_aout: removing /emul/aout file creation
To: None <tech-kern@netbsd.org>
From: matthew green <mrg@eterna.com.au>
List: tech-kern
Date: 03/06/1999 23:27:25
the changes below (untested) should stop any files ever being
accidentally created under /emul/aout.  if you want to move a
file into there, you have to specifically do it.


christos, why did you ever put this code in in the first place?


(ideally, this should remove these lines, rather than just #if 0).


Index: aout_misc.c
===================================================================
RCS file: /cvsroot/src/sys/compat/aout/aout_misc.c,v
retrieving revision 1.2
diff -p -c -r1.2 aout_misc.c
*** aout_misc.c	1999/02/28 18:46:13	1.2
--- aout_misc.c	1999/03/06 12:24:39
*************** aout_sys_open(p, v, retval)
*** 67,75 ****
--- 67,77 ----
  	struct aout_sys_open_args *uap = v;
  	caddr_t sg = stackgap_init(p->p_emul);
  
+ #if 0
          if (SCARG(uap, flags) & O_CREAT)
  		AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
  	else 
+ #endif
  		AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
  
  	return sys_open(p, v, retval);
*************** aout_sys_creat(p, v, retval)
*** 83,91 ****
--- 85,95 ----
  	register_t *retval;
  {
  	struct aout_sys_creat_args *uap = v;
+ #if 0
  	caddr_t sg = stackgap_init(p->p_emul);
  
  	AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+ #endif
  
  	return compat_43_sys_creat(p, v, retval);
  }
*************** aout_sys_link(p, v, retval)
*** 101,107 ****
--- 105,113 ----
  	caddr_t sg = stackgap_init(p->p_emul);
  
  	AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ #if 0
  	AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, link));
+ #endif
  
  	return sys_link(p, v, retval);
  }
*************** aout_sys_mknod(p, v, retval)
*** 144,152 ****
--- 150,160 ----
  	register_t *retval;
  {
  	struct aout_sys_mknod_args *uap = v;
+ #if 0
  	caddr_t sg = stackgap_init(p->p_emul);
  
  	AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+ #endif
  
  	return sys_mknod(p, v, retval);
  }
*************** aout_sys_ktrace(p, v, retval)
*** 285,293 ****
--- 293,303 ----
  	register_t *retval;
  {
  	struct aout_sys_ktrace_args *uap = v;
+ #if 0
  	caddr_t sg = stackgap_init(p->p_emul);
  
  	AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, fname));
+ #endif
  
  	return sys_ktrace(p, v, retval);
  }
*************** aout_sys_acct(p, v, retval)
*** 301,309 ****
--- 311,321 ----
  	register_t *retval;
  {
  	struct aout_sys_acct_args *uap = v;
+ #if 0
  	caddr_t sg = stackgap_init(p->p_emul);
  
  	AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+ #endif
  
  	return sys_acct(p, v, retval);
  }
*************** aout_sys_symlink(p, v, retval)
*** 334,340 ****
--- 346,354 ----
  	caddr_t sg = stackgap_init(p->p_emul);
  
  	AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
+ #if 0
  	AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, link));
+ #endif
  
  	return sys_symlink(p, v, retval);
  }
*************** aout_sys_rename(p, v, retval)
*** 395,401 ****
--- 409,417 ----
  	caddr_t sg = stackgap_init(p->p_emul);
  
  	AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, from));
+ #if 0
  	AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, to));
+ #endif
  
  	return sys_rename(p, v, retval);
  }
*************** aout_sys_mkfifo(p, v, retval)
*** 423,431 ****
--- 439,449 ----
  	register_t *retval;
  {
  	struct aout_sys_mkfifo_args *uap = v;
+ #if 0
  	caddr_t sg = stackgap_init(p->p_emul);
  
  	AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+ #endif
  
  	return sys_mkfifo(p, v, retval);
  }
*************** aout_sys_mkdir(p, v, retval)
*** 438,446 ****
--- 456,466 ----
  	register_t *retval;
  {
  	struct aout_sys_mkdir_args *uap = v;
+ #if 0
  	caddr_t sg = stackgap_init(p->p_emul);
  
  	AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+ #endif
  
  	return sys_mkdir(p, v, retval);
  }
*************** aout_sys_quotactl(p, v, retval)
*** 483,491 ****
--- 503,513 ----
  	register_t *retval;
  {
  	struct aout_sys_quotactl_args *uap = v;
+ #if 0
  	caddr_t sg = stackgap_init(p->p_emul);
  
  	AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, path));
+ #endif
  
  	return sys_quotactl(p, v, retval);
  }
*************** aout_sys___posix_rename(p, v, retval)
*** 608,614 ****
--- 630,638 ----
  	caddr_t sg = stackgap_init(p->p_emul);
  
  	AOUT_CHECK_ALT_EXIST(p, &sg, SCARG(uap, from));
+ #if 0
  	AOUT_CHECK_ALT_CREAT(p, &sg, SCARG(uap, to));
+ #endif
  
  	return sys___posix_rename(p, v, retval);
  }