1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

avoid using libtool for VFS modules

change a name in block.c it was hiding a function name
add a comment in configure
This commit is contained in:
Simo Sorce 0001-01-01 00:00:00 +00:00
parent b275547c9e
commit 05038f4471
6 changed files with 55 additions and 67 deletions

View 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)

View 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.
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.
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

View 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)

View 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;
}

7
source/configure vendored
View File

@ -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

View 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