pam_csync 0.42.0 beta2
10.28.08 - 04:48pm
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.


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#
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.
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#
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
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#
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
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!!
Did apt-get install libpam-dev
Worked.
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#
Did install -m 0644 src/libcsync.so.0 /usr/lib/
Worked.
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!
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/
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
You have to download the source apply the patches and compile it yourself.
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#
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
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