Do not use setreuid()/setregid() under OpenBSD,
use seteuid()/setegid() to set eff uid/gid, use setuid()/setgid() to drop privs instead.
This commit is contained in:
parent
4636ef9863
commit
bb05206d57
@ -1,30 +1,31 @@
|
|||||||
*** config.h.orig Sat Nov 1 01:48:00 1997
|
--- config.h.orig Sat Nov 1 01:48:00 1997
|
||||||
--- config.h Fri Dec 18 14:49:44 1998
|
+++ config.h Mon Dec 21 00:04:30 1998
|
||||||
***************
|
@@ -20,7 +20,7 @@
|
||||||
*** 58,64 ****
|
|
||||||
|
/* Operating system INdependant parameters. (Usually the same everywhere) */
|
||||||
#ifdef __FreeBSD__
|
#define KERMIT "/usr/local/bin/kermit -l %l -b %b" /* How to call kermit */
|
||||||
# define DFL_PORT "/dev/modem"
|
-#define UUCPLOCK "/var/spool/uucp" /* Lock file directory */
|
||||||
! # define DEF_BAUD "19200"
|
+#define UUCPLOCK "/var/spool/lock" /* Lock file directory */
|
||||||
# define CALLOUT ""
|
#define LOGFILE "minicom.log" /* Not defined = not used */
|
||||||
# define CALLIN ""
|
|
||||||
#endif
|
/* Operating system dependant parameters, per OS. A few samples are given. */
|
||||||
--- 58,75 ----
|
@@ -58,7 +58,18 @@
|
||||||
|
|
||||||
#ifdef __FreeBSD__
|
#ifdef __FreeBSD__
|
||||||
# define DFL_PORT "/dev/modem"
|
# define DFL_PORT "/dev/modem"
|
||||||
! # define DEF_BAUD "38400"
|
-# define DEF_BAUD "19200"
|
||||||
! # define CALLOUT ""
|
+# define DEF_BAUD "38400"
|
||||||
! # define CALLIN ""
|
+# define CALLOUT ""
|
||||||
! #endif
|
+# define CALLIN ""
|
||||||
!
|
+#endif
|
||||||
! #ifdef __OpenBSD__
|
+
|
||||||
! # ifdef sparc
|
+#ifdef __OpenBSD__
|
||||||
! # define DFL_PORT "/dev/ttya"
|
+# ifdef sparc
|
||||||
! # else
|
+# define DFL_PORT "/dev/ttya"
|
||||||
! # define DFL_PORT "/dev/tty00"
|
+# else
|
||||||
! # endif
|
+# define DFL_PORT "/dev/tty00"
|
||||||
! # define DEF_BAUD "38400"
|
+# endif
|
||||||
# define CALLOUT ""
|
+# define DEF_BAUD "38400"
|
||||||
# define CALLIN ""
|
# define CALLOUT ""
|
||||||
#endif
|
# define CALLIN ""
|
||||||
|
#endif
|
||||||
|
43
comms/minicom/patches/patch-ak
Normal file
43
comms/minicom/patches/patch-ak
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
--- util.c.orig Sat May 16 14:13:12 1998
|
||||||
|
+++ util.c Mon Dec 21 00:20:31 1998
|
||||||
|
@@ -165,7 +165,7 @@
|
||||||
|
/* Drop all priviliges (irreversable). */
|
||||||
|
void drop_all_privs()
|
||||||
|
{
|
||||||
|
-#ifdef HAS_REUID
|
||||||
|
+#if defined(HAS_REUID) && !defined(__OpenBSD__)
|
||||||
|
/* Regain privs needed to drop privs :) */
|
||||||
|
setregid(real_gid, eff_gid);
|
||||||
|
setreuid(real_uid, eff_uid);
|
||||||
|
@@ -183,9 +183,15 @@
|
||||||
|
void drop_privs()
|
||||||
|
{
|
||||||
|
#ifdef HAS_REUID
|
||||||
|
+# ifndef __OpenBSD__
|
||||||
|
setregid(eff_gid, real_gid);
|
||||||
|
if (setreuid(eff_uid, real_uid) < 0)
|
||||||
|
fprintf(stderr, "minicom: cannot setreuid(%d, %d)\n", eff_uid, real_uid);
|
||||||
|
+# else
|
||||||
|
+ setegid(real_gid);
|
||||||
|
+ if (seteuid(real_uid) < 0)
|
||||||
|
+ fprintf(stderr, "minicom: cannot seteuid(%d)\n", real_uid);
|
||||||
|
+# endif
|
||||||
|
not_suid = 1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
@@ -194,9 +200,15 @@
|
||||||
|
void set_privs()
|
||||||
|
{
|
||||||
|
#ifdef HAS_REUID
|
||||||
|
+# ifndef __OpenBSD__
|
||||||
|
setregid(real_gid, eff_gid);
|
||||||
|
if (setreuid(real_uid, eff_uid) < 0)
|
||||||
|
fprintf(stderr, "minicom: cannot setreuid(%d, %d)\n", real_uid, eff_uid);
|
||||||
|
+# else
|
||||||
|
+ setegid(eff_gid);
|
||||||
|
+ if (seteuid(eff_uid) < 0)
|
||||||
|
+ fprintf(stderr, "minicom: cannot setreuid(%d)\n", eff_uid);
|
||||||
|
+# endif
|
||||||
|
not_suid = 0;
|
||||||
|
#endif
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user