Lines Matching full:magic

7  * binfmt_misc detects binaries via a magic or filename extension and invokes
17 #include <linux/magic.h>
43 enum {Enabled, Magic}; enumerator
52 int offset; /* offset of magic */
53 int size; /* size of magic/mask */
54 char *magic; /* magic or filename extension */ member
71 * - magic: 128 bytes (512 in escaped form)
106 if (!test_bit(Magic, &e->flags)) { in search_binfmt_handler()
107 if (p && !strcmp(e->magic, p + 1)) in search_binfmt_handler()
112 /* Do matching based on magic & mask. */ in search_binfmt_handler()
116 if ((*s++ ^ e->magic[j]) & e->mask[j]) in search_binfmt_handler()
120 if ((*s++ ^ e->magic[j])) in search_binfmt_handler()
343 * ':name:type:offset:magic:mask:interpreter:flags'
400 pr_debug("register: type: M (magic)\n"); in create_entry()
401 e->flags = (1 << Enabled) | (1 << Magic); in create_entry()
409 if (test_bit(Magic, &e->flags)) { in create_entry()
410 /* Handle the 'M' (magic) format. */ in create_entry()
428 /* Parse the 'magic' field. */ in create_entry()
429 e->magic = p; in create_entry()
433 if (!e->magic[0]) in create_entry()
437 KBUILD_MODNAME ": register: magic[raw]: ", in create_entry()
438 DUMP_PREFIX_NONE, e->magic, p - e->magic); in create_entry()
454 * Decode the magic & mask fields. in create_entry()
459 e->size = string_unescape_inplace(e->magic, UNESCAPE_HEX); in create_entry()
466 pr_debug("register: magic/mask length: %i\n", e->size); in create_entry()
469 KBUILD_MODNAME ": register: magic[decoded]: ", in create_entry()
470 DUMP_PREFIX_NONE, e->magic, e->size); in create_entry()
482 masked[i] = e->magic[i] & e->mask[i]; in create_entry()
484 KBUILD_MODNAME ": register: magic[masked]: ", in create_entry()
500 /* Parse the 'magic' field. */ in create_entry()
501 e->magic = p; in create_entry()
506 if (!e->magic[0] || strchr(e->magic, '/')) in create_entry()
508 pr_debug("register: extension: {%s}\n", e->magic); in create_entry()
601 if (!test_bit(Magic, &e->flags)) { in entry_status()
602 sprintf(dp, "extension .%s\n", e->magic); in entry_status()
605 dp = bin2hex(dp, e->magic, e->size); in entry_status()