/* Not ours to exec if we don't start with "#!". */ if ((bprm->buf[0] != '#') || (bprm->buf[1] != '!')) return -ENOEXEC;
/* *Thissectionhandlesparsingthe#!lineintoseparate *interpreterpathandargumentstrings.Wemustbecareful *becausebprm->bufisnotyetguaranteedtobeNUL-terminated *(thoughthebufferwillhavetrailingNULpaddingwhenthe *filesizewassmallerthanthebuffersize). * *Wedonotwanttoexecatruncatedinterpreterpath,soeither *wefindanewline(whichindicatesnothingistruncated),or *wefindaspace/tab/NULaftertheinterpreterpath(which *itselfmaybeprecededbyspaces/tabs).Truncatingthe *argumentsisfine:theinterpretercanre-readthescriptto *parsethemonitsown.
*/
buf_end = bprm->buf + sizeof(bprm->buf) - 1;
i_end = strnchr(bprm->buf, sizeof(bprm->buf), '\n'); if (!i_end) {
i_end = next_non_spacetab(bprm->buf + 2, buf_end); if (!i_end) return -ENOEXEC; /* Entire buf is spaces/tabs */ /* *Ifthereisnolaterspace/tab/NULwemustassumethe *interpreterpathistruncated.
*/ if (!next_terminator(i_end, buf_end)) return -ENOEXEC;
i_end = buf_end;
} /* Trim any trailing spaces/tabs from i_end */ while (spacetab(i_end[-1]))
i_end--;
/* Skip over leading spaces/tabs */
i_name = next_non_spacetab(bprm->buf+2, i_end); if (!i_name || (i_name == i_end)) return -ENOEXEC; /* No interpreter name found */
/* Is there an optional argument? */
i_arg = NULL;
i_sep = next_terminator(i_name, i_end); if (i_sep && (*i_sep != '\0'))
i_arg = next_non_spacetab(i_sep, i_end);
core_initcall(init_script_binfmt);
module_exit(exit_script_binfmt);
MODULE_DESCRIPTION("Kernel support for scripts starting with #!");
MODULE_LICENSE("GPL");
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.14Bemerkung:
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.