[OpenAFS-devel] Samba 3.0.21a && AFS

Turbo Fredriksson turbo@bayour.com
Sun, 15 Jan 2006 14:05:16 +0100


--=-=-=

Sorry for the cross post, but I can't find the original mail
I don't know if it was sent to the OpenAFS or the Samba
list...

I've managed to fix some compilation/build problems when
using '--with-afs' to Samba. Something about undefined
attributes:

----- s n i p -----
Linking bin/smbd
lib/afs.o: In function `afs_createtoken':
/usr/local/src/tmp/samba-3.0.21a.orig/source/lib/afs.c:170: undefined reference to `DES_key_sched'
/usr/local/src/tmp/samba-3.0.21a.orig/source/lib/afs.c:171: undefined reference to `DES_pcbc_encrypt'
auth/pass_check.o: In function `afs_auth':
/usr/local/src/tmp/samba-3.0.21a.orig/source/auth/pass_check.c:51: undefined reference to `setpag'
/usr/local/src/tmp/samba-3.0.21a.orig/source/auth/pass_check.c:52: undefined reference to `ka_UserAuthenticateGeneral'
collect2: ld returned 1 exit status
make: *** [bin/smbd] Error 1
----- s n i p -----

When this was solved, there where other problems, but
those are also fixed in the patch... I have yet to
actually RUN Samba with this, but it compiles and
installs correctly...


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline; filename=samba-3.0.21a_AFSFixes.patch
Content-Description: Samba AFS Fixes

diff -urN samba-3.0.21a.orig/source/Makefile.in samba-3.0.21a/source/Makefile.in
--- samba-3.0.21a.orig/source/Makefile.in	Wed Jan 11 15:05:30 2006
+++ samba-3.0.21a/source/Makefile.in	Sat Jan 14 11:30:23 2006
@@ -34,6 +34,7 @@
 IDMAP_LIBS=@IDMAP_LIBS@
 KRB5LIBS=@KRB5_LIBS@
 LDAP_LIBS=@LDAP_LIBS@
+AFS_LIBS=@AFS_LIBS@
 
 INSTALLCMD=@INSTALL@
 INSTALLLIBCMD_SH=@INSTALLLIBCMD_SH@
@@ -888,7 +889,8 @@
 	@echo Linking $@
 	@$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SMBD_OBJ) $(LDFLAGS) $(LDAP_LIBS) \
 		$(KRB5LIBS) $(DYNEXP) $(PRINT_LIBS) $(AUTH_LIBS) \
-		$(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) @POPTLIBS@
+		$(ACL_LIBS) $(PASSDB_LIBS) $(LIBS) @POPTLIBS@ \
+		$(AFS_LIBS)
 
 bin/nmbd@EXEEXT@: $(NMBD_OBJ) @BUILD_POPT@ bin/.dummy
 	@echo Linking $@
@@ -901,7 +903,8 @@
 bin/swat@EXEEXT@: $(SWAT_OBJ) @BUILD_POPT@ bin/.dummy
 	@echo Linking $@
 	@$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(SWAT_OBJ) $(LDFLAGS) $(DYNEXP) $(PRINT_LIBS) \
-	  $(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS)
+	  $(AUTH_LIBS) $(LIBS) $(PASSDB_LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) \
+	  $(AFS_LIBS)
 
 bin/rpcclient@EXEEXT@: $(RPCCLIENT_OBJ) @BUILD_POPT@ bin/.dummy
 	@echo Linking $@
@@ -919,7 +922,7 @@
 
 bin/net@EXEEXT@: $(NET_OBJ) @BUILD_POPT@ bin/.dummy
 	@echo Linking $@
-	@$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS)
+	@$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(NET_OBJ) $(DYNEXP) $(LDFLAGS) $(LIBS) @POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) $(AFS_LIBS)
 
 bin/profiles@EXEEXT@: $(PROFILES_OBJ) @BUILD_POPT@ bin/.dummy
 	@echo Linking $@
@@ -1172,7 +1175,8 @@
 bin/winbindd@EXEEXT@: $(WINBINDD_OBJ) @BUILD_POPT@ bin/.dummy
 	@echo "Linking $@"
 	@$(CC) $(FLAGS) @PIE_LDFLAGS@ -o $@ $(WINBINDD_OBJ) $(LDFLAGS) $(DYNEXP) $(LIBS) \
-		@POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS)
+		@POPTLIBS@ $(KRB5LIBS) $(LDAP_LIBS) $(PASSDB_LIBS) \
+		$(AFS_LIBS)
 
 # Please don't add .o files to libnss_winbind, libnss_wins, or the pam_winbind
 # libraries.  Add to the appropriate PICOBJ variable instead.
diff -urN samba-3.0.21a.orig/source/configure.in samba-3.0.21a/source/configure.in
--- samba-3.0.21a.orig/source/configure.in	Wed Jan 11 15:05:30 2006
+++ samba-3.0.21a/source/configure.in	Sat Jan 14 11:30:23 2006
@@ -239,6 +239,7 @@
 AC_SUBST(IDMAP_LIBS)
 AC_SUBST(KRB5_LIBS)
 AC_SUBST(LDAP_LIBS)
+AC_SUBST(AFS_LIBS)
 AC_SUBST(SHLIB_PROGS)
 AC_SUBST(SMBWRAPPER)
 AC_SUBST(SMBWRAP_OBJS)
@@ -2694,6 +2695,7 @@
 
 #################################################
 # decide whether we can support WITH_AFS and / or WITH_FAKE_KASERVER
+AFS_LIBS=""
 if test x"$samba_cv_WITH_AFS" != x"no" ||
    test x"$samba_cv_WITH_FAKE_KASERVER" != x"no"; then
 
@@ -2702,6 +2704,7 @@
     if test -d /usr/include/afs; then
           CFLAGS="$CFLAGS -I/usr/include/afs"
           CPPFLAGS="$CPPFLAGS -I/usr/include/afs"
+          AFS_LIBS="-L/usr/lib/afs -lafsauthent -lafsrpc -lpthread -lcrypto"
           AC_MSG_RESULT(yes)
     else
       AC_MSG_RESULT(no)
@@ -5208,6 +5211,7 @@
    AC_MSG_RESULT([    LDAP_LIBS = $LDAP_LIBS])
 fi
 AC_MSG_RESULT([    AUTH_LIBS = $AUTH_LIBS])
+AC_MSG_RESULT([    AFS_LIBS = $AFS_LIBS])
 
 #################################################
 # final configure stuff
diff -urN samba-3.0.21a.orig/source/modules/vfs_afsacl.c samba-3.0.21a/source/modules/vfs_afsacl.c
--- samba-3.0.21a.orig/source/modules/vfs_afsacl.c	Wed Jan 11 15:05:28 2006
+++ samba-3.0.21a/source/modules/vfs_afsacl.c	Sat Jan 14 11:19:34 2006
@@ -311,6 +311,7 @@
 
 static BOOL unparse_afs_acl(struct afs_acl *acl, char *acl_str)
 {
+	struct afs_ace *ace;
 	/* TODO: String length checks!!!! */
 
 	int positives = 0;
@@ -318,8 +319,7 @@
 	fstring line;
 
 	*acl_str = 0;
-
-	struct afs_ace *ace = acl->acelist;
+	ace = acl->acelist;
 
 	while (ace != NULL) {
 		if (ace->positive)

--=-=-=

-- 
Clinton Ft. Bragg Ft. Meade PLO Albanian cracking 767 congress NSA
quiche NORAD supercomputer security pits domestic disruption
[See http://www.aclu.org/echelonwatch/index.html for more about this]
[Or http://www.europarl.eu.int/tempcom/echelon/pdf/rapport_echelon_en.pdf]
If neither of these works, try http://www.aclu.org and search for echelon.

--=-=-=--