avoid using libtool for VFS modules
authorSimo Sorce <idra@samba.org>
Tue, 27 Aug 2002 09:14:21 +0000 (09:14 +0000)
committerSimo Sorce <idra@samba.org>
Tue, 27 Aug 2002 09:14:21 +0000 (09:14 +0000)
change a name in block.c it was hiding a function name
add a comment in configure
(This used to be commit 05038f44717ff07ed7d4a3afbdd8f072a3c058cc)

examples/VFS/Makefile.in
examples/VFS/README
examples/VFS/block/Makefile.in
examples/VFS/block/block.c
source3/configure
source3/configure.in

index 3126dfa3b835af94e10380b0da74fa1a5ee1132e..6ae4f49434d2715440b4bb54776aa1bb7e12381a 100644 (file)
@@ -1,42 +1,28 @@
-MAKEFILE       = Makefile.vfs
-
-include        $(MAKEFILE)
-
 CC             = @CC@
-LIBTOOL                = libtool
-CFLAGS         = @CFLAGS@ $(VFS_CFLAGS)
-CPPFLAGS       = @CPPFLAGS@ $(VFS_CPPFLAGS)
-LDFLAGS                = @LDFLAGS@ $(VFS_LDFLAGS)
+CFLAGS         = @CFLAGS@
+CPPFLAGS       = @CPPFLAGS@
+LDFLAGS                = @LDFLAGS@
 LDSHFLAGS      = -shared
 srcdir         = @builddir@
 FLAGS          =  $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper  -I. $(CPPFLAGS) -I$(srcdir)
 
+VFS_OBJS       = audit.so recycle.so
+
 # Default target
 
 default: $(VFS_OBJS)
 
-# if file doesn't exist try to create one; 
-# it is possible that some variables will be 
-# defined correctly
-Makefile.vfs:
-       @echo -ne "VFS_OBJS\t= " > $(MAKEFILE); \
-       for i in *.c; do \
-       echo -n $$i" " | sed -e 's/\(.*\)\.c\(.*\)/\1\.so\2/g' >> $(MAKEFILE); \
-       done; \
-       echo -ne "\nVFS_CFLAGS\t= \nVFS_CPPFLAGS\t= \nVFS_LDFLAGS\t= \n" >> $(MAKEFILE)
-       make
-
 # Pattern rules
 
-%.so: %.lo
-       $(LIBTOOL) $(CC) $(LDSHFLAGS) $(LDFLAGS) -o $@ $< 
+%.so: %.o
+       $(CC) $(LDSHFLAGS) $(LDFLAGS) -o $@ $<
 
-%.lo: %.c
-       $(LIBTOOL) $(CC) $(FLAGS) -c $<
+%.o: %.c
+       $(CC) $(FLAGS) -c $<
 
 # Misc targets
 
 clean:
        rm -rf .libs
        rm -f core *~ *% *.bak \
-       $(VFS_OBJS) $(VFS_OBJS:.so=.o) $(VFS_OBJS:.so=.lo) 
+       $(VFS_OBJ) $(VFS_OBJS)
index 7a2152fc4d1a8292fffff350e93910112dc47ba7..1b09929059112ee37c5483c73aee4b6cace1500b 100644 (file)
@@ -17,15 +17,26 @@ construction.  The following VFS modules are given:
                connect/disconnect, directory opens/create/remove,
                file open/close/rename/unlink/chmod.
 
+       recycle
+               A recycle-bin like modules. When used any unlink call
+               will be intercepted and files moved to the recycle
+               directory nstead of beeing deleted.
+
        block
                A simple module to block access to certain mount points or 
                directories. This module only hides the specified directories 
-               and all directories beneath them. It should NOT be used to secure
-               directories. If the name of a file in one of those directories is 
-               known, the file can still be opened.
-
-The libtool program, available from your favourite GNU software
-archive, is required to compile these programs.
+               and all directories beneath them. It should NOT be used to
+               secure directories. If the name of a file in one of those
+               directories is known, the file can still be opened.
+
+       netatalk
+               A netatalk module, that will ease co-existence of samba and
+               netatalk file sharing services.
+               Looka t the README for more informations.
+
+You may have problems to compile these modules, as shared libraries are
+compiled and linked in different ways on different systems.
+I currently tested them against GNU/linux and IRIX.
 
 To use the VFS modules, create a share similar to the one below.  The
 important parameter is the 'vfs object' parameter which must point to
index 3126dfa3b835af94e10380b0da74fa1a5ee1132e..3deb17c596773ffbab5845bdb693e805814e92f0 100644 (file)
@@ -1,42 +1,28 @@
-MAKEFILE       = Makefile.vfs
-
-include        $(MAKEFILE)
-
 CC             = @CC@
-LIBTOOL                = libtool
-CFLAGS         = @CFLAGS@ $(VFS_CFLAGS)
-CPPFLAGS       = @CPPFLAGS@ $(VFS_CPPFLAGS)
-LDFLAGS                = @LDFLAGS@ $(VFS_LDFLAGS)
+CFLAGS         = @CFLAGS@
+CPPFLAGS       = @CPPFLAGS@
+LDFLAGS                = @LDFLAGS@
 LDSHFLAGS      = -shared
 srcdir         = @builddir@
 FLAGS          =  $(CFLAGS) -Iinclude -I$(srcdir)/include -I$(srcdir)/ubiqx -I$(srcdir)/smbwrapper  -I. $(CPPFLAGS) -I$(srcdir)
 
+VFS_OBJS       = block.so
+
 # Default target
 
 default: $(VFS_OBJS)
 
-# if file doesn't exist try to create one; 
-# it is possible that some variables will be 
-# defined correctly
-Makefile.vfs:
-       @echo -ne "VFS_OBJS\t= " > $(MAKEFILE); \
-       for i in *.c; do \
-       echo -n $$i" " | sed -e 's/\(.*\)\.c\(.*\)/\1\.so\2/g' >> $(MAKEFILE); \
-       done; \
-       echo -ne "\nVFS_CFLAGS\t= \nVFS_CPPFLAGS\t= \nVFS_LDFLAGS\t= \n" >> $(MAKEFILE)
-       make
-
 # Pattern rules
 
-%.so: %.lo
-       $(LIBTOOL) $(CC) $(LDSHFLAGS) $(LDFLAGS) -o $@ $< 
+%.so: %.o
+       $(CC) $(LDSHFLAGS) $(LDFLAGS) -o $@ $<
 
-%.lo: %.c
-       $(LIBTOOL) $(CC) $(FLAGS) -c $<
+%.o: %.c
+       $(CC) $(FLAGS) -c $<
 
 # Misc targets
 
 clean:
        rm -rf .libs
        rm -f core *~ *% *.bak \
-       $(VFS_OBJS) $(VFS_OBJS:.so=.o) $(VFS_OBJS:.so=.lo) 
+       $(VFS_OBJ) $(VFS_OBJS)
index 9478b75f0f1a4f32a05c2db37085ae3ee05916ad..6566bf3d8cff4db4ac6e268bfc85f8e01b32e781 100644 (file)
@@ -87,7 +87,7 @@ static BOOL get_section(char *sect);
 static BOOL get_parameter_value(char *param, char *value);
 static BOOL load_param(void);
 static BOOL search(struct stat *stat_buf);
-static BOOL dir_search(char *link, char *dir);
+static BOOL dir_search(char *linkstr, char *dir);
 static BOOL enter_pblock_dir(char *dir);
 
 
@@ -346,12 +346,11 @@ static DIR *block_opendir(struct connection_struct *conn, char *fname)
 
        char *dir_name = NULL; 
        struct stat stat_buf;
+       size_t len;
 
-       dir_name = alloca((strlen(conn->origpath) + strlen(fname) + 2) * sizeof(char));
-
-       pstrcpy(dir_name,conn->origpath);
-       pstrcat(dir_name, "/"); 
-       strncat(dir_name, fname, strcspn(fname,"/"));
+       len = strlen(conn->origpath) + 1 + strcspn(fname, "/");
+       asprintf(&dir_name, "%s/%s", conn->origpath, fname);
+       dir_name[len] = '\0';
 
        if((lstat(dir_name,&stat_buf)) == 0)
        {
@@ -397,13 +396,13 @@ static BOOL search(struct stat *stat_buf)
  * Find dir in list to block id the starting point is link from a share
  */
 
-static BOOL dir_search(char *link, char *dir)
+static BOOL dir_search(char *linkstr, char *dir)
 {
        char buf[PATH_MAX +1], *ext_path;
        int len = 0;
        struct block_dir *tmp_pblock = pblock_dir;
        
-       if((len = readlink(link,buf,sizeof(buf))) == -1)
+       if((len = readlink(linkstr, buf, sizeof(buf))) == -1)
        {
                return TRUE;
 
@@ -413,9 +412,9 @@ static BOOL dir_search(char *link, char *dir)
        }
        
        
-        if((ext_path = strchr(dir,'/')) != NULL)
+        if((ext_path = strchr(dir, '/')) != NULL)
        {
-               pstrcat(buf,&ext_path[1]);
+               pstrcat(buf, &ext_path[1]);
                len = strlen(buf);              
        }
        
@@ -427,7 +426,7 @@ static BOOL dir_search(char *link, char *dir)
                        continue;
                }
                
-               if((strstr(buf,tmp_pblock->dir_name)) != NULL)
+               if((strstr(buf, tmp_pblock->dir_name)) != NULL)
                {
                        return TRUE;
                }
index f95f30e393f78337311b1a43e63e0d02b0ac9471..431edcbe355c5e75babeca28304aa70f319757da 100755 (executable)
@@ -14018,6 +14018,9 @@ fi
 builddir=`pwd`
 
 
+# I added make files that are outside /source directory.
+# I know this is not a good solution, will work out a better
+# solution soon.                       --simo
 trap '' 1 2 15
 cat > confcache <<\EOF
 # This file is a shell script that caches the results of configure
@@ -14119,7 +14122,7 @@ done
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "include/stamp-h Makefile script/findsmb ../examples/VFS/Makefile ../examples/VFS/block/Makefile ../examples/pdb/mysql/Makefile ../examples/pdb/xml/Makefile include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "include/stamp-h Makefile script/findsmb ../examples/VFS/Makefile ../examples/VFS/block/Makefile ../examples/VFS/netatalk/Makefile ../examples/pdb/mysql/Makefile ../examples/pdb/xml/Makefile include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -14254,7 +14257,7 @@ EOF
 
 cat >> $CONFIG_STATUS <<EOF
 
-CONFIG_FILES=\${CONFIG_FILES-"include/stamp-h Makefile script/findsmb ../examples/VFS/Makefile ../examples/VFS/block/Makefile ../examples/pdb/mysql/Makefile ../examples/pdb/xml/Makefile"}
+CONFIG_FILES=\${CONFIG_FILES-"include/stamp-h Makefile script/findsmb ../examples/VFS/Makefile ../examples/VFS/block/Makefile ../examples/VFS/netatalk/Makefile ../examples/pdb/mysql/Makefile ../examples/pdb/xml/Makefile"}
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
index 90b07ef20abd3065f43a780d4dc2dd3ecb12fbe7..de8da34091322f6f31d87c6cab76e1092de9dd5b 100644 (file)
@@ -2808,7 +2808,10 @@ AC_TRY_RUN([#include "${srcdir-.}/tests/summary.c"],
 builddir=`pwd`
 AC_SUBST(builddir)
 
-AC_OUTPUT(include/stamp-h Makefile script/findsmb ../examples/VFS/Makefile ../examples/VFS/block/Makefile ../examples/pdb/mysql/Makefile ../examples/pdb/xml/Makefile)
+# I added make files that are outside /source directory.
+# I know this is not a good solution, will work out a better
+# solution soon.                       --simo
+AC_OUTPUT(include/stamp-h Makefile script/findsmb ../examples/VFS/Makefile ../examples/VFS/block/Makefile ../examples/VFS/netatalk/Makefile ../examples/pdb/mysql/Makefile ../examples/pdb/xml/Makefile)
 
 #################################################
 # Print very concise instructions on building/use