-/* kern_exec.c 6.1 83/07/29 */
+/* kern_exec.c 6.3 84/07/08 */
#include "../machine/reg.h"
#include "../machine/pte.h"
#include "../h/text.h"
#include "../h/file.h"
#include "../h/uio.h"
-#include "../h/nami.h"
#include "../h/acct.h"
#ifdef vax
swblk_t bno;
char cfname[MAXCOMLEN + 1];
char cfarg[SHSIZE];
+ register struct nameidata *ndp = &u.u_nd;
int resid;
- if ((ip = namei(uchar, LOOKUP, 1)) == NULL)
+ ndp->ni_nameiop = LOOKUP | FOLLOW;
+ ndp->ni_segflg = UIO_USERSPACE;
+ ndp->ni_dirp = ((struct execa *)u.u_ap)->fname;
+ if ((ip = namei(ndp)) == NULL)
return;
bno = 0;
bp = 0;
0, 1, &resid);
if (u.u_error)
goto bad;
- u.u_count = resid;
#ifndef lint
- if (u.u_count > sizeof(u.u_exdata) - sizeof(u.u_exdata.Ux_A) &&
+ if (resid > sizeof(u.u_exdata) - sizeof(u.u_exdata.Ux_A) &&
u.u_exdata.ux_shell[0] != '#') {
u.u_error = ENOEXEC;
goto bad;
cp = &u.u_exdata.ux_shell[2];
while (*cp == ' ')
cp++;
- u.u_dirp = cp;
+ ndp->ni_dirp = cp;
while (*cp && *cp != ' ')
cp++;
sharg = NULL;
sharg = cfarg;
}
}
- if (u.u_dent.d_namlen > MAXCOMLEN)
- u.u_dent.d_namlen = MAXCOMLEN;
- bcopy((caddr_t)u.u_dent.d_name, (caddr_t)cfname,
- (unsigned)(u.u_dent.d_namlen + 1));
+ if (ndp->ni_dent.d_namlen > MAXCOMLEN)
+ ndp->ni_dent.d_namlen = MAXCOMLEN;
+ bcopy((caddr_t)ndp->ni_dent.d_name, (caddr_t)cfname,
+ (unsigned)(ndp->ni_dent.d_namlen + 1));
cfname[MAXCOMLEN] = 0;
indir = 1;
iput(ip);
- ip = namei(schar, LOOKUP, 1);
+ ndp->ni_nameiop = LOOKUP | FOLLOW;
+ ndp->ni_segflg = UIO_SYSSPACE;
+ ip = namei(ndp);
if (ip == NULL)
return;
goto again;
bp = 0;
nc = (nc + NBPW-1) & ~(NBPW-1);
if (indir) {
- u.u_dent.d_namlen = strlen(cfname);
- bcopy((caddr_t)cfname, (caddr_t)u.u_dent.d_name,
- (unsigned)(u.u_dent.d_namlen + 1));
+ ndp->ni_dent.d_namlen = strlen(cfname);
+ bcopy((caddr_t)cfname, (caddr_t)ndp->ni_dent.d_name,
+ (unsigned)(ndp->ni_dent.d_namlen + 1));
}
getxfile(ip, nc + (na+4)*NBPW, uid, gid);
if (u.u_error) {
}
(void) suword((caddr_t)ap, 0);
setregs();
+ /*
+ * Remember file name for accounting.
+ */
+ u.u_acflag &= ~AFORK;
+ bcopy((caddr_t)ndp->ni_dent.d_name, (caddr_t)u.u_comm,
+ (unsigned)(ndp->ni_dent.d_namlen + 1));
bad:
if (bp)
brelse(bp);
u.u_tsize = ts;
u.u_dsize = ds;
u.u_ssize = ss;
+ u.u_prof.pr_scale = 0;
bad:
return;
}
}
u.u_pofile[i] &= ~UF_MAPPED;
}
-
- /*
- * Remember file name for accounting.
- */
- u.u_acflag &= ~AFORK;
- bcopy((caddr_t)u.u_dent.d_name, (caddr_t)u.u_comm,
- (unsigned)(u.u_dent.d_namlen + 1));
}