mirror of
https://github.com/sheumann/hush.git
synced 2024-12-27 01:32:08 +00:00
The <package>.list file was prepending "./" to the files, fixed that.
Also fixed a very silly error by me when running postinst (remember to use the variable BEFORE its freed)
This commit is contained in:
parent
b8f5adb64f
commit
dece3c5684
@ -1098,18 +1098,19 @@ int run_package_script(const char *package_name, const char *script_type)
|
|||||||
{
|
{
|
||||||
struct stat path_stat;
|
struct stat path_stat;
|
||||||
char *script_path;
|
char *script_path;
|
||||||
|
int result;
|
||||||
|
|
||||||
script_path = xmalloc(strlen(package_name) + strlen(script_type) + 21);
|
script_path = xmalloc(strlen(package_name) + strlen(script_type) + 21);
|
||||||
sprintf(script_path, "/var/lib/dpkg/info/%s.%s", package_name, script_type);
|
sprintf(script_path, "/var/lib/dpkg/info/%s.%s", package_name, script_type);
|
||||||
|
|
||||||
/* If the file doesnt exist is isnt a fatal */
|
/* If the file doesnt exist is isnt a fatal */
|
||||||
if (lstat(script_path, &path_stat) < 0) {
|
if (lstat(script_path, &path_stat) < 0) {
|
||||||
free(script_path);
|
result = EXIT_SUCCESS;
|
||||||
return(EXIT_SUCCESS);
|
|
||||||
} else {
|
} else {
|
||||||
free(script_path);
|
result = system(script_path);
|
||||||
return(system(script_path));
|
|
||||||
}
|
}
|
||||||
|
free(script_path);
|
||||||
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void all_control_list(char **remove_files, const char *package_name)
|
void all_control_list(char **remove_files, const char *package_name)
|
||||||
@ -1298,7 +1299,7 @@ void unpack_package(deb_file_t *deb_file)
|
|||||||
/* Create the list file */
|
/* Create the list file */
|
||||||
strcat(info_prefix, "list");
|
strcat(info_prefix, "list");
|
||||||
out_stream = xfopen(info_prefix, "w");
|
out_stream = xfopen(info_prefix, "w");
|
||||||
deb_extract(deb_file->filename, out_stream, (extract_quiet | extract_data_tar_gz | extract_list), NULL, NULL);
|
deb_extract(deb_file->filename, out_stream, (extract_quiet | extract_data_tar_gz | extract_list), "/", NULL);
|
||||||
fclose(out_stream);
|
fclose(out_stream);
|
||||||
|
|
||||||
/* change status */
|
/* change status */
|
||||||
|
11
dpkg.c
11
dpkg.c
@ -1098,18 +1098,19 @@ int run_package_script(const char *package_name, const char *script_type)
|
|||||||
{
|
{
|
||||||
struct stat path_stat;
|
struct stat path_stat;
|
||||||
char *script_path;
|
char *script_path;
|
||||||
|
int result;
|
||||||
|
|
||||||
script_path = xmalloc(strlen(package_name) + strlen(script_type) + 21);
|
script_path = xmalloc(strlen(package_name) + strlen(script_type) + 21);
|
||||||
sprintf(script_path, "/var/lib/dpkg/info/%s.%s", package_name, script_type);
|
sprintf(script_path, "/var/lib/dpkg/info/%s.%s", package_name, script_type);
|
||||||
|
|
||||||
/* If the file doesnt exist is isnt a fatal */
|
/* If the file doesnt exist is isnt a fatal */
|
||||||
if (lstat(script_path, &path_stat) < 0) {
|
if (lstat(script_path, &path_stat) < 0) {
|
||||||
free(script_path);
|
result = EXIT_SUCCESS;
|
||||||
return(EXIT_SUCCESS);
|
|
||||||
} else {
|
} else {
|
||||||
free(script_path);
|
result = system(script_path);
|
||||||
return(system(script_path));
|
|
||||||
}
|
}
|
||||||
|
free(script_path);
|
||||||
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void all_control_list(char **remove_files, const char *package_name)
|
void all_control_list(char **remove_files, const char *package_name)
|
||||||
@ -1298,7 +1299,7 @@ void unpack_package(deb_file_t *deb_file)
|
|||||||
/* Create the list file */
|
/* Create the list file */
|
||||||
strcat(info_prefix, "list");
|
strcat(info_prefix, "list");
|
||||||
out_stream = xfopen(info_prefix, "w");
|
out_stream = xfopen(info_prefix, "w");
|
||||||
deb_extract(deb_file->filename, out_stream, (extract_quiet | extract_data_tar_gz | extract_list), NULL, NULL);
|
deb_extract(deb_file->filename, out_stream, (extract_quiet | extract_data_tar_gz | extract_list), "/", NULL);
|
||||||
fclose(out_stream);
|
fclose(out_stream);
|
||||||
|
|
||||||
/* change status */
|
/* change status */
|
||||||
|
Loading…
Reference in New Issue
Block a user