Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 252155
Collapse All | Expand All

(-)fbterm-1.3/config.h.in (-3 lines)
Lines 6-14 Link Here
6
/* Define to 1 if you have the <fcntl.h> header file. */
6
/* Define to 1 if you have the <fcntl.h> header file. */
7
#undef HAVE_FCNTL_H
7
#undef HAVE_FCNTL_H
8
8
9
/* */
10
#undef HAVE_FS_CAPABILITY
11
12
/* Define to 1 if you have the `getpagesize' function. */
9
/* Define to 1 if you have the `getpagesize' function. */
13
#undef HAVE_GETPAGESIZE
10
#undef HAVE_GETPAGESIZE
14
11
(-)fbterm-1.3/configure (-78 / +3 lines)
Lines 707-714 Link Here
707
CPP
707
CPP
708
GREP
708
GREP
709
EGREP
709
EGREP
710
HAVE_FS_CAPABILITY_TRUE
711
HAVE_FS_CAPABILITY_FALSE
712
LIBOBJS
710
LIBOBJS
713
LTLIBOBJS'
711
LTLIBOBJS'
714
ac_subst_files=''
712
ac_subst_files=''
Lines 5684-5710 Link Here
5684
fi
5682
fi
5685
5683
5686
5684
5687
5688
5689
5690
FS_CAP=
5691
if `which setcap > /dev/null` && test "`uname -r`" ">" "2.6.26"; then
5692
  FS_CAP=1
5693
  cat >>confdefs.h <<\_ACEOF
5694
#define HAVE_FS_CAPABILITY 1
5695
_ACEOF
5696
5697
fi
5698
5699
 if test -n "$FS_CAP"; then
5700
  HAVE_FS_CAPABILITY_TRUE=
5701
  HAVE_FS_CAPABILITY_FALSE='#'
5702
else
5703
  HAVE_FS_CAPABILITY_TRUE='#'
5704
  HAVE_FS_CAPABILITY_FALSE=
5705
fi
5706
5707
5708
# Checks for library functions.
5685
# Checks for library functions.
5709
if test $ac_cv_c_compiler_gnu = yes; then
5686
if test $ac_cv_c_compiler_gnu = yes; then
5710
    { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
5687
    { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
Lines 6685-6697 Link Here
6685
Usually this means the macro was only invoked conditionally." >&2;}
6662
Usually this means the macro was only invoked conditionally." >&2;}
6686
   { (exit 1); exit 1; }; }
6663
   { (exit 1); exit 1; }; }
6687
fi
6664
fi
6688
if test -z "${HAVE_FS_CAPABILITY_TRUE}" && test -z "${HAVE_FS_CAPABILITY_FALSE}"; then
6689
  { { echo "$as_me:$LINENO: error: conditional \"HAVE_FS_CAPABILITY\" was never defined.
6690
Usually this means the macro was only invoked conditionally." >&5
6691
echo "$as_me: error: conditional \"HAVE_FS_CAPABILITY\" was never defined.
6692
Usually this means the macro was only invoked conditionally." >&2;}
6693
   { (exit 1); exit 1; }; }
6694
fi
6695
6665
6696
: ${CONFIG_STATUS=./config.status}
6666
: ${CONFIG_STATUS=./config.status}
6697
ac_clean_files_save=$ac_clean_files
6667
ac_clean_files_save=$ac_clean_files
Lines 7322-7333 Link Here
7322
CPP!$CPP$ac_delim
7292
CPP!$CPP$ac_delim
7323
GREP!$GREP$ac_delim
7293
GREP!$GREP$ac_delim
7324
EGREP!$EGREP$ac_delim
7294
EGREP!$EGREP$ac_delim
7325
HAVE_FS_CAPABILITY_TRUE!$HAVE_FS_CAPABILITY_TRUE$ac_delim
7326
HAVE_FS_CAPABILITY_FALSE!$HAVE_FS_CAPABILITY_FALSE$ac_delim
7327
LIBOBJS!$LIBOBJS$ac_delim
7295
LIBOBJS!$LIBOBJS$ac_delim
7296
LTLIBOBJS!$LTLIBOBJS$ac_delim
7328
_ACEOF
7297
_ACEOF
7329
7298
7330
  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
7299
  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then
7331
    break
7300
    break
7332
  elif $ac_last_try; then
7301
  elif $ac_last_try; then
7333
    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
7302
    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
Lines 7363-7412 Link Here
7363
_ACEOF
7332
_ACEOF
7364
7333
7365
7334
7366
ac_delim='%!_!# '
7367
for ac_last_try in false false false false false :; do
7368
  cat >conf$$subs.sed <<_ACEOF
7369
LTLIBOBJS!$LTLIBOBJS$ac_delim
7370
_ACEOF
7371
7372
  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 1; then
7373
    break
7374
  elif $ac_last_try; then
7375
    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
7376
echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
7377
   { (exit 1); exit 1; }; }
7378
  else
7379
    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
7380
  fi
7381
done
7382
7383
ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
7384
if test -n "$ac_eof"; then
7385
  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
7386
  ac_eof=`expr $ac_eof + 1`
7387
fi
7388
7389
cat >>$CONFIG_STATUS <<_ACEOF
7390
cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
7391
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
7392
_ACEOF
7393
sed '
7394
s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
7395
s/^/s,@/; s/!/@,|#_!!_#|/
7396
:n
7397
t n
7398
s/'"$ac_delim"'$/,g/; t
7399
s/$/\\/; p
7400
N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
7401
' >>$CONFIG_STATUS <conf$$subs.sed
7402
rm -f conf$$subs.sed
7403
cat >>$CONFIG_STATUS <<_ACEOF
7404
:end
7405
s/|#_!!_#|//g
7406
CEOF$ac_eof
7407
_ACEOF
7408
7409
7410
# VPATH may cause trouble with some makes, so we remove $(srcdir),
7335
# VPATH may cause trouble with some makes, so we remove $(srcdir),
7411
# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
7336
# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
7412
# trailing colons and then remove the whole line if VPATH becomes empty
7337
# trailing colons and then remove the whole line if VPATH becomes empty
Lines 7656-7662 Link Here
7656
s&@INSTALL@&$ac_INSTALL&;t t
7581
s&@INSTALL@&$ac_INSTALL&;t t
7657
s&@MKDIR_P@&$ac_MKDIR_P&;t t
7582
s&@MKDIR_P@&$ac_MKDIR_P&;t t
7658
$ac_datarootdir_hack
7583
$ac_datarootdir_hack
7659
" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
7584
" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out
7660
7585
7661
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
7586
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
7662
  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
7587
  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
(-)fbterm-1.3/src/fbterm.cpp (-6 lines)
Lines 241-249 Link Here
241
241
242
void FbTerm::initChildProcess()
242
void FbTerm::initChildProcess()
243
{
243
{
244
#ifndef HAVE_FS_CAPABILITY
245
    setuid(getuid());
244
    setuid(getuid());
246
#endif
247
245
248
#ifdef HAVE_SIGNALFD
246
#ifdef HAVE_SIGNALFD
249
	sigprocmask(SIG_SETMASK, &oldSigmask, 0);
247
	sigprocmask(SIG_SETMASK, &oldSigmask, 0);
Lines 252-267 Link Here
252
	signal(SIGPIPE, SIG_DFL);
250
	signal(SIGPIPE, SIG_DFL);
253
}
251
}
254
252
255
#ifndef HAVE_FS_CAPABILITY
256
u32 effective_uid;
253
u32 effective_uid;
257
#endif
258
254
259
int main(int argc, char **argv)
255
int main(int argc, char **argv)
260
{
256
{
261
#ifndef HAVE_FS_CAPABILITY
262
	effective_uid = geteuid();
257
	effective_uid = geteuid();
263
	seteuid(getuid());
258
	seteuid(getuid());
264
#endif
265
259
266
	if (Config::instance()->parseArgs(argc, argv)) {
260
	if (Config::instance()->parseArgs(argc, argv)) {
267
		FbTerm::instance()->run();
261
		FbTerm::instance()->run();
(-)fbterm-1.3/src/input.cpp (-5 lines)
Lines 26-32 Link Here
26
#include <sys/vt.h>
26
#include <sys/vt.h>
27
#include <linux/kd.h>
27
#include <linux/kd.h>
28
#include <linux/input.h>
28
#include <linux/input.h>
29
#include "config.h"
30
#include "input.h"
29
#include "input.h"
31
#include "input_key.h"
30
#include "input_key.h"
32
#include "fbshell.h"
31
#include "fbshell.h"
Lines 124-133 Link Here
124
123
125
	if (!syskey_saved && restore) return;
124
	if (!syskey_saved && restore) return;
126
125
127
#ifndef HAVE_FS_CAPABILITY
128
	extern s32 effective_uid;
126
	extern s32 effective_uid;
129
	seteuid(effective_uid);
127
	seteuid(effective_uid);
130
#endif
131
128
132
	for (u32 i = 0; i < sizeof(sysKeyTable) / sizeof(KeyEntry); i++) {
129
	for (u32 i = 0; i < sizeof(sysKeyTable) / sizeof(KeyEntry); i++) {
133
		kbentry entry;
130
		kbentry entry;
Lines 145-153 Link Here
145
142
146
	if (!syskey_saved && !restore) syskey_saved = true;
143
	if (!syskey_saved && !restore) syskey_saved = true;
147
144
148
#ifndef HAVE_FS_CAPABILITY
149
	seteuid(getuid());
145
	seteuid(getuid());
150
#endif
151
}
146
}
152
147
153
void TtyInput::readyRead(s8 *buf, u32 len)
148
void TtyInput::readyRead(s8 *buf, u32 len)
(-)fbterm-1.3/src/Makefile.in (-2 / +2 lines)
Lines 729-736 Link Here
729
729
730
730
731
install-exec-hook:
731
install-exec-hook:
732
@HAVE_FS_CAPABILITY_TRUE@	setcap 'cap_sys_tty_config+ep' $(DESTDIR)$(bindir)/fbterm$(EXEEXT)
732
	setcap 'cap_sys_tty_config+ep' $(DESTDIR)$(bindir)/fbterm$(EXEEXT) 2>/dev/null || \
733
@HAVE_FS_CAPABILITY_FALSE@	chmod u+s $(DESTDIR)$(bindir)/fbterm$(EXEEXT)
733
	chmod u+s $(DESTDIR)$(bindir)/fbterm$(EXEEXT)
734
# Tell versions [3.59,3.63) of GNU make to not export all variables.
734
# Tell versions [3.59,3.63) of GNU make to not export all variables.
735
# Otherwise a system limit (for SysV at least) may be exceeded.
735
# Otherwise a system limit (for SysV at least) may be exceeded.
736
.NOEXPORT:
736
.NOEXPORT:

Return to bug 252155