Compare commits

...
9 Commits
Author SHA1 Message Date
Tudor Marcu ec31238e1a Release v3.3.0
This release contains various changes to fix segfaults and memory misuse,
simplifying logic when iterating directories and populating file structs
from manifests, and changing the secondary sort to be lexographically sorted
filenames for version-sorted manifests.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-11-17 01:14:42 -08:00
Tudor Marcu 74c8f86a94 Simplify logic for iterating directories
The file struct must be populated to contain the proper stats, so just
check if it is a directory and iterate, ignoring the case where d_type may
not be defined on the system.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-11-15 17:54:19 -08:00
Tudor Marcu a43964b110 Revert "Resort to lstat for FS not supporting dirent.d_type"
This reverts commit 983b17d68d.
2016-11-15 17:42:09 -08:00
Dmitry Rozhkov 983b17d68d Resort to lstat for FS not supporting dirent.d_type
According to POSIX.1 only d_name and d_ino fields of struct
dirent are standardized. d_type isn't always correctly set on file
systems like XFS. In such cases it makes sense to resort to
lstat(). Otherwise a user has hard time figuring out what's
wrong with her setup.

Also remove redundant populate_file_struct() as it's called
again in parallel threads.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2016-11-15 17:28:16 -08:00
Joshua Lock 5420a1ea1b Ensure os-core bundle is listed in groups.ini
If the os-core bundle is not listed in groups.ini we will run into
problems later on, including segfaults when processing bundle includes.

Check the os-core bundle is listed in the groups.ini during initialisation
and error gracefully when it is not.

Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
2016-11-15 17:26:45 -08:00
Patrick Ohly 1c75f53604 swupd_create_fullfiles: avoid segfault when nothing changes
In the (unlikely) case that nothing changed between two builds,
get_deduplicated_fullfile_list() segfaults because it uses
manifest->files without checking for NULL, aka the empty list.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2016-11-15 11:32:23 -08:00
Patrick Ohly 2890a11c5a delta.c: fix xattr test after patching
At the moment, swupd_create_pack fails when some files have xattrs and
get patched because the xattrs of the test file do not match the
original, unpatched file.

That's because xattrs_copy() was applied to the wrong target file.

Fixes: swupd-server/#35

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2016-11-15 11:28:26 -08:00
Tudor Marcu 2401aae76e Release v3.2.9
This release fixes the path where the server reads the bundle metadata from.

Signed-off-by: Tudor Marcu <tudor.marcu@intel.com>
2016-09-29 17:17:30 -07:00
Patrick McCarty 30b46b9027 Update for new noship dir location
The bundle-chroot-builder changed the location where it stores bundle
includes metadata, so swupd-server needs to read from the new location.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2016-09-29 13:40:12 -07:00
6 changed files with 31 additions and 7 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.66])
AC_INIT(swupd-server, 3.2.8, timothy.c.pepper@linux.intel.com)
AC_INIT(swupd-server, 3.3.0, timothy.c.pepper@linux.intel.com)
AM_INIT_AUTOMAKE([foreign -Wall -W subdir-objects])
AM_SILENT_RULES([yes])
AC_PROG_CC
+2 -2
View File
@@ -353,7 +353,7 @@ static void iterate_directory(struct manifest *manifest, char *pathprefix,
populate_file_struct(file, fullname);
free(fullname);
if (entry->d_type == DT_DIR) {
if (file->is_dir) {
iterate_directory(manifest, pathprefix, file->filename, do_hash);
}
@@ -418,7 +418,7 @@ GList *get_sub_manifest_includes(char *component, int version)
char *included;
char line[8192];
conf = config_output_dir();
conf = config_image_base();
if (conf == NULL) {
assert(0);
}
+24
View File
@@ -212,6 +212,25 @@ static int check_build_env(void)
return 0;
}
static int check_group_file(void)
{
int ret = -1;
// Ensure the os-core group is defined
while (1) {
char *group = next_group();
if (!group) {
break;
}
if (strcmp(group, "os-core") == 0) {
ret = 0;
break;
}
}
return ret;
}
int main(int argc, char **argv)
{
struct manifest *new_core = NULL;
@@ -270,6 +289,11 @@ int main(int argc, char **argv)
string_or_die(&file_path, "%s/groups.ini", state_dir);
read_group_file(file_path);
free(file_path);
ret = check_group_file();
if (ret != 0) {
printf("os-core bundle is not listed in groups.ini, this is required.\n");
goto exit;
}
read_current_version("LAST_VER");
printf("Last processed version is %i\n", current_version);
+1 -1
View File
@@ -97,7 +97,7 @@ void __create_delta(struct file *file, int from_version, char *from_hash)
ret = 0;
goto out;
}
xattrs_copy(original, newfile);
xattrs_copy(original, testnewfile);
/* does xattrs have been correctly copied?*/
if (xattrs_compare(original, testnewfile) != 0) {
+1 -1
View File
@@ -252,7 +252,7 @@ static GList *get_deduplicated_fullfile_list(struct manifest *manifest)
manifest->files = g_list_sort(manifest->files, file_sort_hash);
list = g_list_first(manifest->files);
while (prev == NULL) {
while (prev == NULL && list != NULL) {
tmp = list->data;
list = g_list_next(list);
+2 -2
View File
@@ -58,9 +58,9 @@ gen_includes_file() {
local bundle=$1
local ver=$2
local includes="${@:3}"
mkdir -p $DIR/www/$ver/noship
mkdir -p $DIR/image/$ver/noship
for b in $includes; do
cat >> $DIR/www/$ver/noship/"$bundle"-includes << EOF
cat >> $DIR/image/$ver/noship/"$bundle"-includes << EOF
$b
EOF
done