Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 134619

Summary: dev-vcs/cvs-1.12.12 does not work with mit-krb5-1.4.3: no kerberos4 auth support
Product: Gentoo Linux Reporter: borut.kersevan
Component: [OLD] DevelopmentAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED TEST-REQUEST    
Severity: major CC: pacho
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: configure script patch
cvs server.c krb.h include fix
cvs kerberos-client.c fix

Description borut.kersevan 2006-05-28 04:58:59 UTC
The distributed cvs code and ebuild has several defficiencies regarding the kerberos4 support; when emerging the cvs it does not compile with kerberos4 support in. 
I get the loving message:
----
cvs checkout: CVSROOT is set for a kerberos access method but your
cvs [checkout aborted]: CVS executable doesn't support it.
----

1)First thing that is missing is the correct path in the cvs ebuild file, I added:
-src_compile() {
        econf \
-with-krb4=/usr/include/kerberosIV
...
for the configure script to find krb.h at all..

2)The cvs configure does not look for -lkrb4 as an alternative to -lkrb where it should; I modified it by replacing the -lkrb with -lkrb4 where needed so that the checks for kerberos4 pass.. (the patch is attached).

3) When configure sets HAVE_KERBEROS after the above fixes the server.c does not
compile because the include of <krb.h> and co. is wrapped within 
#ifdef SERVER_SUPPORT which is off in the ebuild; I copied the stuff out of this condition statement to make it work (the patch is attached).

4.) The kerberos-client.c does not want to compile because it is missing the 4th argument ("root") in the call of make_bufs_from_fds; the fix is trivial (the patch is attached).

Only after all this fixing the cvs compiles with kerberos support and seems to work ok.. 
--------------
The patches:
hex files # cat cvs-1.12.12-config-tmpfix.patch
--- cvs-1.12.12.orig/configure  2005-04-18 19:20:26.000000000 +0200
+++ cvs-1.12.12/configure       2006-05-28 12:35:17.535407000 +0200
@@ -34950,13 +34950,13 @@
   if test "$cross_compiling" != yes && test -r $KRB4/lib/libkrb.a; then
        hold_ldflags=$LDFLAGS
        LDFLAGS="-L${KRB4}/lib $LDFLAGS"
-       echo "$as_me:$LINENO: checking for printf in -lkrb" >&5
-echo $ECHO_N "checking for printf in -lkrb... $ECHO_C" >&6
+       echo "$as_me:$LINENO: checking for printf in -lkrb4" >&5
+echo $ECHO_N "checking for printf in -lkrb4... $ECHO_C" >&6
 if test "${ac_cv_lib_krb_printf+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lkrb  $LIBS"
+LIBS="-lkrb4  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -35020,13 +35020,13 @@
   LDFLAGS=$hold_ldflags
             # Using open here instead of printf so we don't
             # get confused by the cached value for printf from above.
-            echo "$as_me:$LINENO: checking for open in -lkrb" >&5
-echo $ECHO_N "checking for open in -lkrb... $ECHO_C" >&6
+            echo "$as_me:$LINENO: checking for open in -lkrb4" >&5
+echo $ECHO_N "checking for open in -lkrb4... $ECHO_C" >&6
 if test "${ac_cv_lib_krb_open+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lkrb  $LIBS"
+LIBS="-lkrb4  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -35092,13 +35092,13 @@

        LDFLAGS=$hold_ldflags
   else
-       echo "$as_me:$LINENO: checking for printf in -lkrb" >&5
-echo $ECHO_N "checking for printf in -lkrb... $ECHO_C" >&6
+       echo "$as_me:$LINENO: checking for printf in -lkrb4" >&5
+echo $ECHO_N "checking for printf in -lkrb4... $ECHO_C" >&6
 if test "${ac_cv_lib_krb_printf+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   ac_check_lib_save_LIBS=$LIBS
-LIBS="-lkrb  $LIBS"
+LIBS="-lkrb4  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF

-----

hex files # cat cvs-1.12.12-server-tmpfix.patch
--- cvs-1.12.12.orig/src/server.c       2005-04-14 16:13:29.000000000 +0200
+++ cvs-1.12.12/src/server.c    2006-05-28 13:01:02.123938000 +0200
@@ -42,6 +42,19 @@

 #endif /* defined (HAVE_GSSAPI) && defined (SERVER_SUPPORT) */

+# ifdef HAVE_KERBEROS
+#   include <netinet/in.h>
+#   include <krb.h>
+#   ifndef HAVE_KRB_GET_ERR_TEXT
+#     define krb_get_err_text(status) krb_err_txt[status]
+#   endif
+
+/* Information we need if we are going to use Kerberos encryption.  */
+static C_Block kblock;
+static Key_schedule sched;
+
+# endif /* HAVE_KERBEROS */
+
 #ifdef SERVER_SUPPORT

 extern char *server_hostname;

--------

hex files # cat cvs-1.12.12-kclient-tmpfix.patch
--- cvs-1.12.12.orig/src/kerberos4-client.c     2005-04-14 16:13:26.000000000 +0200
+++ cvs-1.12.12/src/kerberos4-client.c  2006-05-28 13:05:52.386078000 +0200
@@ -95,7 +95,7 @@
     free (hname);

     /* Give caller the values it wants. */
-    make_bufs_from_fds (s, s, 0, to_server_p, from_server_p, 1);
+    make_bufs_from_fds (s, s, 0, root, to_server_p, from_server_p, 1);
 }

 void
 
--------------
My emerge info:

Portage 2.1_rc1-r4 (default-linux/x86/2006.0, gcc-3.4.6, glibc-2.4-r2, 2.6.16-suspend2-r5 i686)
=================================================================
System uname: 2.6.16-suspend2-r5 i686 Intel(R) Pentium(R) M processor 2.00GHz
Gentoo Base System version 1.12.0_pre19
dev-lang/python:     2.4.3-r1
dev-python/pycrypto: 2.0.1-r5
dev-util/ccache:     [Not Present]
dev-util/confcache:  [Not Present]
sys-apps/sandbox:    1.2.18
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2
sys-devel/binutils:  2.16.1-r2
sys-devel/libtool:   1.5.22
virtual/os-headers:  2.6.11-r5
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/texmf/web2c /etc/env.d"
CXXFLAGS="-O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"
GENTOO_MIRRORS="ftp://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ ftp://ftp.tu-clausthal.de/pub/linux/gentoo/  http://gentoo.osuosl.org/ ftp://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://distro.ibiblio.org/pub/linux/distributions/gentoo/ http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/ "
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X acl acpi alsa apm arts avi bash-completition bidi bitmap-fonts bonobo cdr cli crypt cups dbus dga directfb dri dvd eds emacs emacs-w3 emboss encode ffmpeg foomaticdb fortran gd gdbm gif gnome gphoto2 gpm gstreamer gtk gtk2 guile hal imagemagick imlib ipv6 isdnlog java jpeg kde kerberos krb4 ldap libg++ libwww lm_sensors mad matroska mikmod mmx motif mp3 mpeg mule ncurses nls nptl nptlonly ogg oggvorbis opengl oss pam pam_console pcmcia pcre pdflib perl png pppd python qt quicktime readline reflection sasl sdl session spell spl sse ssl tcpd tetex threads tiff truetype truetype-fonts type1-fonts usb vorbis xemacs xinerama xml2 xmms xorg xv xvidi zlib elibc_glibc kernel_linux userland_GNU"
Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 borut.kersevan 2006-05-28 05:00:14 UTC
Created attachment 87725 [details, diff]
configure script patch
Comment 2 borut.kersevan 2006-05-28 05:00:58 UTC
Created attachment 87726 [details, diff]
cvs server.c krb.h include fix
Comment 3 borut.kersevan 2006-05-28 05:01:27 UTC
Created attachment 87727 [details, diff]
cvs kerberos-client.c fix
Comment 4 Pacho Ramos gentoo-dev 2013-11-23 13:02:51 UTC
Is this still valid?