diff options
author | bubulle <bubulle@alioth.debian.org> | 2009-07-05 21:08:28 +0000 |
---|---|---|
committer | bubulle <bubulle@alioth.debian.org> | 2009-07-05 21:08:28 +0000 |
commit | e2df0615c76f228e5479482a880a01d64ef47a06 (patch) | |
tree | cf161609a937840fa6b42eac3d4c0db7ff534d34 /examples | |
parent | 130ad4cd047d74be152bdcf6ff6743b7978b99de (diff) | |
download | samba-e2df0615c76f228e5479482a880a01d64ef47a06.tar.gz |
Load samba-3.4.0 into branches/samba/upstream.upstream/3.4.0
git-svn-id: svn://svn.debian.org/svn/pkg-samba/branches/samba/upstream@2934 fc4039ab-9d04-0410-8cac-899223bdd6b0
Diffstat (limited to 'examples')
-rw-r--r-- | examples/VFS/Makefile.in | 12 | ||||
-rw-r--r-- | examples/VFS/configure.in | 8 | ||||
-rw-r--r-- | examples/VFS/skel_opaque.c | 18 | ||||
-rw-r--r-- | examples/VFS/skel_transparent.c | 20 | ||||
-rw-r--r-- | examples/libsmbclient/Makefile.internal.in | 38 | ||||
-rw-r--r-- | examples/libsmbclient/smbwrapper/Makefile | 4 | ||||
-rw-r--r-- | examples/libsmbclient/testbrowse.c | 2 | ||||
-rw-r--r-- | examples/libsmbclient/testfstatvfs.c | 21 | ||||
-rw-r--r-- | examples/libsmbclient/testsmbc.c | 12 | ||||
-rw-r--r-- | examples/libsmbclient/teststatvfs.c | 21 | ||||
-rwxr-xr-x | examples/misc/adssearch.pl | 2 | ||||
-rwxr-xr-x | examples/perfcounter/perfcountd.init | 4 |
12 files changed, 94 insertions, 68 deletions
diff --git a/examples/VFS/Makefile.in b/examples/VFS/Makefile.in index 4de0efd29e..8fe414a9e8 100644 --- a/examples/VFS/Makefile.in +++ b/examples/VFS/Makefile.in @@ -9,12 +9,14 @@ SHLIBEXT = @SHLIBEXT@ OBJEXT = @OBJEXT@ FLAGS = $(CFLAGS) $(CPPFLAGS) -fPIC \ -Iinclude -I$(SAMBA_SOURCE)/include \ - -I$(SAMBA_SOURCE)/popt \ - -I$(SAMBA_SOURCE)/lib/replace \ - -I$(SAMBA_SOURCE)/lib/talloc \ - -I$(SAMBA_SOURCE)/lib/tdb/include \ - -I$(SAMBA_SOURCE)/smbwrapper \ + -I$(SAMBA_SOURCE)/../popt \ + -I$(SAMBA_SOURCE)/../lib/replace \ + -I$(SAMBA_SOURCE)/../lib/talloc \ + -I$(SAMBA_SOURCE)/../lib/tevent \ + -I$(SAMBA_SOURCE)/../lib/tdb/include \ -I$(SAMBA_SOURCE)/librpc \ + -I$(SAMBA_SOURCE)/../librpc \ + -I$(SAMBA_SOURCE)/../ \ -I$(SAMBA_SOURCE) -I. diff --git a/examples/VFS/configure.in b/examples/VFS/configure.in index b8e10d482b..4e9d46544d 100644 --- a/examples/VFS/configure.in +++ b/examples/VFS/configure.in @@ -27,11 +27,11 @@ AC_ARG_WITH(fhs, AC_SUBST(libdir) -SAMBA_SOURCE="../../source" +SAMBA_SOURCE="../../source3" #################################################### # set the location location of the samba source tree AC_ARG_WITH(samba-source, -[ --with-samba-source=DIR Where is the samba source tree (../../source)], +[ --with-samba-source=DIR Where is the samba source tree (../../source3)], [ case "$withval" in yes|no) # @@ -337,11 +337,11 @@ AC_CACHE_CHECK([whether building shared libraries actually works], ac_cv_shlib_works=no # try building a trivial shared library if test "$PICSUFFIX" = "po"; then - $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.po ${srcdir-.}/../../source/tests/shlib.c && + $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.po ${srcdir-.}/../../tests/shlib.c && $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" shlib.po && ac_cv_shlib_works=yes else - $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c && + $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o shlib.$PICSUFFIX ${srcdir-.}/../../tests/shlib.c && mv shlib.$PICSUFFIX shlib.po && $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" shlib.po && ac_cv_shlib_works=yes diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 3df1fcd5bf..118a5b9da7 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -52,9 +52,9 @@ static void skel_disconnect(vfs_handle_struct *handle, connection_struct *conn) return; } -static SMB_BIG_UINT skel_disk_free(vfs_handle_struct *handle, const char *path, - bool small_query, SMB_BIG_UINT *bsize, - SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize) +static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path, + bool small_query, uint64_t *bsize, + uint64_t *dfree, uint64_t *dsize) { return vfswrap_disk_free(NULL, path, small_query, bsize, dfree, dsize); @@ -85,9 +85,11 @@ static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, const char *fnam return vfswrap_opendir(NULL, fname, mask, attr); } -static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp) +static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, + SMB_STRUCT_DIR *dirp, + SMB_STRUCT_STAT *sbuf) { - return vfswrap_readdir(NULL, dirp); + return vfswrap_readdir(NULL, dirp, sbuf); } static void skel_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset) @@ -231,9 +233,9 @@ static char *skel_getwd(vfs_handle_struct *handle, char *buf) return vfswrap_getwd(NULL, buf); } -static int skel_ntimes(vfs_handle_struct *handle, const char *path, const struct timespec ts[2]) +static int skel_ntimes(vfs_handle_struct *handle, const char *path, struct smb_file_time *ft) { - return vfswrap_ntimes(NULL, path, ts); + return vfswrap_ntimes(NULL, path, ft); } static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset) @@ -292,7 +294,7 @@ static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags } static struct file_id skel_file_id_create(vfs_handle_struct *handle, - SMB_DEV_T dev, SMB_INO_T inode) + const SMB_STRUCT_STAT *sbuf) { struct file_id id_zero; ZERO_STRUCT(id_zero); diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index e6dee97775..a95b5ae6cd 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -46,9 +46,9 @@ static void skel_disconnect(vfs_handle_struct *handle) SMB_VFS_NEXT_DISCONNECT(handle); } -static SMB_BIG_UINT skel_disk_free(vfs_handle_struct *handle, const char *path, - bool small_query, SMB_BIG_UINT *bsize, - SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize) +static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path, + bool small_query, uint64_t *bsize, + uint64_t *dfree, uint64_t *dsize) { return SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize, dfree, dsize); @@ -79,9 +79,11 @@ static SMB_STRUCT_DIR *skel_opendir(vfs_handle_struct *handle, const char *fnam return SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr); } -static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp) +static SMB_STRUCT_DIRENT *skel_readdir(vfs_handle_struct *handle, + SMB_STRUCT_DIR *dirp, + SMB_STRUCT_STAT *sbuf) { - return SMB_VFS_NEXT_READDIR(handle, dirp); + return SMB_VFS_NEXT_READDIR(handle, dirp, sbuf); } static void skel_seekdir(vfs_handle_struct *handle, SMB_STRUCT_DIR *dirp, long offset) @@ -224,9 +226,9 @@ static char *skel_getwd(vfs_handle_struct *handle, char *buf) return SMB_VFS_NEXT_GETWD(handle, buf); } -static int skel_ntimes(vfs_handle_struct *handle, const char *path, const struct timespec ts[2]) +static int skel_ntimes(vfs_handle_struct *handle, const char *path, struct smb_file_time *ft) { - return SMB_VFS_NEXT_NTIMES(handle, path, ts); + return SMB_VFS_NEXT_NTIMES(handle, path, ft); } static int skel_ftruncate(vfs_handle_struct *handle, files_struct *fsp, SMB_OFF_T offset) @@ -284,9 +286,9 @@ static int skel_chflags(vfs_handle_struct *handle, const char *path, uint flags } static struct file_id skel_file_id_create(vfs_handle_struct *handle, - SMB_DEV_T dev, SMB_INO_T inode) + const SMB_STRUCT_STAT *sbuf) { - return SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode); + return SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf); } static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp, diff --git a/examples/libsmbclient/Makefile.internal.in b/examples/libsmbclient/Makefile.internal.in index dd4518f212..d9f0fd32c8 100644 --- a/examples/libsmbclient/Makefile.internal.in +++ b/examples/libsmbclient/Makefile.internal.in @@ -6,7 +6,7 @@ CC = @CC@ -SAMBA_DIR = ../../source +SAMBA_DIR = ../../source3 SAMBA_INCLUDES = -I$(SAMBA_DIR)/include SAMBA_LIBPATH = -L$(SAMBA_DIR)/bin @@ -16,7 +16,7 @@ GTK_LIBS = `gtk-config --libs` #GTK_CFLAGS = `pkg-config gtk+-2.0 --cflags` #GTK_LIBS = `pkg-config gtk+-2.0 --libs` -FLAGS = @CPPFLAGS@ @CFLAGS@ $(GTK_CFLAGS) $(SAMBA_INCLUDES) +CCFLAGS = @CPPFLAGS@ @CFLAGS@ $(GTK_CFLAGS) $(SAMBA_INCLUDES) PICFLAG=@PICFLAG@ LDFLAGS= $(SAMBA_LIBPATH) @PIE_LDFLAGS@ @LDFLAGS@ @@ -27,7 +27,7 @@ CMDLINE_LIBS = @POPTLIBS@ LIBS = $(EXTERNAL_LIBS) $(LIBSMBCLIENT_LIBS) # Compile a source file. (.c --> .o) -COMPILE_CC = $(CC) -I. $(FLAGS) $(PICFLAG) -c $< -o $@ +COMPILE_CC = $(CC) -I. $(CCFLAGS) $(PICFLAG) -c $< -o $@ COMPILE = $(COMPILE_CC) MAKEDIR = || exec false; \ @@ -68,67 +68,67 @@ all: $(TESTS) smbsh testsmbc: testsmbc.o @echo Linking testsmbc - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) tree: tree.o @echo Linking tree - @$(CC) $(GTK_CFLAGS) $(FLAGS) $(LDFLAGS) -o $@ $< $(GTK_LIBS) $(LIBS) + @$(CC) $(GTK_CFLAGS) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(GTK_LIBS) $(LIBS) testacl: testacl.o @echo Linking testacl - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) testacl2: testacl2.o @echo Linking testacl2 - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) testacl3: testacl3.o @echo Linking testacl3 - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) testbrowse: testbrowse.o @echo Linking testbrowse - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) testbrowse2: testbrowse2.o @echo Linking testbrowse2 - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) teststat: teststat.o @echo Linking teststat - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) teststat2: teststat2.o @echo Linking teststat2 - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) teststat3: teststat3.o @echo Linking teststat3 - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) testtruncate: testtruncate.o @echo Linking testtruncate - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) testchmod: testchmod.o @echo Linking testchmod - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) testutime: testutime.o @echo Linking testutime - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) testread: testread.o @echo Linking testread - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) testwrite: testwrite.o @echo Linking testwrite - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) testctx: testctx.o @echo Linking testctx - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) + @$(CC) $(CCFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) smbsh: make -C smbwrapper diff --git a/examples/libsmbclient/smbwrapper/Makefile b/examples/libsmbclient/smbwrapper/Makefile index eb470056e1..952015e96e 100644 --- a/examples/libsmbclient/smbwrapper/Makefile +++ b/examples/libsmbclient/smbwrapper/Makefile @@ -3,9 +3,9 @@ DEFS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE CFLAGS = -I$(SAMBA_INCL) $(EXTLIB_INCL) -LDFLAGS = -L/usr/local/samba/lib -L../../../source/bin +LDFLAGS = -L/usr/local/samba/lib -L../../../source3/bin -SMBINCLUDE = -I../../../source/include +SMBINCLUDE = -I../../../source3/include CFLAGS= -fpic -g -O0 $(DEFS) $(SMBINCLUDE) BIN = . diff --git a/examples/libsmbclient/testbrowse.c b/examples/libsmbclient/testbrowse.c index a6e6395078..c3fb3946da 100644 --- a/examples/libsmbclient/testbrowse.c +++ b/examples/libsmbclient/testbrowse.c @@ -197,7 +197,7 @@ get_auth_data_with_context_fn(SMBCCTX * context, char * pPassword, int maxLenPassword) { - printf("Authenticating with context 0x%lx", context); + printf("Authenticating with context %p", context); if (context != NULL) { char *user_data = smbc_getOptionUserData(context); printf(" with user data %s", user_data); diff --git a/examples/libsmbclient/testfstatvfs.c b/examples/libsmbclient/testfstatvfs.c index b4dafefff6..73f42d446a 100644 --- a/examples/libsmbclient/testfstatvfs.c +++ b/examples/libsmbclient/testfstatvfs.c @@ -75,13 +75,20 @@ int main(int argc, char * argv[]) printf("\n"); printf("Block Size: %lu\n", statvfsbuf.f_bsize); printf("Fragment Size: %lu\n", statvfsbuf.f_frsize); - printf("Blocks: %llu\n", statvfsbuf.f_blocks); - printf("Free Blocks: %llu\n", statvfsbuf.f_bfree); - printf("Available Blocks: %llu\n", statvfsbuf.f_bavail); - printf("Files : %llu\n", statvfsbuf.f_files); - printf("Free Files: %llu\n", statvfsbuf.f_ffree); - printf("Available Files: %llu\n", statvfsbuf.f_favail); - printf("File System ID: %lu\n", statvfsbuf.f_fsid); + printf("Blocks: %llu\n", + (unsigned long long) statvfsbuf.f_blocks); + printf("Free Blocks: %llu\n", + (unsigned long long) statvfsbuf.f_bfree); + printf("Available Blocks: %llu\n", + (unsigned long long) statvfsbuf.f_bavail); + printf("Files : %llu\n", + (unsigned long long) statvfsbuf.f_files); + printf("Free Files: %llu\n", + (unsigned long long) statvfsbuf.f_ffree); + printf("Available Files: %llu\n", + (unsigned long long) statvfsbuf.f_favail); + printf("File System ID: %lu\n", + (unsigned long) statvfsbuf.f_fsid); printf("\n"); printf("Flags: 0x%lx\n", statvfsbuf.f_flag); diff --git a/examples/libsmbclient/testsmbc.c b/examples/libsmbclient/testsmbc.c index 1f06437293..de42428c2b 100644 --- a/examples/libsmbclient/testsmbc.c +++ b/examples/libsmbclient/testsmbc.c @@ -21,6 +21,7 @@ #include <stdio.h> #include <errno.h> +#include <time.h> #include <sys/time.h> #include <string.h> #include <unistd.h> @@ -33,8 +34,12 @@ int global_id = 0; void print_list_fn(struct print_job_info *pji) { - fprintf(stdout, "Print job: ID: %u, Prio: %u, Size: %u, User: %s, Name: %s\n", - pji->id, pji->priority, pji->size, pji->user, pji->name); + fprintf(stdout, "Print job: ID: %u, Prio: %u, Size: %lu, User: %s, Name: %s\n", + pji->id, + pji->priority, + (unsigned long) pji->size, + pji->user, + pji->name); global_id = pji->id; @@ -137,7 +142,8 @@ int main(int argc, char *argv[]) } - fprintf(stdout, "Wrote %d bytes to file: %s\n", sizeof(buff), buff); + fprintf(stdout, "Wrote %lu bytes to file: %s\n", + (unsigned long) sizeof(buff), buff); /* Now, seek the file back to offset 0 */ diff --git a/examples/libsmbclient/teststatvfs.c b/examples/libsmbclient/teststatvfs.c index 8812002d5c..b7e6b5159e 100644 --- a/examples/libsmbclient/teststatvfs.c +++ b/examples/libsmbclient/teststatvfs.c @@ -49,13 +49,20 @@ int main(int argc, char * argv[]) printf("\n"); printf("Block Size: %lu\n", statvfsbuf.f_bsize); printf("Fragment Size: %lu\n", statvfsbuf.f_frsize); - printf("Blocks: %llu\n", statvfsbuf.f_blocks); - printf("Free Blocks: %llu\n", statvfsbuf.f_bfree); - printf("Available Blocks: %llu\n", statvfsbuf.f_bavail); - printf("Files : %llu\n", statvfsbuf.f_files); - printf("Free Files: %llu\n", statvfsbuf.f_ffree); - printf("Available Files: %llu\n", statvfsbuf.f_favail); - printf("File System ID: %lu\n", statvfsbuf.f_fsid); + printf("Blocks: %llu\n", + (unsigned long long) statvfsbuf.f_blocks); + printf("Free Blocks: %llu\n", + (unsigned long long) statvfsbuf.f_bfree); + printf("Available Blocks: %llu\n", + (unsigned long long) statvfsbuf.f_bavail); + printf("Files : %llu\n", + (unsigned long long) statvfsbuf.f_files); + printf("Free Files: %llu\n", + (unsigned long long) statvfsbuf.f_ffree); + printf("Available Files: %llu\n", + (unsigned long long) statvfsbuf.f_favail); + printf("File System ID: %lu\n", + (unsigned long) statvfsbuf.f_fsid); printf("\n"); printf("Flags: 0x%lx\n", statvfsbuf.f_flag); diff --git a/examples/misc/adssearch.pl b/examples/misc/adssearch.pl index d17e680ec8..026853d152 100755 --- a/examples/misc/adssearch.pl +++ b/examples/misc/adssearch.pl @@ -735,7 +735,7 @@ sub get_machine_password { ($line,$password) = split(/"/, $line); last; } - if ($line =~ /$key/) { + if ($line =~ /\"$key\"/) { $found = 1; } } diff --git a/examples/perfcounter/perfcountd.init b/examples/perfcounter/perfcountd.init index 1a05a6941c..0beff96227 100755 --- a/examples/perfcounter/perfcountd.init +++ b/examples/perfcounter/perfcountd.init @@ -21,7 +21,7 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin -killproc() +killproc() { pid=`ps aux | grep $1 | egrep -v '(grep|perfcountd)' | awk '{print $2}'` if [ x"$pid" != "x" ]; then @@ -29,7 +29,7 @@ killproc() fi } -# Start/stop processes +# Start/stop processes case "$1" in |