diff options
author | jkh <jkh@FreeBSD.org> | 1994-11-17 10:53:21 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1994-11-17 10:53:21 +0000 |
commit | 7778f5380f0d396dbeb0be6520406d7cd435357e (patch) | |
tree | 73f577a1704c0269f0b45508852e25da7cc3ca7f /usr.sbin | |
parent | f0f266b3840b7c9a624a544e9a20cadad96760a3 (diff) | |
download | FreeBSD-src-7778f5380f0d396dbeb0be6520406d7cd435357e.zip FreeBSD-src-7778f5380f0d396dbeb0be6520406d7cd435357e.tar.gz |
Protect against old packages with bogus @name fields. Use basename_of()
on the name before recording it in /var/db/pkg. Sorry, Kaleb, you
were right after all! It was my fault! :)
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pkg_install/add/perform.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c index c54c6d0..684a818 100644 --- a/usr.sbin/pkg_install/add/perform.c +++ b/usr.sbin/pkg_install/add/perform.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id: perform.c,v 1.10 1994/10/14 05:34:04 jkh Exp $"; +static const char *rcsid = "$Id: perform.c,v 1.11 1994/10/14 05:43:41 jkh Exp $"; #endif /* @@ -170,7 +170,8 @@ pkg_do(char *pkg) code = 1; goto success; /* well, partial anyway */ } - sprintf(LogDir, "%s/%s", LOG_DIR, PkgName); + /* Protect against old packages with bogus @name fields */ + sprintf(LogDir, "%s/%s", LOG_DIR, basename_of(PkgName)); if (Verbose) printf("Attempting to record package into %s..\n", LogDir); if (make_hierarchy(LogDir)) { |