* [gentoo-commits] gentoo-x86 commit in net-misc/stunnel/files: stunnel-4.21-setuid.patch digest-stunnel-4.21-r1
@ 2007-12-19 11:52 Ulrich Mueller (ulm)
0 siblings, 0 replies; only message in thread
From: Ulrich Mueller (ulm) @ 2007-12-19 11:52 UTC (permalink / raw
To: gentoo-commits
ulm 07/12/19 11:52:59
Added: stunnel-4.21-setuid.patch digest-stunnel-4.21-r1
Log:
Apply patch from upstream wrt bug #202709.
(Portage version: 2.1.4_rc10)
Revision Changes Path
1.1 net-misc/stunnel/files/stunnel-4.21-setuid.patch
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/stunnel/files/stunnel-4.21-setuid.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/stunnel/files/stunnel-4.21-setuid.patch?rev=1.1&content-type=text/plain
Index: stunnel-4.21-setuid.patch
===================================================================
--- stunnel-4.21-orig/src/stunnel.c 2007-10-27 17:41:39.000000000 +0200
+++ stunnel-4.21/src/stunnel.c 2007-11-03 16:44:02.000000000 +0100
@@ -41,7 +41,7 @@
static void accept_connection(LOCAL_OPTIONS *);
static void get_limits(void); /* setup global max_clients and max_fds */
#if !defined (USE_WIN32) && !defined (__vms)
-static void make_chroot(void);
+static void drop_privileges(void);
static void daemonize(void);
static void create_pid(void);
static void delete_pid(void);
@@ -111,9 +111,6 @@
} else { /* inetd mode */
#if !defined (USE_WIN32) && !defined (__vms)&&!defined(USE_OS2)
max_fds=FD_SETSIZE; /* just in case */
-#ifdef HAVE_CHROOT
- make_chroot();
-#endif /* HAVE_CHROOT */
drop_privileges();
#endif
num_clients=1;
@@ -171,9 +168,6 @@
#if !defined (USE_WIN32) && !defined (__vms) && !defined(USE_OS2)
if(!(options.option.foreground))
daemonize();
-#ifdef HAVE_CHROOT
- make_chroot();
-#endif /* HAVE_CHROOT */
drop_privileges();
create_pid();
#endif /* !defined USE_WIN32 && !defined (__vms) */
@@ -299,24 +293,9 @@
#endif
}
-#ifdef HAVE_CHROOT
-static void make_chroot(void) {
- if(options.chroot_dir) {
- if(chroot(options.chroot_dir)) {
- sockerror("chroot");
- exit(1);
- }
- if(chdir("/")) {
- sockerror("chdir");
- exit(1);
- }
- }
-}
-#endif /* HAVE_CHROOT */
-
#if !defined (USE_WIN32) && !defined (__vms)
- /* set process user and group(s) id */
-void drop_privileges(void) {
+ /* chroot and set process user and group(s) id */
+static void drop_privileges(void) {
int uid=0, gid=0;
struct group *gr;
#ifdef HAVE_SETGROUPS
@@ -350,6 +329,20 @@
}
}
+#ifdef HAVE_CHROOT
+ /* chroot */
+ if(options.chroot_dir) {
+ if(chroot(options.chroot_dir)) {
+ sockerror("chroot");
+ exit(1);
+ }
+ if(chdir("/")) {
+ sockerror("chdir");
+ exit(1);
+ }
+ }
+#endif /* HAVE_CHROOT */
+
/* Set uid and gid */
if(gid) {
if(setgid(gid)) {
--- stunnel-4.21-orig/src/prototypes.h 2007-10-05 17:42:48.000000000 +0200
+++ stunnel-4.21/src/prototypes.h 2007-11-03 16:33:49.000000000 +0100
@@ -57,7 +57,6 @@
void main_initialize(char *, char *);
void main_execute(void);
void stunnel_info(int);
-void drop_privileges(void);
/**************************************** Prototypes for log.c */
1.1 net-misc/stunnel/files/digest-stunnel-4.21-r1
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/stunnel/files/digest-stunnel-4.21-r1?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/net-misc/stunnel/files/digest-stunnel-4.21-r1?rev=1.1&content-type=text/plain
Index: digest-stunnel-4.21-r1
===================================================================
MD5 1eaec5228979beca4d548f453304e311 stunnel-4.21.tar.gz 528196
RMD160 e0f599bb44bbdd5178af9972110f71ee64cbf724 stunnel-4.21.tar.gz 528196
SHA256 b1121c1157c48320491f1929eb1f1c64ba20f76c7352c0df01c77cf09be19add stunnel-4.21.tar.gz 528196
--
gentoo-commits@gentoo.org mailing list
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-12-19 11:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-19 11:52 [gentoo-commits] gentoo-x86 commit in net-misc/stunnel/files: stunnel-4.21-setuid.patch digest-stunnel-4.21-r1 Ulrich Mueller (ulm)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox