diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/VFS/skel_opaque.c | 8 | ||||
-rw-r--r-- | examples/VFS/skel_transparent.c | 7 | ||||
-rw-r--r-- | examples/libsmbclient/Makefile | 4 | ||||
-rw-r--r-- | examples/libsmbclient/Makefile.internal.in | 138 | ||||
-rw-r--r-- | examples/libsmbclient/smbwrapper/Makefile | 4 | ||||
-rw-r--r-- | examples/libsmbclient/smbwrapper/wrapper.c | 2 | ||||
-rw-r--r-- | examples/libsmbclient/testacl.c | 48 |
7 files changed, 34 insertions, 177 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index 89d8ce5239..ee9ae1d7fd 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -321,6 +321,13 @@ static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, return NT_STATUS_NOT_IMPLEMENTED; } +static NTSTATUS skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const + char *name, uint32 security_info_sent, SEC_DESC *psd) +{ + errno = ENOSYS; + return NT_STATUS_NOT_IMPLEMENTED; +} + static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode) { errno = ENOSYS; @@ -655,6 +662,7 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(skel_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, SMB_VFS_LAYER_OPAQUE}, {SMB_VFS_OP(skel_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, SMB_VFS_LAYER_OPAQUE}, + {SMB_VFS_OP(skel_set_nt_acl), SMB_VFS_OP_SET_NT_ACL, SMB_VFS_LAYER_OPAQUE}, /* POSIX ACL operations */ diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index ea8530d855..7102d4d4db 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -307,6 +307,12 @@ static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd); } +static NTSTATUS skel_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp, + const char *name, uint32 security_info_sent, SEC_DESC *psd) +{ + return SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent, psd); +} + static int skel_chmod_acl(vfs_handle_struct *handle, const char *name, mode_t mode) { /* If the underlying VFS doesn't have ACL support... */ @@ -618,6 +624,7 @@ static vfs_op_tuple skel_op_tuples[] = { {SMB_VFS_OP(skel_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, {SMB_VFS_OP(skel_fset_nt_acl), SMB_VFS_OP_FSET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, + {SMB_VFS_OP(skel_set_nt_acl), SMB_VFS_OP_SET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT}, /* POSIX ACL operations */ diff --git a/examples/libsmbclient/Makefile b/examples/libsmbclient/Makefile index 047addc8f7..e6afdeb519 100644 --- a/examples/libsmbclient/Makefile +++ b/examples/libsmbclient/Makefile @@ -5,7 +5,7 @@ SAMBA_INCL = -I/usr/local/samba/include EXTLIB_INCL = -I/usr/include/gtk-1.2 \ -I/usr/include/glib-1.2 \ -I/usr/lib/glib/include -EXTLIB_INCL = `gtk-config --cflags` +#EXTLIB_INCL = `gtk-config --cflags` DEFS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE CFLAGS = -O0 -g $(SAMBA_INCL) $(EXTLIB_INCL) $(DEFS) @@ -13,7 +13,7 @@ CFLAGS = -O0 -g $(SAMBA_INCL) $(EXTLIB_INCL) $(DEFS) LDFLAGS = -L/usr/local/samba/lib \ -lldap -lkrb5 -lgssapi_krb5 #LIBSMBCLIENT = /usr/local/samba/lib/libsmbclient.so -LIBSMBCLIENT = -lwbclient -lsmbclient -ltalloc -ltdb -ldl -lresolv +LIBSMBCLIENT = -lwbclient -lsmbclient -ldl -lresolv TESTS= testsmbc \ testacl \ diff --git a/examples/libsmbclient/Makefile.internal.in b/examples/libsmbclient/Makefile.internal.in deleted file mode 100644 index dd4518f212..0000000000 --- a/examples/libsmbclient/Makefile.internal.in +++ /dev/null @@ -1,138 +0,0 @@ -# Makefile.internal.in for building the libsmbclient examples -# from within a samba build. -# -# Use Makfile for building the examples with a libsmbclient -# installed to /usr/local/samba - -CC = @CC@ - -SAMBA_DIR = ../../source -SAMBA_INCLUDES = -I$(SAMBA_DIR)/include -SAMBA_LIBPATH = -L$(SAMBA_DIR)/bin - -GTK_CFLAGS = `gtk-config --cflags` -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) - -PICFLAG=@PICFLAG@ -LDFLAGS= $(SAMBA_LIBPATH) @PIE_LDFLAGS@ @LDFLAGS@ - -EXTERNAL_LIBS = @LIBS@ @LDAP_LIBS@ @KRB5_LIBS@ @NSCD_LIBS@ -LIBSMBCLIENT_LIBS = -lwbclient -lsmbclient -ltalloc -ltdb -ldl -lresolv -CMDLINE_LIBS = @POPTLIBS@ -LIBS = $(EXTERNAL_LIBS) $(LIBSMBCLIENT_LIBS) - -# Compile a source file. (.c --> .o) -COMPILE_CC = $(CC) -I. $(FLAGS) $(PICFLAG) -c $< -o $@ -COMPILE = $(COMPILE_CC) - -MAKEDIR = || exec false; \ - if test -d "$$dir"; then :; else \ - echo mkdir "$$dir"; \ - mkdir -p "$$dir" >/dev/null 2>&1 || \ - test -d "$$dir" || \ - mkdir "$$dir" || \ - exec false; fi || exec false - -TESTS= testsmbc \ - testacl \ - testacl2 \ - testacl3 \ - testbrowse \ - testbrowse2 \ - teststat \ - teststat2 \ - teststat3 \ - testtruncate \ - testchmod \ - testutime \ - testread \ - testwrite - -# tree \ - -all: $(TESTS) smbsh - -.c.o: - @if (: >> $@ || : > $@) >/dev/null 2>&1; then rm -f $@; else \ - dir=`echo $@ | sed 's,/[^/]*$$,,;s,^$$,.,'` $(MAKEDIR); fi - @echo Compiling $*.c - @$(COMPILE) && exit 0;\ - echo "The following command failed:" 1>&2;\ - echo "$(COMPILE_CC)" 1>&2;\ - $(COMPILE_CC) >/dev/null 2>&1 - -testsmbc: testsmbc.o - @echo Linking testsmbc - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) - -tree: tree.o - @echo Linking tree - @$(CC) $(GTK_CFLAGS) $(FLAGS) $(LDFLAGS) -o $@ $< $(GTK_LIBS) $(LIBS) - -testacl: testacl.o - @echo Linking testacl - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -testacl2: testacl2.o - @echo Linking testacl2 - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -testacl3: testacl3.o - @echo Linking testacl3 - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -testbrowse: testbrowse.o - @echo Linking testbrowse - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -testbrowse2: testbrowse2.o - @echo Linking testbrowse2 - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -teststat: teststat.o - @echo Linking teststat - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -teststat2: teststat2.o - @echo Linking teststat2 - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -teststat3: teststat3.o - @echo Linking teststat3 - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -testtruncate: testtruncate.o - @echo Linking testtruncate - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -testchmod: testchmod.o - @echo Linking testchmod - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -testutime: testutime.o - @echo Linking testutime - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -testread: testread.o - @echo Linking testread - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -testwrite: testwrite.o - @echo Linking testwrite - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -testctx: testctx.o - @echo Linking testctx - @$(CC) $(FLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(CMDLINE_LIBS) - -smbsh: - make -C smbwrapper - -clean: - @rm -f *.o *~ $(TESTS) - @make -C smbwrapper clean diff --git a/examples/libsmbclient/smbwrapper/Makefile b/examples/libsmbclient/smbwrapper/Makefile index eb470056e1..726435319f 100644 --- a/examples/libsmbclient/smbwrapper/Makefile +++ b/examples/libsmbclient/smbwrapper/Makefile @@ -1,9 +1,9 @@ -LIBS = -lwbclient -lsmbclient -ltalloc -ltdb -ldl +LIBS = -lwbclient -lsmbclient -ldl 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 SMBINCLUDE = -I../../../source/include CFLAGS= -fpic -g -O0 $(DEFS) $(SMBINCLUDE) diff --git a/examples/libsmbclient/smbwrapper/wrapper.c b/examples/libsmbclient/smbwrapper/wrapper.c index 3811b04356..958e00636e 100644 --- a/examples/libsmbclient/smbwrapper/wrapper.c +++ b/examples/libsmbclient/smbwrapper/wrapper.c @@ -1109,7 +1109,7 @@ int utimes(const char *name, const struct timeval *tvp) return (* smbw_libc.utimes)((char *) name, (struct timeval *) tvp); } -ssize_t readlink(const char *path, char *buf, size_t bufsize) +int readlink(const char *path, char *buf, size_t bufsize) { check_init("readlink"); diff --git a/examples/libsmbclient/testacl.c b/examples/libsmbclient/testacl.c index a57dd4a499..00e1c2c9da 100644 --- a/examples/libsmbclient/testacl.c +++ b/examples/libsmbclient/testacl.c @@ -24,7 +24,6 @@ int main(int argc, const char *argv[]) int flags; int debug = 0; int numeric = 0; - int stat_and_retry = 0; int full_time_names = 0; enum acl_mode mode = SMB_ACL_LIST; static char *the_acl = NULL; @@ -34,7 +33,6 @@ int main(int argc, const char *argv[]) char path[1024]; char value[1024]; poptContext pc; - struct stat st; struct poptOption long_options[] = { POPT_AUTOHELP @@ -80,10 +78,6 @@ int main(int argc, const char *argv[]) 'g', "Get a specific acl attribute", "ACL" }, { - "stat_and_retry", 'R', POPT_ARG_NONE, &stat_and_retry, - 1, "After 'get' do 'stat' and another 'get'" - }, - { NULL } }; @@ -181,40 +175,26 @@ int main(int argc, const char *argv[]) break; case SMB_ACL_GET: - do + if (the_acl == NULL) { - if (the_acl == NULL) + if (numeric) { - if (numeric) - { - the_acl = "system.*"; - } - else - { - the_acl = "system.*+"; - } + the_acl = "system.*"; } - ret = smbc_getxattr(path, the_acl, value, sizeof(value)); - if (ret < 0) + else { - printf("Could not get attributes for [%s] %d: %s\n", - path, errno, strerror(errno)); - return 1; + the_acl = "system.*+"; } + } + ret = smbc_getxattr(path, the_acl, value, sizeof(value)); + if (ret < 0) + { + printf("Could not get attributes for [%s] %d: %s\n", + path, errno, strerror(errno)); + return 1; + } - printf("Attributes for [%s] are:\n%s\n", path, value); - - if (stat_and_retry) - { - if (smbc_stat(path, &st) < 0) - { - perror("smbc_stat"); - return 1; - } - } - - --stat_and_retry; - } while (stat_and_retry >= 0); + printf("Attributes for [%s] are:\n%s\n", path, value); break; case SMB_ACL_ADD: |