Ticket #371 (new defect)
Opened 21 months ago
/etc/X11/Xsession puts the session's log file in /tmp thus filling up the phone's memory
| Reported by: | stuart56 | Owned by: | ppronchery |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | build | Version: | rev5 |
| Severity: | major | Keywords: | |
| Cc: |
Description
/etc/X11/Xsession contains
ERRFILE=$HOME/.xsession-errors
# attempt to create an error file; abort if we cannot
if (umask 077 && touch "$ERRFILE") 2> /dev/null && [ -w "$ERRFILE" ] &&
[ ! -L "$ERRFILE" ]; then
chmod 600 "$ERRFILE"
elif ERRFILE=$(tempfile 2> /dev/null); then
if ! ln -sf "$ERRFILE" "${TMPDIR:=/tmp}/xsession-$USER"; then
message "warning: unable to symlink \"$TMPDIR/xsession-$USER\" to" \
"\"$ERRFILE\"; look for session log/errors in" \
"\"$TMPDIR/xsession-$USER\"."
fi
else
errormsg "unable to create X session log/error file; aborting."
fi
exec >>"$ERRFILE" 2>&1
if $HOME/.xsession-errors is a symlink, the log messages gradually fill up the phone's memory. Many people have ~/.xsession-errors as a symlink to /dev/null (they do not want log messages) and in this case current code then puts the message in /tmp.
One solution would be to say: put the logs in ~/.xsession-errors if it exists or is a symlink, otherwise put the messages in /dev/null
