File: CVE-2007-5191.dpatch

package info (click to toggle)
util-linux 2.12r-19etch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 8,932 kB
  • ctags: 5,101
  • sloc: ansic: 46,134; sh: 8,074; makefile: 1,111; perl: 86; csh: 62; sed: 55
file content (37 lines) | stat: -rw-r--r-- 1,401 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/sh /usr/share/dpatch/dpatch-run

@DPATCH@
--- ../old/util-linux-2.12r/mount/mount.c	2007-12-22 13:07:40.000000000 +0000
+++ util-linux-2.12r/mount/mount.c	2007-12-22 13:40:00.000000000 +0000
@@ -491,8 +491,12 @@
 		 const char *oo, *mountargs[10];
 		 int i = 0;
 
-		 setuid(getuid());
-		 setgid(getgid());
+                 if(setgid(getgid()) < 0)
+                          die(EX_FAIL, _("mount: cannot set group id: %s"), strerror(errno));
+
+                  if(setuid(getuid()) < 0)
+                          die(EX_FAIL, _("mount: cannot set user id: %s"), strerror(errno));
+
 		 oo = fix_opts_string (flags, extra_opts, NULL);
 		 mountargs[i++] = mountprog;
 		 mountargs[i++] = spec;
--- ../old/util-linux-2.12r/mount/umount.c	2007-12-22 13:07:40.000000000 +0000
+++ util-linux-2.12r/mount/umount.c	2007-12-22 13:40:34.000000000 +0000
@@ -118,8 +118,12 @@
 				char *umountargs[8];
 				int i = 0;
 
-				setuid(getuid());
-				setgid(getgid());
+                                if(setgid(getgid()) < 0)
+                                         die(EX_FAIL, _("umount: cannot set group id: %s"), strerror(errno));
+
+                                if(setuid(getuid()) < 0)
+                                         die(EX_FAIL, _("umount: cannot set user id: %s"), strerror(errno));
+
 				umountargs[i++] = umountprog;
 				umountargs[i++] = xstrdup(node);
 				if (nomtab)