Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/imgact_gzip.c
Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | exec_gzip_imgact(imgp) | ||||
struct image_params *imgp; | struct image_params *imgp; | ||||
{ | { | ||||
int error; | int error; | ||||
const u_char *p = (const u_char *) imgp->image_header; | const u_char *p = (const u_char *) imgp->image_header; | ||||
struct imgact_gzip igz; | struct imgact_gzip igz; | ||||
struct inflate infl; | struct inflate infl; | ||||
struct vmspace *vmspace; | struct vmspace *vmspace; | ||||
/* | |||||
* This image activator doesn't support an explicit interpreter. | |||||
*/ | |||||
if (imgp->args->interpreter != -1) { | |||||
return (EINVAL); | |||||
} | |||||
/* If these four are not OK, it isn't a gzip file */ | /* If these four are not OK, it isn't a gzip file */ | ||||
if (p[0] != 0x1f) | if (p[0] != 0x1f) | ||||
return -1; /* 0 Simply magic */ | return -1; /* 0 Simply magic */ | ||||
if (p[1] != 0x8b) | if (p[1] != 0x8b) | ||||
return -1; /* 1 Simply magic */ | return -1; /* 1 Simply magic */ | ||||
if (p[2] != 0x08) | if (p[2] != 0x08) | ||||
return -1; /* 2 Compression method */ | return -1; /* 2 Compression method */ | ||||
if (p[9] != 0x03) | if (p[9] != 0x03) | ||||
▲ Show 20 Lines • Show All 304 Lines • Show Last 20 Lines |