summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-06-06 12:00:55 +0000
committerderaadt <deraadt@openbsd.org>1996-06-06 12:00:55 +0000
commit077f492f3e32a72949dbca01ef2466b8278d5018 (patch)
tree7d8c7ad7bcb3db51801af8bb4974800a8217315e
parentcatq: must spltty before playing (diff)
downloadwireguard-openbsd-077f492f3e32a72949dbca01ef2466b8278d5018.tar.xz
wireguard-openbsd-077f492f3e32a72949dbca01ef2466b8278d5018.zip
use system, so that $EDITOR expansion works
-rw-r--r--usr.sbin/edquota/edquota.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c
index a78afda4325..5c3c9ce01cf 100644
--- a/usr.sbin/edquota/edquota.c
+++ b/usr.sbin/edquota/edquota.c
@@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)edquota.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: edquota.c,v 1.6 1996/04/25 11:04:08 deraadt Exp $";
+static char *rcsid = "$Id: edquota.c,v 1.7 1996/06/06 12:00:55 deraadt Exp $";
#endif /* not lint */
/*
@@ -347,14 +347,17 @@ editit(tmpfile)
}
if (pid == 0) {
register char *ed;
+ char *p;
sigsetmask(omask);
setgid(getgid());
setuid(getuid());
if ((ed = getenv("EDITOR")) == (char *)0)
ed = _PATH_VI;
- execlp(ed, ed, tmpfile, 0);
- perror(ed);
+ p = (char *)malloc(strlen(ed) + 1 + strlen(tmpfile) + 1);
+ sprintf(p, "%s %s", ed, tmpfile);
+ if (system(p) == -1)
+ perror(ed);
exit(1);
}
waitpid(pid, &stat, 0);