*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
snprintf (filename, len, "%s/checksum", cachedir);
(void) mkdir (cachedir, 0755);
snprintf (filename, len, "%s/checksum", cachedir);
(void) mkdir (cachedir, 0755);
/* See if the cache directory exists and passes some simple checks
* to make sure it has not been tampered with.
/* See if the cache directory exists and passes some simple checks
* to make sure it has not been tampered with.
garbage_collect_appliances (cachedir);
/* Try to open and acquire a lock on the checksum file. */
int fd = open (filename, O_RDONLY);
if (fd == -1)
return 0;
garbage_collect_appliances (cachedir);
/* Try to open and acquire a lock on the checksum file. */
int fd = open (filename, O_RDONLY);
if (fd == -1)
return 0;
perrorf (g, "link: %s %s", filename, *kernel);
goto error;
}
perrorf (g, "link: %s %s", filename, *kernel);
goto error;
}
snprintf (filename, len, "%s/initrd", cachedir);
(void) unlink (*initrd);
if (link (filename, *initrd) == -1) {
perrorf (g, "link: %s %s", filename, *initrd);
goto error;
}
snprintf (filename, len, "%s/initrd", cachedir);
(void) unlink (*initrd);
if (link (filename, *initrd) == -1) {
perrorf (g, "link: %s %s", filename, *initrd);
goto error;
}
snprintf (filename, len, "%s/root", cachedir);
(void) unlink (*appliance);
if (link (filename, *appliance) == -1) {
perrorf (g, "link: %s %s", filename, *appliance);
goto error;
}
snprintf (filename, len, "%s/root", cachedir);
(void) unlink (*appliance);
if (link (filename, *appliance) == -1) {
perrorf (g, "link: %s %s", filename, *appliance);
goto error;
}