gboudreau / Greyhole

Greyhole uses Samba to create a storage pool of all your available hard drives, and allows you to create redundant copies of the files you store.
http://www.greyhole.net
GNU General Public License v3.0
263 stars 34 forks source link

Debian 12, samba 4.17 and VFS not building #311

Closed Astaoth closed 1 year ago

Astaoth commented 1 year ago

Hi,

I've just setup a Debian 12 ans wanted to deploy Greyhole on it. With Debian 12, the available samba version is the 4.17.8. Greyhole include prebuild vfs modules only for samba up to the v 4.16. So I tried to build it myself with the command /usr/share/greyhole/build_vfs.sh current as indicated in the documentation, however it fails with this error :

../../source3/modules/vfs_greyhole.c:188:22: warning: initialization of ‘int (*)(struct vfs_handle_struct *, const struct files_struct *, const struct smb_filename *, struct files_struct *, const struct vfs_open_how *)’ from incompatible pointer type ‘int (*)(vfs_handle_struct *, const struct files_struct *, const struct smb_filename *, struct files_struct *, int,  mode_t)’ {aka ‘int (*)(vfs_handle_struct *, const struct files_struct *, const struct smb_filename *, struct files_struct *, int,  unsigned int)’} [-Wincompatible-pointer-types]
  188 |         .openat_fn = greyhole_openat,
      |                      ^~~~~~~~~~~~~~~
../../source3/modules/vfs_greyhole.c:188:22: note: (near initialization for ‘vfs_greyhole_fns.openat_fn’)
../../source3/modules/vfs_greyhole.c: In function ‘greyhole_openat’:
../../source3/modules/vfs_greyhole.c:255:81: error: macro "SMB_VFS_NEXT_OPENAT" passed 6 arguments, but takes just 5
  255 |         result = SMB_VFS_NEXT_OPENAT(handle, dirfsp, smb_fname, fsp, flags, mode);
      |                                                                                 ^
In file included from ../../source3/include/vfs.h:1406,
                 from ../../source3/include/smb.h:149,
                 from ../../source3/include/includes.h:267,
                 from ../../source3/modules/vfs_greyhole.c:23:
../../source3/include/vfs_macros.h:148: note: macro "SMB_VFS_NEXT_OPENAT" defined here
  148 | #define SMB_VFS_NEXT_OPENAT(handle, dirfsp, smb_fname, fsp, how) \
      | 
../../source3/modules/vfs_greyhole.c:255:18: error: ‘SMB_VFS_NEXT_OPENAT’ undeclared (first use in this function)
  255 |         result = SMB_VFS_NEXT_OPENAT(handle, dirfsp, smb_fname, fsp, flags, mode);
      |                  ^~~~~~~~~~~~~~~~~~~
../../source3/modules/vfs_greyhole.c:255:18: note: each undeclared identifier is reported only once for each function it appears in

Waf: Leaving directory `/usr/share/greyhole/vfs-build/samba-4.17.8/bin/default'
Build failed
 -> task in 'vfs_greyhole.objlist' failed with exit status 1 (run with -v to display more information)
make: *** [Makefile:7 : all] Erreur 1

Any idea of how to solve this ?

gboudreau commented 1 year ago

0.15.19 version should fix this.
(I already had code to support Samba 4.17, but never included it in the builds.)

Astaoth commented 1 year ago

The fix went fast ! I had to make a Greyhole purge and reinstall for removing the test I made. It now works as expected, thank you !