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! :)
This commit is contained in:
Jordan K. Hubbard 1994-11-17 10:53:21 +00:00
parent d08bdbd3d1
commit 3e78200fd8

View File

@ -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)) {