Advertisement
sconstantine

ubuntu 12.04 make error and workaround (vsftpd)

Apr 9th, 2012
1,269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.11 KB | None | 0 0
  1. /vsftpd-2.3.4# make
  2. gcc -o vsftpd main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o tunables.o ftpdataio.o secbuf.o ls.o postprivparent.o logging.o str.o netstr.o sysstr.o strlist.o banner.o filestr.o parseconf.o secutil.o ascii.o oneprocess.o twoprocess.o privops.o standalone.o hash.o tcpwrap.o ipaddrparse.o access.o features.o readwrite.o opts.o ssl.o sslslave.o ptracesandbox.o ftppolicy.o sysutil.o sysdeputil.o -Wl,-s `./vsf_findlibs.sh`
  3. sysdeputil.o: In function `vsf_sysdep_has_capabilities':
  4. sysdeputil.c:(.text+0x1d9): undefined reference to `cap_get_proc'
  5. sysdeputil.c:(.text+0x1e4): undefined reference to `cap_free'
  6. sysdeputil.o: In function `vsf_sysdep_adopt_capabilities':
  7. sysdeputil.c:(.text+0x219): undefined reference to `cap_init'
  8. sysdeputil.c:(.text+0x22f): undefined reference to `cap_set_proc'
  9. sysdeputil.c:(.text+0x245): undefined reference to `cap_free'
  10. sysdeputil.c:(.text+0x26e): undefined reference to `cap_set_flag'
  11. sysdeputil.c:(.text+0x28b): undefined reference to `cap_set_flag'
  12. sysdeputil.c:(.text+0x2b6): undefined reference to `cap_set_flag'
  13. sysdeputil.c:(.text+0x2d3): undefined reference to `cap_set_flag'
  14. sysdeputil.o: In function `vsf_sysdep_check_auth':
  15. sysdeputil.c:(.text+0xc23): undefined reference to `pam_start'
  16. sysdeputil.c:(.text+0xc58): undefined reference to `pam_set_item'
  17. sysdeputil.c:(.text+0xc76): undefined reference to `pam_set_item'
  18. sysdeputil.c:(.text+0xc9a): undefined reference to `pam_set_item'
  19. sysdeputil.c:(.text+0xcb0): undefined reference to `pam_authenticate'
  20. sysdeputil.c:(.text+0xcce): undefined reference to `pam_get_item'
  21. sysdeputil.c:(.text+0xced): undefined reference to `pam_acct_mgmt'
  22. sysdeputil.c:(.text+0xd02): undefined reference to `pam_setcred'
  23. sysdeputil.c:(.text+0xd29): undefined reference to `pam_open_session'
  24. sysdeputil.c:(.text+0xd5a): undefined reference to `pam_end'
  25. sysdeputil.c:(.text+0xd82): undefined reference to `pam_end'
  26. sysdeputil.c:(.text+0xd95): undefined reference to `pam_end'
  27. sysdeputil.c:(.text+0xdc0): undefined reference to `pam_setcred'
  28. sysdeputil.c:(.text+0xdce): undefined reference to `pam_end'
  29. sysdeputil.o: In function `vsf_auth_shutdown':
  30. sysdeputil.c:(.text+0xe03): undefined reference to `pam_close_session'
  31. sysdeputil.c:(.text+0xe14): undefined reference to `pam_setcred'
  32. sysdeputil.c:(.text+0xe22): undefined reference to `pam_end'
  33. collect2: ld returned 1 exit status
  34. make: *** [vsftpd] Error 1
  35.  
  36. ============================================================
  37. contents of: vsf_findlibs.sh
  38. ============================================================
  39.  
  40. #!/bin/sh
  41. # Cheesy hacky location of additional link libraries.
  42.  
  43. locate_library() { [ ! "$1*" = "`echo $1*`" ]; }
  44. find_func() { egrep $1 $2 >/dev/null; }
  45.  
  46. if find_func hosts_access tcpwrap.o; then
  47. echo "-lwrap";
  48. locate_library /lib/libnsl.so && echo "-lnsl";
  49. locate_library /lib64/libnsl.so && echo "-lnsl";
  50. fi
  51.  
  52. # Look for PAM (done weirdly due to distribution bugs (e.g. Debian) or the
  53. # crypt library.
  54. if find_func pam_start sysdeputil.o; then
  55. locate_library /lib/libpam.so.0 && echo "/lib/libpam.so.0";
  56. locate_library /usr/lib/libpam.so && echo "-lpam";
  57. locate_library /usr/lib64/libpam.so && echo "-lpam";
  58. # HP-UX ends shared libraries with .sl
  59. locate_library /usr/lib/libpam.sl && echo "-lpam";
  60. # AIX ends shared libraries with .a
  61. locate_library /usr/lib/libpam.a && echo "-lpam";
  62. else
  63. locate_library /lib/libcrypt.so && echo "-lcrypt";
  64. locate_library /usr/lib/libcrypt.so && echo "-lcrypt";
  65. locate_library /usr/lib64/libcrypt.so && echo "-lcrypt";
  66. fi
  67.  
  68. # Look for the dynamic linker library. Needed by older RedHat when
  69. # you link in PAM
  70. locate_library /lib/libdl.so && echo "-ldl";
  71.  
  72. # Look for libsocket. Solaris needs this.
  73. locate_library /lib/libsocket.so && echo "-lsocket";
  74.  
  75. # Look for libnsl. Solaris needs this.
  76. locate_library /lib/libnsl.so && echo "-lnsl";
  77.  
  78. # Look for libresolv. Solaris needs this.
  79. locate_library /lib/libresolv.so && echo "-lresolv";
  80.  
  81. # Look for libutil. Older FreeBSD need this for setproctitle().
  82. locate_library /usr/lib/libutil.so && echo "-lutil";
  83.  
  84. # For older HP-UX...
  85. locate_library /usr/lib/libsec.sl && echo "-lsec";
  86.  
  87. # Look for libcap (capabilities)
  88. if locate_library /lib/libcap.so.1; then
  89. echo "/lib/libcap.so.1";
  90. elif locate_library /lib/libcap.so.2; then
  91. echo "/lib/libcap.so.2";
  92. else
  93. locate_library /usr/lib/libcap.so && echo "-lcap";
  94. locate_library /lib/libcap.so && echo "-lcap";
  95. locate_library /lib64/libcap.so && echo "-lcap";
  96. fi
  97.  
  98. # Solaris needs this for nanosleep()..
  99. locate_library /lib/libposix4.so && echo "-lposix4";
  100. locate_library /usr/lib/libposix4.so && echo "-lposix4";
  101.  
  102. # Tru64 (nanosleep)
  103. locate_library /usr/shlib/librt.so && echo "-lrt";
  104.  
  105. # Solaris sendfile
  106. locate_library /usr/lib/libsendfile.so && echo "-lsendfile";
  107.  
  108. # OpenSSL
  109. if find_func SSL_library_init ssl.o; then
  110. echo "-lssl -lcrypto";
  111. fi
  112.  
  113. exit 0;
  114.  
  115.  
  116. ============================================================
  117. workaround/problem remedied by:
  118. ============================================================
  119.  
  120. apt-get build-dep vsftpd
  121. make LIBS='-lwrap -lpam -lssl -lcrypto -lcap'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement