Для передачи строки от сценария оболочки до встроенного awk сценария используйте awk переменную и -v
аргумент.
myawk () {
awk -v mystring="$1" '{ print mystring }'
}
Другая возможность состоит в том, чтобы поместить строку в переменную среды и получить доступ к ней через ENVIRON
массив.
На gcc (man gcc
) проверками включают
-fstack-protector Emit extra code to check for buffer overflows, such as stack smashing attacks. >This is done by adding a guard variable to functions with vulnerable objects. This includes functions that call alloca, and functions with >buffers larger than 8 bytes. The guards are initialized when a function is entered and then checked when the function exits. If a guard check >fails, an error message is printed and the program exits. -fstack-protector-all Like -fstack-protector except that all functions are protected.
Можно отключить обоих путем предварительного ожидания no-
к имени опции
-fno-stack-protector -fno-stack-protector-all
На LLVM/Clang (http://clang.llvm.org/docs/UsersManual.html#commandline) для позволения/запрещения AdressSanitizer:
- f [нет-] дезинфицирующее средство адреса: Включите AddressSanitizer, детектор ошибки памяти.
и SAFECode (http://safecode.cs.illinois.edu/docs/UsersGuide.html)
- f [нет-] memsafety
__stack_chk_fail
(например,strings /bin/mybinary | grep __stack_chk_fail
– Matteo 30.08.2012, 16:53-fno-stack-protector-all
не распознан (-fstack-protector
,-fstack-protector-all
и-fno-stack-protector
распознаны), – marcin 11.09.2013, 20:19