plist.c (235276) | plist.c (240682) |
---|---|
1/* 2 * FreeBSD install - a package for the installation and maintenance 3 * of non-core utilities. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 5 unchanged lines hidden (view full) --- 14 * Jordan K. Hubbard 15 * 18 July 1993 16 * 17 * General packing list routines. 18 * 19 */ 20 21#include <sys/cdefs.h> | 1/* 2 * FreeBSD install - a package for the installation and maintenance 3 * of non-core utilities. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 5 unchanged lines hidden (view full) --- 14 * Jordan K. Hubbard 15 * 18 July 1993 16 * 17 * General packing list routines. 18 * 19 */ 20 21#include <sys/cdefs.h> |
22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/lib/plist.c 235276 2012-05-11 16:09:12Z beat $"); | 22__FBSDID("$FreeBSD: head/usr.sbin/pkg_install/lib/plist.c 240682 2012-09-18 22:09:23Z bapt $"); |
23 24#include "lib.h" 25#include <err.h> 26#include <md5.h> 27 28/* Add an item to a packing list */ 29void 30add_plist(Package *p, plist_t type, const char *arg) --- 422 unchanged lines hidden (view full) --- 453 if (!Fake && system(tmp)) { 454 warnx("unexec command for '%s' failed", tmp); 455 fail = FAIL; 456 } 457 break; 458 459 case PLIST_FILE: 460 last_file = p->name; | 23 24#include "lib.h" 25#include <err.h> 26#include <md5.h> 27 28/* Add an item to a packing list */ 29void 30add_plist(Package *p, plist_t type, const char *arg) --- 422 unchanged lines hidden (view full) --- 453 if (!Fake && system(tmp)) { 454 warnx("unexec command for '%s' failed", tmp); 455 fail = FAIL; 456 } 457 break; 458 459 case PLIST_FILE: 460 last_file = p->name; |
461 sprintf(tmp, "%s/%s", Where, p->name); | 461 if (*p->name == '/') 462 strlcpy(tmp, p->name, FILENAME_MAX); 463 else 464 sprintf(tmp, "%s/%s", Where, p->name); |
462 if (isdir(tmp) && fexists(tmp) && !issymlink(tmp)) { 463 warnx("cannot delete specified file '%s' - it is a directory!\n" 464 "this packing list is incorrect - ignoring delete request", tmp); 465 } 466 else { 467 if (p->next && p->next->type == PLIST_COMMENT && !strncmp(p->next->name, "MD5:", 4)) { 468 char *cp = NULL, buf[33]; 469 --- 124 unchanged lines hidden --- | 465 if (isdir(tmp) && fexists(tmp) && !issymlink(tmp)) { 466 warnx("cannot delete specified file '%s' - it is a directory!\n" 467 "this packing list is incorrect - ignoring delete request", tmp); 468 } 469 else { 470 if (p->next && p->next->type == PLIST_COMMENT && !strncmp(p->next->name, "MD5:", 4)) { 471 char *cp = NULL, buf[33]; 472 --- 124 unchanged lines hidden --- |