[patch] Cascaded VFS v.4

TUDOR Coserea tudore at gecadsoftware.com
Tue Jul 9 05:00:03 GMT 2002

Hi Alexander,

Alexander Bokovoy <a.bokovoy at sam-solutions.net> writes:
> > And another question:
> >         I used VFS to build a antivirus scanner and on close method I
> >         need (const struct files_struct*)->fsp_name which position
> >         depends by this _LARGEFILE64_SOURCE. If one of smbd and my
> >         scanner is build with this flag and other is not, on close
> >         method smbd with my scanner will crash. Could be rearranged
> >         files in this struct such as fields dependent by compilation
> >         flags be the last?
> Could you please show how would this struct look correctly? There are
> files_struct entries (next,prev), various SMB_XXX (dev, inode, pos, size) 
> which all are variable-sized...
Like this:
typedef struct files_struct
        struct files_struct *next, *prev;
        int fnum;
        struct connection_struct *conn;
        int fd;
        int print_jobid;
        mode_t mode;
        uint16 vuid;
        write_bmpx_struct *wbmpx_ptr;
        write_cache *wcp;
        struct timeval open_time;
        int share_mode;
        uint32 desired_access;
        time_t pending_modtime;
        int oplock_type;
        int sent_oplock_break;
        unsigned long file_id;
        BOOL can_lock;
        BOOL can_read;
        BOOL can_write;
        BOOL print_file;
        BOOL modified;
        BOOL is_directory;
        BOOL directory_delete_on_close;
        BOOL delete_on_close;
        char *fsp_name;
        SMB_DEV_T dev;
        SMB_INO_T inode;
        SMB_OFF_T pos;
        SMB_OFF_T size;
} files_struct;
now all fsp->mode ... fsp->fsp_name fields will not longer depend by compilation 

> -- 
> / Alexander Bokovoy
> ---
> Communications satellite used by the military for star wars.

More information about the samba-technical mailing list