Samba 3.0.6 on Tru64 V5.1B build failure fix

Karl Vogel karl.vogel at seagha.com
Fri Sep 10 07:57:32 GMT 2004


The modules/vfs_full_audit.c file uses the symbol audit_lock() which is
already
defined in a system header on Tru64 :

---
Compiling modules/vfs_full_audit.c with -fPIC
cc: Warning: modules/vfs_full_audit.c, line 140: In this declaration,
"audit_loc
k" is declared with both internal and external linkage.  The previous
declaratio
n is at line number 1907 in file /usr/include/prot.h. (mixlinkage)
static BOOL audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd,
------------^
cc: Error: modules/vfs_full_audit.c, line 140: In this declaration, the type
of
"audit_lock" is not compatible with the type of a previous declaration of
"audit
_lock" at line number 1907 in file /usr/include/prot.h. (notcompat)
static BOOL audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd,
------------^
cc: Warning: modules/vfs_full_audit.c, line 1116: In this declaration,
"audit_lo
ck" is declared with both internal and external linkage.  The previous
declarati
on is at line number 1907 in file /usr/include/prot.h. (mixlinkage)
static BOOL audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd,
------------^
cc: Error: modules/vfs_full_audit.c, line 1116: In this declaration, the
type of
 "audit_lock" is not compatible with the type of a previous declaration of
"audi
t_lock" at line number 1907 in file /usr/include/prot.h. (notcompat)
static BOOL audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd,
------------^
*** Exit 1
---


Simple fix is to rename/prefix the audit_lock() name. Since the symbol is
static
this should be no problem. Something like this:

--- source/modules/vfs_full_audit.c.orig        2004-09-10 09:19:35 +0200
+++ source/modules/vfs_full_audit.c     2004-09-10 09:19:54 +0200
@@ -137,7 +137,7 @@ static int audit_utime(vfs_handle_struct
                       const char *path, struct utimbuf *times);
 static int audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
                           int fd, SMB_OFF_T len);
-static BOOL audit_lock(vfs_handle_struct *handle, files_struct *fsp, int
fd,
+static BOOL smb_audit_lock(vfs_handle_struct *handle, files_struct *fsp,
int fd,
                       int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
 static int audit_symlink(vfs_handle_struct *handle, connection_struct
*conn,
                         const char *oldpath, const char *newpath);
@@ -357,7 +357,7 @@ static vfs_op_tuple audit_op_tuples[] =
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_ftruncate),   SMB_VFS_OP_FTRUNCATE,
         SMB_VFS_LAYER_LOGGER},
-       {SMB_VFS_OP(audit_lock),        SMB_VFS_OP_LOCK,
+       {SMB_VFS_OP(smb_audit_lock),    SMB_VFS_OP_LOCK,
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(audit_symlink),     SMB_VFS_OP_SYMLINK,
         SMB_VFS_LAYER_LOGGER},
@@ -1113,7 +1113,7 @@ static int audit_ftruncate(vfs_handle_st
        return result;
 }

-static BOOL audit_lock(vfs_handle_struct *handle, files_struct *fsp, int
fd,
+static BOOL smb_audit_lock(vfs_handle_struct *handle, files_struct *fsp,
int fd,
                       int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
 {
        BOOL result;


Regards,
Karl


More information about the samba-technical mailing list