Creating a core dump / backtrace from /bin/login

John Reiser jreiser at BitWagon.com
Fri Sep 26 22:12:00 UTC 2008


> How can I set ulimits for /bin/login?

For a general program: wrap the program in a shell script.  Move the program
to a new name somewhere else, then put a script at the original name:
    #! /bin/bash
    ulimit -c unlimited
    exec /path/to/new/name/of/original/program "$@"

For the case of /bin/login, perhaps there will be problems with the
initial environment; see INVOCATION in "man bash".  Therefore, wrap
/bin/login in a short C program which calls setrlimit(3) then exec*()
the original 'login' which has been moved to a different location.
Beware the security implications due to running under setuid(), etc.

-- 




More information about the devel mailing list