pam_csync 0.42.0 beta2

This is the second beta release of csync 0.42.0. pam_csync is a PAM (Pluggable
Authentication Modules) module to provide roaming home directories for a
user session. This module is aimed at environments with central file servers a
user wishes to store his home directory. The Authentication Module verifies the
identity of a user and triggers a synchronization with the server on the first
login and the last logout.

There is a bug in several PAM applications calling the PAM functions on logout
in the wrong order. Take a look at:

gdm calls pam functions in the wrong order
http://bugzilla.gnome.org/show_bug.cgi?id=557794

OpenSSH calls pam functions in the wrong order on logout
https://bugzilla.mindrot.org/show_bug.cgi?id=1534

If you have ‘su’ (switch user) with pam support, check the patch
if it calls the functions in the right order.

You can find packages here.

ChangeLog

  • Improved debugging output
  • Fixed some PAM problems introduce by buggy gdm, su, openssh
  • Fixed kerberos support
  • Code cleanups

NOTE: If you want to use csync with sftp. Compile the latest libssh version from svn and apply this patch to the csync source.

flattr this!

The Conversation {17 comments}

  1. Tobbera {Wednesday October 29, 2008 @ 12:31 pm}

    I can not install csync. A have apt-get all packages that are needed but still gets the following.

    root@ubuntu:~/csync-0.41.95/build# cmake -DCMAKE_BUILD_TYPE=Debug ..
    – Found LOG4C: /usr/local/lib/liblog4c.so
    – Found Check: /usr/lib/libcheck.a
    – Found Iniparser: /usr/lib/libiniparser.a
    – Found Dlfcn: /usr/lib/libdl.so
    – Found RT: /usr/lib/librt.so
    CMake Error: Could not find Libsmbclient
    CMake Error: This project requires some variables to be set,
    and cmake can not find them.
    Please set the following variables:
    INIPARSER_INCLUDE_DIR
    SQLITE3_INCLUDE_DIR

    – Configuring done
    root@ubuntu:~/csync-0.41.95/build#

  2. GlaDiaC {Wednesday October 29, 2008 @ 12:47 pm}

    According to http://packages.ubuntu.com/ you need:

    libsqlite3-dev
    libsmbclient-dev
    liblog4c-dev

    There is no libiniparser package so I think you have to compile it yourself.

  3. Tobbera {Wednesday October 29, 2008 @ 2:24 pm}

    Thank you for your support. I did
    apt-get install libsqlite3-dev
    apt-get install libsmbclient-dev

    root@ubuntu:~/iniparser3.0b# make
    compiling src/iniparser.c …
    compiling src/dictionary.c …
    a – src/iniparser.o
    a – src/dictionary.o

    I’ve come a bit further:

    root@ubuntu:~/csync-0.41.95/build# cmake -DCMAKE_BUILD_TYPE=Debug ..
    – Found LOG4C: /usr/local/lib/liblog4c.so
    – Found Check: /usr/lib/libcheck.a
    – Found Sqlite3: /usr/lib/libsqlite3.so
    – Found Iniparser: /usr/lib/libiniparser.a
    – Found Dlfcn: /usr/lib/libdl.so
    – Found RT: /usr/lib/librt.so
    – Found Libsmbclient: /usr/lib/libsmbclient.so
    – Looking for doxygen…
    – Looking for doxygen… – NOT found
    – Looking for dot tool…
    – Looking for dot tool… – NOT found
    CMake Error: This project requires some variables to be set,
    and cmake can not find them.
    Please set the following variables:
    INIPARSER_INCLUDE_DIR

    – Configuring done
    root@ubuntu:~/csync-0.41.95/build#

  4. GlaDiaC {Wednesday October 29, 2008 @ 2:30 pm}

    Have you installed libiniparser?

    install -m 0755 libiniparser.so.0 /usr/lib
    install -m 0644 src/dictionary.h /usr/include
    install -m 0644 src/iniparser.h /usr/include
    ln -s libiniparser.so.0 /usr/lib/libiniparser.so

  5. Tobbera {Wednesday October 29, 2008 @ 2:40 pm}

    Now the cmake worked! Thank you!
    The make does not complete though;

    [ 92%] Building C object modules/CMakeFiles/csync_smb.dir/csync_smb.o
    /root/csync-0.41.95/modules/csync_smb.c: In function âget_auth_data_fnâ:
    /root/csync-0.41.95/modules/csync_smb.c:128: warning: passing argument 2 of âauth_cbâ makes pointer from integer without a cast
    /root/csync-0.41.95/modules/csync_smb.c:128: warning: passing argument 3 of âauth_cbâ makes integer from pointer without a cast
    /root/csync-0.41.95/modules/csync_smb.c:128: error: too few arguments to function âauth_cbâ
    make[2]: *** [modules/CMakeFiles/csync_smb.dir/csync_smb.o] Error 1
    make[1]: *** [modules/CMakeFiles/csync_smb.dir/all] Error 2
    make: *** [all] Error 2
    root@ubuntu:~/csync-0.41.95/build#

  6. GlaDiaC {Wednesday October 29, 2008 @ 2:51 pm}

    Yes, there is a bug with Samba 3.0.x. I’ve already fixed it. Look here:

    https://dev.csync.org/changeset/a825dd3e14c45064ce343f018f1f519dd5aedfc8/modules/csync_smb.c

  7. Tobbera {Wednesday October 29, 2008 @ 3:17 pm}

    That worked! The make install also.

    Now I’m trying to do the pam_csync:

    root@ubuntu:~/pam_csync-0.41.94/build# cmake -DCMAKE_BUILD_TYPE=Debug ..
    – Found Iniparser: /usr/lib/libiniparser.a
    CMake Error: Could not find PAM
    – Configuring done
    root@ubuntu:~/pam_csync-0.41.94/build#

    Appreciate your help!!

  8. Tobbera {Wednesday October 29, 2008 @ 3:29 pm}

    Did apt-get install libpam-dev
    Worked.

  9. Tobbera {Wednesday October 29, 2008 @ 4:13 pm}

    Trying:
    root@ubuntu:~/csync-0.41.95/build# csync
    csync: error while loading shared libraries: libcsync.so.0: cannot open shared object file: No such file or directory
    root@ubuntu:~/csync-0.41.95/build#

  10. Tobbera {Wednesday October 29, 2008 @ 4:28 pm}

    Did install -m 0644 src/libcsync.so.0 /usr/lib/
    Worked.

  11. Tobbera {Wednesday October 29, 2008 @ 4:36 pm}

    Seems like the sftp module were never compiled:

    root@ubuntu:~/csync-0.41.95/build# csync /tmp/sqlMvRp3a sftp://user@ratat.homelinux.org/tmp/
    [stderr] 20081029 14:31:18.499 WARN csync.statedb- sqlite3_compile error: no such table: metadata – on query SELECT COUNT(phash) FROM metadata LIMIT 1 OFFSET 0;
    [stderr] 20081029 14:31:18.500 NOTICE csync.statedb- statedb doesn’t exist
    [stderr] 20081029 14:31:18.501 ERROR csync.vio.main- loading sftp plugin failed – /root/csync-0.41.95/build/modules/csync_sftp.so: cannot open shared object file: No such file or directory
    csync_init: No such file or directory
    root@ubuntu:~/csync-0.41.95/build# ls /root/csync-0.41.95/build/modules/csync_
    csync_bad.so csync_dummy.so csync_smb.so
    root@ubuntu:~/csync-0.41.95/build# ls /root/csync-0.41.95/modules/
    CMakeLists.txt csync_sftp2.c csync_smb.c
    csync_dummy.c csync_sftp.c csync_smb.c.1

    How do I do this?
    Thanks!

  12. GlaDiaC {Wednesday October 29, 2008 @ 4:44 pm}

    Well this is only possible with a patched version of libssh.

    See http://www.csync.org/2008/09/17/csync-and-pam_csync-0420-beta1/

  13. Tobbera {Wednesday October 29, 2008 @ 5:11 pm}

    I see…

    I’ve downloaded the libssh-dev source and the patches. Can you tell me how I compile the libssh with the patches?

    Regards

  14. GlaDiaC {Wednesday October 29, 2008 @ 5:31 pm}

    You have to download the source apply the patches and compile it yourself.

  15. Tobbera {Wednesday October 29, 2008 @ 7:38 pm}

    I’ve patched the source:
    root@ubuntu:~/libssh-0.2# patch -p1 < ../0002-Map-permission-field-to-type-field.patch
    root@ubuntu:~/libssh-0.2# patch -p1 < ../0001-Map-permission-field-to-type-field.patch
    and compiled it fine.

    But i still get:
    root@ubuntu:~/libssh-0.2# csync /tmp/sqlMvRp3a user@host.homelinux.org/tmp/
    [stderr] 20081029 17:34:26.019 WARN csync.statedb- sqlite version mismatch
    [stderr] 20081029 17:34:26.023 WARN csync.statedb- sqlite3_compile error: no such table: metadata – on query SELECT COUNT(phash) FROM metadata LIMIT 1 OFFSET 0;
    [stderr] 20081029 17:34:26.023 NOTICE csync.statedb- statedb doesn’t exist
    [stderr] 20081029 17:34:26.024 FATAL csync.time- Access dienied to remote uri: root@pulp3.homelinux.org:/tmp – No such file or directory
    [stderr] 20081029 17:34:26.025 FATAL csync.api- Synchronisation is not possible!
    csync_init: No such file or directory
    root@ubuntu:~/libssh-0.2#

  16. hpadrao {Wednesday March 25, 2009 @ 9:03 pm}

    Hi All,

    I`ve the same problem.
    I can`t use the csync.

    That`s my problem:

    stderr] 20090325 18:48:40.284 WARN csync.statedb- sqlite version mismatch
    [stderr] 20090325 18:48:40.284 WARN csync.statedb- sqlite3_compile error: no such table: metadata – on query SELECT COUNT(phash) FROM metadata LIMIT 1 OFFSET 0;
    [stderr] 20090325 18:48:40.284 NOTICE csync.statedb- statedb doesn’t exist
    [stderr] 20090325 18:48:40.285 FATAL csync.time- Access dienied to remote uri:

    I don`t know what my problem is (csync or sqlite3).

    Any guy can help me?

    thanks a lot…

    Hélio

  17. GlaDiaC {Thursday March 26, 2009 @ 12:03 am}

    Hey,

    @Toberra: The url ist wrong! It should be:

    csync /tmp/sqlMvRp3a sftp://user@host.homelinux.org/tmp/

    See the userguide or manpage!

    @hpadrao: The problem is not the statedb. The problem seems to be the access to the server.

    If you want to use sftp I suggest to use the latest libssh svn version and csync with the following patch:

    http://www.cynapses.org/tmp/patches/csync/csync_sftp.patch

Speak Your Peace

You must be logged in to post a comment.