Просмотр исходного кода

mc-wrapper: use `whoami` instead of `id | sed ...`.

If AD authorization is used, then the "id" command works for a very long
time (since it unloads all groups in the domain), it seems to me that it
is more correct to use the "whoami" command.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
tikhonov 5 лет назад
Родитель
Сommit
d369b2e193
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      contrib/mc-wrapper.csh.in
  2. 1 1
      contrib/mc-wrapper.sh.in

+ 1 - 1
contrib/mc-wrapper.csh.in

@@ -1,4 +1,4 @@
-set MC_USER="`id | sed 's/[^(]*(//;s/).*//'`"
+set MC_USER=`whoami`
 
 if ($?TMPDIR) then
 	setenv MC_PWD_FILE $TMPDIR/mc-$MC_USER/mc.pwd.$$

+ 1 - 1
contrib/mc-wrapper.sh.in

@@ -1,4 +1,4 @@
-MC_USER=`id | sed 's/[^(]*(//;s/).*//'`
+MC_USER=`whoami`
 MC_PWD_FILE="${TMPDIR-/tmp}/mc-$MC_USER/mc.pwd.$$"
 @bindir@/mc -P "$MC_PWD_FILE" "$@"