File cku211-ttylock.diff of Package ckermit
diff -Naur ckcdeb.h ckcdeb.h
--- ckcdeb.h 2010-07-26 01:31:22.000000000 +0200
+++ ckcdeb.h 2010-07-26 01:33:58.000000000 +0200
@@ -2149,9 +2149,9 @@
#ifdef USE_UU_LOCK /* FreeBSD or other with uu_lock() */
#define USETTYLOCK
#else
-#ifdef HAVE_BAUDBOY /* Red Hat Linux >= 7.2 */
+#ifdef HAVE_LOCKDEV /* Red Hat Linux >= 7.2 and openSuSE >= 11.3 */
#define USETTYLOCK
-#endif /* HAVE_BAUDBOY */
+#endif /* HAVE_LOCKDEV */
#endif /* USE_UU_LOCK */
#endif /* AIXRS */
#endif /* USETTYLOCK */
diff -Naur ckutio.c ckutio.c
--- ckutio.c 2004-04-17 20:44:04.000000000 +0200
+++ ckutio.c 2010-07-26 01:40:00.000000000 +0200
@@ -305,15 +305,19 @@
#ifndef NOUUCP
#ifdef USETTYLOCK
+#ifdef HAVE_LOCKDEV /* Red Hat baudboy/lockdev */
#ifdef HAVE_BAUDBOY /* Red Hat baudboy/lockdev */
#include <baudboy.h>
+#else /* !HAVE_BAUDBOY */
+#include <ttylock.h>
+#endif /* HAVE_BAUDBOY */
#else
#ifdef USE_UU_LOCK
#ifdef __FreeBSD__
#include <libutil.h> /* FreeBSD */
#else
#include <util.h> /* OpenBSD */
-#endif /* HAVE_BAUDBOY */
+#endif /* HAVE_LOCKDEV */
#endif /* __FreeBSD */
#endif /* USE_UU_LOCK */
#else /* USETTYLOCK */
@@ -13509,7 +13513,7 @@
priv_ini() {
int err = 0;
-#ifndef HAVE_BAUDBOY
+#ifndef HAVE_LOCKDEV
/* Save real ID:s. */
realuid = getuid();
@@ -13590,7 +13594,7 @@
err &= ~1; /* System V R0 does not save UID */
#endif /* ATT7300 */
}
-#endif /* HAVE_BAUDBOY */
+#endif /* HAVE_LOCKDEV */
return(err);
}
@@ -13668,7 +13672,7 @@
*/
int
priv_on() {
-#ifndef HAVE_BAUDBOY
+#ifndef HAVE_LOCKDEV
if (privgid != (GID_T) -1)
if (switchgid(realgid,privgid))
return(2);
@@ -13679,7 +13683,7 @@
switchgid(privgid,realgid);
return(1);
}
-#endif /* HAVE_BAUDBOY */
+#endif /* HAVE_LOCKDEV */
return(0);
}
@@ -13695,7 +13699,7 @@
int
priv_off() {
int err = 0;
-#ifndef HAVE_BAUDBOY
+#ifndef HAVE_LOCKDEV
if (privuid != (UID_T) -1)
if (switchuid(privuid,realuid))
err |= 1;
@@ -13703,7 +13707,7 @@
if (privgid != (GID_T) -1)
if (switchgid(privgid,realgid))
err |= 2;
-#endif /* HAVE_BAUDBOY */
+#endif /* HAVE_LOCKDEV */
return(err);
}
@@ -13719,7 +13723,7 @@
*/
int
priv_can() {
-#ifndef HAVE_BAUDBOY
+#ifndef HAVE_LOCKDEV
#ifdef SETREUID
int err = 0;
if (privuid != (UID_T) -1)
@@ -13759,7 +13763,7 @@
#endif /* SETREUID */
#else
return(0);
-#endif /* HAVE_BAUDBOY */
+#endif /* HAVE_LOCKDEV */
}
/* P R I V _ O P N -- For opening protected files or devices. */
diff -Naur ckuus5.c ckuus5.c
--- ckuus5.c 2010-07-26 01:30:53.000000000 +0200
+++ ckuus5.c 2010-07-26 01:41:30.000000000 +0200
@@ -10302,6 +10302,9 @@
#ifdef HAVE_BAUDBOY
makestr(&(optlist[noptlist++]),"HAVE_BAUDBOY");
#endif /* HAVE_BAUDBOY */
+#ifdef HAVE_TTYLOCK
+ makestr(&(optlist[noptlist++]),"HAVE_TTYLOCK");
+#endif /* HAVE_TTYLOCK */
#ifdef NOUUCP
makestr(&(optlist[noptlist++]),"NOUUCP");
#endif /* NOUUCP */
diff -Naur makefile makefile
--- makefile 2010-07-26 01:30:53.000000000 +0200
+++ makefile 2010-07-26 01:46:34.000000000 +0200
@@ -5472,19 +5472,27 @@
#HAVE_BAUDBOY added in 8.0.210 for Red Hat -- it's like AIX ttylock().
linux:
HAVE_PTMX='' ; \
+ if test -f /usr/include/baudboy.h || test -f /usr/include/ttylock.h; \
+ then HAVE_LOCKDEV='-DHAVE_LOCKDEV' ; \
+ else HAVE_LOCKDEV='' ; fi ; \
if test -f /usr/include/baudboy.h ; \
then HAVE_BAUDBOY='-DHAVE_BAUDBOY' ; \
else HAVE_BAUDBOY='' ; fi ; \
+ if test -f /usr/include/ttylock.h ; \
+ then HAVE_TTYLOCK='-DHAVE_TTYLOCK' ; \
+ else HAVE_TTYLOCK='' ; fi ; \
$(MAKE) KTARGET=$${KTARGET:-$(@)} \
"KFLAGS=-DCK_NCURSES -I/usr/include/ncurses \
- $$HAVE_PTMX $$HAVE_BAUDBOY \
+ $$HAVE_PTMX $$HAVE_LOCKDEV $$HAVE_BAUDBOY $$HAVE_TTYLOCK \
`if test -f /usr/include/crypt.h; then echo -DHAVE_CRYPT_H; fi` \
$(KFLAGS)" \
"LIBS=-lncurses \
`if test -f /usr/lib/libresolv.a || test -f /usr/lib/libresolv.so; \
then echo -lresolv; fi` \
`if test -f /usr/lib/libcrypt.a || test -f /usr/lib/libcrypt.so; \
- then echo -lcrypt; fi`" \
+ then echo -lcrypt; fi` \
+ `if test -f /usr/lib/liblockdev.a || test -f /usr/lib/liblockdev.so; \
+ then echo -llockdev; fi`" \
linuxa
# As above but for Linux systems that have no <sys/select.h>.