~ubuntu-branches/ubuntu/lucid/xsplash/lucid

« back to all changes in this revision

Viewing changes to debian/patches/90_correctly-setuid.patch

  • Committer: Bazaar Package Importer
  • Author(s): Ken VanDine
  • Date: 2009-10-09 08:16:49 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20091009081649-o8fv2h2qt0fplxf2
Tags: 0.8.3-0ubuntu1
* New upstream version (LP: #446658)
  - watch for monitors-changed signal (LP: #413348)
  - set a blank cursor on the cow foreign window (LP: #432179)
  - setgid fixes (LP: #439268)
  - 16bpp depth fixes (LP: #423632)
* debian/patches/90_correctly-setuid.patch
  - Removed, merged upstream 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: setuid()'s return must be checked in the case that some RLIMIT
2
 
 or other issue does not stop the transition.  Additionally, setresuid()
3
 
 should be used so that the process cannot regain its prior uid.
4
 
Author: Kees Cook <kees@ubuntu.com>
5
 
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/xsplash/+bug/439272
6
 
Bug: https://bugs.launchpad.net/xsplash/+bug/439272
7
 
Last-Update: 2009-10-03
8
 
 
9
 
diff -Nur -x '*.orig' -x '*~' xsplash-0.8.1/src/xsplash.c xsplash-0.8.1.new/src/xsplash.c
10
 
--- xsplash-0.8.1/src/xsplash.c 2009-09-30 13:16:13.000000000 -0700
11
 
+++ xsplash-0.8.1.new/src/xsplash.c     2009-09-30 13:17:30.000000000 -0700
12
 
@@ -890,7 +890,10 @@
13
 
 
14
 
   uid = pwd->pw_uid;
15
 
 
16
 
-  setuid (uid);
17
 
+  if ( setresuid (uid, uid, uid) < 0) {
18
 
+      g_error ("Unable to setuid to: %s", XSPLASH_USER);
19
 
+      return 1;
20
 
+  }
21
 
 
22
 
   context = g_option_context_new ("xsplash");
23
 
   g_option_context_add_main_entries (context,