From 807db8eda2adff20ee04a1bfa77f1b61f4a95518 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Mon, 18 Aug 2003 16:44:22 +0000 Subject: [PATCH] * lib/mc-wrapper.csh.in: Use "id" command to find the real user id. $USER is not reliable. * lib/mc-wrapper.sh.in: Likewise. Reported by Figura Peter --- ChangeLog | 7 +++++++ lib/mc-wrapper.csh.in | 6 ++++-- lib/mc-wrapper.sh.in | 3 ++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4466c9c4b..529b7c947 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-08-18 Pavel Roskin + + * lib/mc-wrapper.csh.in: Use "id" command to find the real user + id. $USER is not reliable. + * lib/mc-wrapper.sh.in: Likewise. + Reported by Figura Peter + 2003-08-18 Andrew V. Samoilov * acinclude.m4 (MC_WITH_NCURSES): Fix ESCDELAY check on Solaris. diff --git a/lib/mc-wrapper.csh.in b/lib/mc-wrapper.csh.in index 468b16d25..961d53f17 100644 --- a/lib/mc-wrapper.csh.in +++ b/lib/mc-wrapper.csh.in @@ -1,7 +1,9 @@ +set MC_USER="`id | sed 's/[^(]*(//;s/).*//'`" + if ($?TMPDIR) then - setenv MC_PWD_FILE $TMPDIR/mc-$USER/mc.pwd.$$ + setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$ else - setenv MC_PWD_FILE /tmp/mc-$USER/mc.pwd.$$ + setenv MC_PWD_FILE /tmp/mc-$MC_USER/mc.pwd.$$ endif @bindir@/mc -P "$MC_PWD_FILE" $* diff --git a/lib/mc-wrapper.sh.in b/lib/mc-wrapper.sh.in index b1fd5865b..58b4341f5 100644 --- a/lib/mc-wrapper.sh.in +++ b/lib/mc-wrapper.sh.in @@ -1,4 +1,5 @@ -MC_PWD_FILE="${TMPDIR-/tmp}/mc-$USER/mc.pwd.$$" +MC_USER=`id | sed 's/[^(]*(//;s/).*//'` +MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$" @bindir@/mc -P "$MC_PWD_FILE" "$@" if test -r "$MC_PWD_FILE"; then