[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Creating a core dump / backtrace from /bin/login



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.

--


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]