DEFS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
CFLAGS = -O0 -g -I$(SAMBA_INCL) $(EXTLIB_INCL) $(DEFS)
-LDFLAGS = -L/usr/local/samba/lib
+LDFLAGS = -L/usr/local/samba/lib \
+ -lldap -lkrb5 -lgssapi_krb5
#LIBSMBCLIENT = /usr/local/samba/lib/libsmbclient.so
LIBSMBCLIENT = ../../source/bin/libsmbclient.a -ldl -lresolv
TESTS= testsmbc \
- tree \
testacl \
testacl2 \
testbrowse \
testutime \
testread
+# tree \
+
all: $(TESTS) smbsh
testsmbc: testsmbc.o
testacl: testacl.o
@echo Linking testacl
- $(CC) `gtk-config --cflags` $(CFLAGS) $(LDFLAGS) -o $@ $< `gtk-config --libs` $(LIBSMBCLIENT) -lpopt
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
testacl2: testacl2.o
@echo Linking testacl2
- $(CC) `gtk-config --cflags` $(CFLAGS) $(LDFLAGS) -o $@ $< `gtk-config --libs` $(LIBSMBCLIENT) -lpopt
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBSMBCLIENT) -lpopt
testbrowse: testbrowse.o
@echo Linking testbrowse
smbc_telldir_ctx(SMBCCTX *context,
SMBCFILE *dir)
{
- off_t ret_val; /* Squash warnings about cast */
-
if (!context || !context->internal ||
!context->internal->_initialized) {
}
+ /* See if we're already at the end. */
+ if (dir->dir_next == NULL) {
+ /* We are. */
+ return -1;
+ }
+
/*
* We return the pointer here as the offset
*/
- ret_val = (off_t)(long)dir->dir_next;
- return ret_val;
-
+ return (off_t)(long)dir->dir_next->dirent;
}
/*
buf += n;
n_used += n;
bufsize -= n;
+ n = 0;
}
if (! exclude_nt_owner) {
buf += n;
n_used += n;
bufsize -= n;
+ n = 0;
}
if (! exclude_nt_group) {
buf += n;
n_used += n;
bufsize -= n;
+ n = 0;
}
if (! exclude_nt_acl) {
buf += n;
n_used += n;
bufsize -= n;
+ n = 0;
}
}
buf += n;
n_used += n;
bufsize -= n;
+ n = 0;
}
if (! exclude_dos_size) {
buf += n;
n_used += n;
bufsize -= n;
+ n = 0;
}
if (! exclude_dos_create_time &&
buf += n;
n_used += n;
bufsize -= n;
+ n = 0;
}
if (! exclude_dos_access_time) {
buf += n;
n_used += n;
bufsize -= n;
+ n = 0;
}
if (! exclude_dos_write_time) {
buf += n;
n_used += n;
bufsize -= n;
+ n = 0;
}
if (! exclude_dos_change_time) {
buf += n;
n_used += n;
bufsize -= n;
+ n = 0;
}
if (! exclude_dos_inode) {
buf += n;
n_used += n;
bufsize -= n;
+ n = 0;
}
/* Restore name pointer to its original value */
switch (mode) {
case SMBC_XATTR_MODE_REMOVE_ALL:
old->dacl->num_aces = 0;
- SAFE_FREE(old->dacl->aces);
- SAFE_FREE(old->dacl);
+ prs_mem_free(old->dacl->aces);
+ prs_mem_free(&old->dacl);
old->dacl = NULL;
dacl = old->dacl;
break;
}
old->dacl->num_aces--;
if (old->dacl->num_aces == 0) {
- SAFE_FREE(old->dacl->aces);
- SAFE_FREE(old->dacl);
+ prs_mem_free(&old->dacl->aces);
+ prs_mem_free(&old->dacl);
old->dacl = NULL;
}
found = True;