Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Use setresuid() to fix accessing D-Bus.

  • Loading branch information...
commit 53ebf838b3a09b76e48ae2d809a11bdd7f8b1e67 1 parent 79978cc
Michał Górny authored

Showing 2 changed files with 4 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 0  configure.ac
  2. +2 2 sw-notify-send.c
2  configure.ac
@@ -7,6 +7,8 @@ AC_PROG_CC_C89
7 7 AC_USE_SYSTEM_EXTENSIONS
8 8
9 9 AC_CHECK_FUNCS([chroot])
  10 +AC_CHECK_FUNCS([setresuid],,
  11 + [AC_MSG_ERROR([One of required system library functions was not found!])])
10 12 AC_CHECK_HEADERS([sysexits.h])
11 13 AC_CHECK_LIB([proc], [readproc],,
12 14 [AC_MSG_ERROR([Error: required library proc not found! Please install procps.])])
4 sw-notify-send.c
@@ -100,7 +100,7 @@ int send_notify(char* const display, char* const xauth,
100 100 if (root)
101 101 CANFAIL(chroot(root));
102 102 #endif
103   - CANFAIL(seteuid(uid));
  103 + CANFAIL(setresuid(uid, uid, old_uid));
104 104
105 105 CANTFAIL(putenv(display));
106 106 CANTFAIL(putenv(xauth));
@@ -109,7 +109,7 @@ int send_notify(char* const display, char* const xauth,
109 109 if (!notification_send(n, s))
110 110 ret = 1;
111 111
112   - CANTFAIL(seteuid(old_uid));
  112 + CANTFAIL(setuid(old_uid));
113 113 #ifdef HAVE_CHROOT
114 114 if (root)
115 115 CANTFAIL(chroot(".")); /* escape the chroot */

0 comments on commit 53ebf83

Please sign in to comment.
Something went wrong with that request. Please try again.