summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2004-11-15 21:25:40 +0000
committerGerald Carter <jerry@samba.org>2004-11-15 21:25:40 +0000
commitf2570b3bdd0285ef8e7eeee935c6001c592cd774 (patch)
tree2c06dbe1f906e3a79390913c9335f61c143014c1
parent9ca1eb85c66c99ba56a6eec6294abf24a8117e44 (diff)
downloadsamba-f2570b3bdd0285ef8e7eeee935c6001c592cd774.tar.gz
samba-f2570b3bdd0285ef8e7eeee935c6001c592cd774.tar.xz
samba-f2570b3bdd0285ef8e7eeee935c6001c592cd774.zip
r3773: more low-risk or critical changes from 3.0
(also started updating release notes): svn merge -r 3559:3561 $SVNURL/branches/SAMBA_3_0 svn merge -r 3559:3561 $SVNURL/branches/SAMBA_3_0 svn merge -r 3685:3688 $SVNURL/branches/SAMBA_3_0 svn merge -r 3688:3693 $SVNURL/branches/SAMBA_3_0 svn merge -r 3693:3697 $SVNURL/branches/SAMBA_3_0 svn merge -r 3708:3709 $SVNURL/branches/SAMBA_3_0 svn merge -r 3709:3710 $SVNURL/branches/SAMBA_3_0 svn merge -r 3710:3711 $SVNURL/branches/SAMBA_3_0 svn merge -r 3758:3761 $SVNURL/branches/SAMBA_3_0 svn merge -r 3761:3764 $SVNURL/branches/SAMBA_3_0 svn merge -r 3771:3772 $SVNURL/branches/SAMBA_3_0
-rw-r--r--WHATSNEW.txt159
-rw-r--r--source/include/includes.h2
-rw-r--r--source/include/md5.h5
-rw-r--r--source/lib/sysacls.c20
-rw-r--r--source/libads/krb5_setpw.c12
-rw-r--r--source/libads/ldap.c11
-rw-r--r--source/printing/nt_printing.c2
-rw-r--r--source/smbd/posix_acls.c20
-rw-r--r--source/tdb/tdb.h2
-rw-r--r--source/utils/net.c10
-rw-r--r--source/utils/status.c81
-rw-r--r--testsuite/libsmbclient/src/Makefile36
12 files changed, 214 insertions, 146 deletions
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index f36aa77bee7..55aa893923e 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,6 +1,6 @@
=============================
- Release Notes for Samba 3.0.8
- Nov 7, 2004
+ Release Notes for Samba 3.0.9
+ Nov 15, 2004
=============================
This is the latest stable release of Samba. This is the version
@@ -9,6 +9,36 @@ current bug-fixes. There have been several important issues
fixes since the 3.0.7 release. See the "Changes" section for
details on exact updates.
+Common bugs fixed in 3.0.9 include:
+
+ o
+
+
+
+######################################################################
+Changes
+#######
+
+Changes since 3.0.8
+-------------------
+
+
+commits
+-------
+
+o Jeremy Allison <jra@samba.org>
+
+o Gerald (Jerry) Carter <jerry@samba.org>
+
+
+Changes for older versions follow below:
+
+ --------------------------------------------------
+ =============================
+ Release Notes for Samba 3.0.8
+ Nov 7, 2004
+ =============================
+
Common bugs fixed in 3.0.8 include:
o Compile fixes for HP-UX
@@ -23,8 +53,9 @@ Common bugs fixed in 3.0.8 include:
o Fixes for kerberos interoperability with Windows 200x
domains when using DES keys.
o Fix for CAN-2004-0930 -- smbd remote DoS vulnerability.
+ o Fix for CAN-2004-0882 -- possible buffer overrun in smbd.
-
+
New features included in the 3.0.8 release are:
o New migration functionality added the the net tool
@@ -73,87 +104,16 @@ map functionality:
Changes
#######
-Changes since 3.0.8pre2
------------------------
- Parameter Name Action
- -------------- ------
- sendfile disabled by default
-
-
-commits
--------
-
-o Jeremy Allison <jra@samba.org>
- * BUG 1651: Adapted patch from Nalin Dahyabhai for ensuring
- that all of the appropriate service principal names are set
- upon joining an AD domain.
- * Fix the correct use of resume name in the trans2 code.
- * BUG 1717: Adapted patch from Nalin Dahyabhai to detect the
- correct salt used when generated the DES key after joining an
- AD domain.
- * Enhanced krb5 detection routines in the autoconf scripts.
-
-
-o Gerald Carter <jerry@samba.org>
- * Packaging fixes for Solaris, Redhat, & Fedora.
-
-
-o Nalin Dahyabhai <nalin@redhat.com>
- * SMB signing fix for 56-bit DES session keys.
-
-
-o Guenther Deschner <gd@samba.org>
- * BUG 1661: Fix build with recent heimdal releases.
- * Prevent idmap_rid from making unnecessary calls to domain
- controllers for trusted domains.
-
-
-o SATOH Fumiyasu <fumiya@samba.gr.jp>
- * BUG 1498: Ensure that acl entries are stored in the correct
- order.
-
-
-o Brett Funderburg <brett@deepfile.com>
- * BUG 1884: Fixes for the Python bindings to use the value
- of the desired_access filed passed into the lsa_open_policy()
- routines.
-
-
-o Volker Lendecke <vl@samba.org>
- * Memory leak fixes.
- * Fix checks for the local pid of an smbd process after
- reopening tdbs.
-
-o Herb Lewis <herb@samba.org>
- * Added tdbtool to be built by default.
-
-
-o Luke Mewburn <lukem@NetBSD.org>
- * BUG 1782: Prevent testparm from displaying parameter synonyms.
-
-
-o Narayana Pattipati <narayana.pattipati@wipro.com>
- * Solaris autoconf detection fixes.
-
-
-o Matt Selsky <selsky@columbia.edu>
- * BUG 350: use autoconf 2.57 feature for checking header file
- preprocessing (fixes configure warnings on Solaris).
-
-
-o Michael Sweet <mike@easysw.com>
- * BUG 1892: Updated smbspool for use with newer CUPS libraries.
-
-
Changes since 3.0.7
-------------------
smb.conf changes
----------------
-
Parameter Name Action
-------------- ------
force printername New
+ sendfile disabled by default
+
commits
-------
@@ -192,7 +152,16 @@ o Jeremy Allison <jra@samba.org>
* Ensure we pass most of the new lock tests except for the cancel
lock which is yet to be added (merged from Samba 4 branch).
* BUG 1947: Fix incorrect use of getpwnam() etc. interface.
- * BUG 1956: Ensure errno is saved and restored consistently on a normal_close.
+ * BUG 1956: Ensure errno is saved and restored consistently on a
+ normal_close.
+ * BUG 1651: Adapted patch from Nalin Dahyabhai for ensuring
+ that all of the appropriate service principal names are set
+ upon joining an AD domain.
+ * Fix the correct use of resume name in the trans2 code.
+ * BUG 1717: Adapted patch from Nalin Dahyabhai to detect the
+ correct salt used when generated the DES key after joining an
+ AD domain.
+ * Enhanced krb5 detection routines in the autoconf scripts.
o Andrew Bartlett <abartlet@samba.org>
@@ -242,6 +211,7 @@ o Gerald Carter <jerry@samba.org>
apply after authentication has succeeded.
* Cosmetic fix for getent output -- lowercase the username only
and not the complete domain\username string.
+ * Packaging fixes for Solaris, Redhat, & Fedora.
o Sean Chandler <sean.chandler@verizon.net>
@@ -252,6 +222,10 @@ o Darren Chew <darrenc@vicscouts.asn.au>
* Solaris packaging fixes.
+o Nalin Dahyabhai <nalin@redhat.com>
+ * SMB signing fix for 56-bit DES session keys.
+
+
o Guenther Deschner <gd@samba.org>
* add IA64 to the architecture table of printer-drivers.
* Add file/share/printer migration functionality to
@@ -291,6 +265,9 @@ o Guenther Deschner <gd@samba.org>
over msrpc setprinter calls inside the net-tool.
* Add the idmap_rid module (written in conjunction with
Sumit Bose <sbose@suse.de>).
+ * BUG 1661: Fix build with recent heimdal releases.
+ * Prevent idmap_rid from making unnecessary calls to domain
+ controllers for trusted domains.
o Arthur van Dongen <avdongen@xs4all.nl>
@@ -319,6 +296,8 @@ o Steve French <sfrench@us.ibm.com>
o Satoh Fumiyasu <fumiya@samba.gr.jp>
* BUG 1732: Limit share names returned by RAP based on windows
character width, not unix character width.
+ * BUG 1498: Ensure that acl entries are stored in the correct
+ order.
o Brett Funderburg <brett@deepfile.com>
@@ -328,6 +307,9 @@ o Brett Funderburg <brett@deepfile.com>
representation.
* Return an error if a Netapp filer returns NT_STATUS_ACCESS_DENIED
when trying to return the security descriptor for a file.
+ * BUG 1884: Fixes for the Python bindings to use the value
+ of the desired_access filed passed into the lsa_open_policy()
+ routines.
o Michael Gravey <michel.gravey@optogone.com>
@@ -387,6 +369,13 @@ o Volker Lendecke <vl@samba.org>
in order to support scanning a file server's share and list
all users who have permission to connect there.
* Allow for multiple DC's to be named as #1c names in lmhosts.
+ * Memory leak fixes.
+ * Fix checks for the local pid of an smbd process after
+ reopening tdbs.
+
+
+o Herb Lewis <herb@samba.org>
+ * Added tdbtool to be built by default.
o Love <lha@stacken.kth.se>
@@ -413,6 +402,10 @@ o Sean McGrath
for libsmbclient.
+o Luke Mewburn <lukem@NetBSD.org>
+ * BUG 1782: Prevent testparm from displaying parameter synonyms.
+
+
o Stefan Metzmacher <metze@samba.org>
* Fix crash in smbcquotas and smbcacls caused by setup_logging().
* Fix client quota support.
@@ -430,6 +423,10 @@ o Henrik Nordstrom <hno@squid-cache.org>
when the groups array must be enlarged.
+o Narayana Pattipati <narayana.pattipati@wipro.com>
+ * Solaris autoconf detection fixes.
+
+
o Tim Potter <tpot@samba.org>
* BUG 1360: (correct fix) Use -Wl when passing flags to
the linker.
@@ -447,6 +444,11 @@ o Tim Potter <tpot@samba.org>
DEBUG_PASSWORD.
+o Matt Selsky <selsky@columbia.edu>
+ * BUG 350: use autoconf 2.57 feature for checking header file
+ preprocessing (fixes configure warnings on Solaris).
+
+
o Richard Renard <rrenard@idealx.com>
* Fix usermgr.exe and trust relationships.
@@ -491,9 +493,6 @@ o Igor Zhbanov <bsg@uniyar.ac.ru>
* BUG 1797: Prevent winbind and nmbd from ignoring the "-l"
option.
-
-Changes for older versions follow below:
-
--------------------------------------------------
=============================
Release Notes for Samba 3.0.7
diff --git a/source/include/includes.h b/source/include/includes.h
index 6a1681fe1f1..ef0f761ff7d 100644
--- a/source/include/includes.h
+++ b/source/include/includes.h
@@ -45,7 +45,7 @@
#undef HAVE_TERMIOS_H
#endif
-#if (__GNUC__ >= 3)
+#if (__GNUC__ >= 3 ) && (__GNUC_MINOR__ >= 1 )
/** Use gcc attribute to check printf fns. a1 is the 1-based index of
* the parameter containing the format, and a2 the index of the first
* argument. Note that some gcc 2.x versions don't handle this
diff --git a/source/include/md5.h b/source/include/md5.h
index 6665171e7c5..e4cd08ed5e8 100644
--- a/source/include/md5.h
+++ b/source/include/md5.h
@@ -16,9 +16,4 @@ void MD5Update(struct MD5Context *context, unsigned char const *buf,
unsigned len);
void MD5Final(unsigned char digest[16], struct MD5Context *context);
-/*
- * This is needed to make RSAREF happy on some MS-DOS compilers.
- */
-typedef struct MD5Context MD5_CTX;
-
#endif /* !MD5_H */
diff --git a/source/lib/sysacls.c b/source/lib/sysacls.c
index 00d06e4a5ae..9b5bef00e8a 100644
--- a/source/lib/sysacls.c
+++ b/source/lib/sysacls.c
@@ -3196,3 +3196,23 @@ int sys_acl_free_qualifier(void *qual, SMB_ACL_TAG_T tagtype)
}
#endif /* No ACLs. */
+
+/************************************************************************
+ Deliberately outside the ACL defines. Return 1 if this is a "no acls"
+ errno, 0 if not.
+************************************************************************/
+
+int no_acl_syscall_error(int err)
+{
+#if defined(ENOSYS)
+ if (err == ENOSYS) {
+ return 1;
+ }
+#endif
+#if defined(ENOTSUP)
+ if (err == ENOTSUP) {
+ return 1;
+ }
+#endif
+ return 0;
+}
diff --git a/source/libads/krb5_setpw.c b/source/libads/krb5_setpw.c
index a45bf236107..95825748514 100644
--- a/source/libads/krb5_setpw.c
+++ b/source/libads/krb5_setpw.c
@@ -25,10 +25,8 @@
#define DEFAULT_KPASSWD_PORT 464
#define KRB5_KPASSWD_VERS_CHANGEPW 1
-#ifndef KRB5_KPASSWD_VERS_SETPW
-#define KRB5_KPASSWD_VERS_SETPW 2
-#endif
-#define KRB5_KPASSWD_VERS_SETPW_MS 0xff80
+#define KRB5_KPASSWD_VERS_SETPW 0xff80
+#define KRB5_KPASSWD_VERS_SETPW_ALT 2
#define KRB5_KPASSWD_ACCESSDENIED 5
#define KRB5_KPASSWD_BAD_VERSION 6
#define KRB5_KPASSWD_INITIAL_FLAG_NEEDED 7
@@ -140,7 +138,7 @@ static krb5_error_code build_kpasswd_request(uint16 pversion,
if (pversion == KRB5_KPASSWD_VERS_CHANGEPW)
setpw = data_blob(passwd, strlen(passwd));
else if (pversion == KRB5_KPASSWD_VERS_SETPW ||
- pversion == KRB5_KPASSWD_VERS_SETPW_MS)
+ pversion == KRB5_KPASSWD_VERS_SETPW_ALT)
setpw = encode_krb5_setpw(princ, passwd);
else
return EINVAL;
@@ -252,7 +250,7 @@ static krb5_error_code parse_setpw_reply(krb5_context context,
/* FIXME: According to standard there is only one type of reply */
if (vnum != KRB5_KPASSWD_VERS_SETPW &&
- vnum != KRB5_KPASSWD_VERS_SETPW_MS &&
+ vnum != KRB5_KPASSWD_VERS_SETPW_ALT &&
vnum != KRB5_KPASSWD_VERS_CHANGEPW) {
DEBUG(1,("Bad vnum (%d) from kpasswd server\n", vnum));
return KRB5KDC_ERR_BAD_PVNO;
@@ -557,7 +555,7 @@ ADS_STATUS ads_krb5_set_password(const char *kdc_host, const char *princ,
/* we might have to call krb5_free_creds(...) from now on ... */
aret = do_krb5_kpasswd_request(context, kdc_host,
- KRB5_KPASSWD_VERS_SETPW_MS,
+ KRB5_KPASSWD_VERS_SETPW,
credsp, princ, newpw);
krb5_free_creds(context, credsp);
diff --git a/source/libads/ldap.c b/source/libads/ldap.c
index b2ae5aeb942..252cd718c89 100644
--- a/source/libads/ldap.c
+++ b/source/libads/ldap.c
@@ -456,8 +456,6 @@ ADS_STATUS ads_do_paged_search(ADS_STRUCT *ads, const char *bind_path,
controls[1] = &PagedResults;
controls[2] = NULL;
- *res = NULL;
-
/* we need to disable referrals as the openldap libs don't
handle them and paged results at the same time. Using them
together results in the result record containing the server
@@ -533,6 +531,7 @@ ADS_STATUS ads_do_search_all(ADS_STRUCT *ads, const char *bind_path,
int count = 0;
ADS_STATUS status;
+ *res = NULL;
status = ads_do_paged_search(ads, bind_path, scope, expr, attrs, res,
&count, &cookie);
@@ -623,6 +622,7 @@ ADS_STATUS ads_do_search(ADS_STRUCT *ads, const char *bind_path, int scope,
char *utf8_expr, *utf8_path, **search_attrs = NULL;
TALLOC_CTX *ctx;
+ *res = NULL;
if (!(ctx = talloc_init("ads_do_search"))) {
DEBUG(1,("ads_do_search: talloc_init() failed!"));
return ADS_ERROR(LDAP_NO_MEMORY);
@@ -653,7 +653,6 @@ ADS_STATUS ads_do_search(ADS_STRUCT *ads, const char *bind_path, int scope,
timeout.tv_sec = ADS_SEARCH_TIMEOUT;
timeout.tv_usec = 0;
- *res = NULL;
/* see the note in ads_do_paged_search - we *must* disable referrals */
ldap_set_option(ads->ld, LDAP_OPT_REFERRALS, LDAP_OPT_OFF);
@@ -764,6 +763,8 @@ ADS_STATUS ads_find_machine_acct(ADS_STRUCT *ads, void **res, const char *machin
char *expr;
const char *attrs[] = {"*", "nTSecurityDescriptor", NULL};
+ *res = NULL;
+
/* the easiest way to find a machine account anywhere in the tree
is to look for hostname$ */
if (asprintf(&expr, "(samAccountName=%s$)", machine) == -1) {
@@ -2494,6 +2495,10 @@ ADS_STATUS ads_workgroup_name(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, const char *
asprintf(&expr, "(&(objectclass=computer)(dnshostname=%s.%s))",
ads->config.ldap_server_name, ads->config.realm);
+ if (expr == NULL) {
+ ADS_ERROR_NT(NT_STATUS_NO_MEMORY);
+ }
+
rc = ads_search(ads, &res, expr, attrs);
free(expr);
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c
index a69433df37f..3ff2d517336 100644
--- a/source/printing/nt_printing.c
+++ b/source/printing/nt_printing.c
@@ -2184,7 +2184,7 @@ NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
ZERO_STRUCTP(nt_devmode);
- safe_strcpy(adevice, default_devicename, sizeof(adevice)-1);
+ slprintf(adevice, sizeof(adevice), "%s", default_devicename);
fstrcpy(nt_devmode->devicename, adevice);
fstrcpy(nt_devmode->formname, "Letter");
diff --git a/source/smbd/posix_acls.c b/source/smbd/posix_acls.c
index be7f828b677..0ba4437303d 100644
--- a/source/smbd/posix_acls.c
+++ b/source/smbd/posix_acls.c
@@ -245,7 +245,7 @@ static void store_inheritance_attributes(files_struct *fsp, canon_ace *file_ace_
SAFE_FREE(pai_buf);
DEBUG(10,("store_inheritance_attribute:%s for file %s\n", protected ? " (protected)" : "", fsp->fsp_name));
- if (ret == -1 && errno != ENOSYS)
+ if (ret == -1 && !no_acl_syscall_error(errno))
DEBUG(1,("store_inheritance_attribute: Error %s\n", strerror(errno) ));
}
@@ -2243,7 +2243,7 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
if (the_acl == NULL) {
- if (errno != ENOSYS) {
+ if (!no_acl_syscall_error(errno)) {
/*
* Only print this error message if we have some kind of ACL
* support that's not working. Otherwise we would always get this.
@@ -2408,13 +2408,9 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
* Some systems allow all the above calls and only fail with no ACL support
* when attempting to apply the acl. HPUX with HFS is an example of this. JRA.
*/
- if (errno == ENOSYS)
+ if (no_acl_syscall_error(errno)) {
*pacl_set_support = False;
-
-#ifdef ENOTSUP
- if (errno == ENOTSUP)
- *pacl_set_support = False;
-#endif
+ }
DEBUG(2,("set_canon_ace_list: sys_acl_set_file type %s failed for file %s (%s).\n",
the_acl_type == SMB_ACL_TYPE_DEFAULT ? "directory default" : "file",
@@ -2427,13 +2423,9 @@ static BOOL set_canon_ace_list(files_struct *fsp, canon_ace *the_ace, BOOL defau
* Some systems allow all the above calls and only fail with no ACL support
* when attempting to apply the acl. HPUX with HFS is an example of this. JRA.
*/
- if (errno == ENOSYS)
+ if (no_acl_syscall_error(errno)) {
*pacl_set_support = False;
-
-#ifdef ENOTSUP
- if (errno == ENOTSUP)
- *pacl_set_support = False;
-#endif
+ }
DEBUG(2,("set_canon_ace_list: sys_acl_set_file failed for file %s (%s).\n",
fsp->fsp_name, strerror(errno) ));
diff --git a/source/tdb/tdb.h b/source/tdb/tdb.h
index 153b6e99232..901d470a50a 100644
--- a/source/tdb/tdb.h
+++ b/source/tdb/tdb.h
@@ -36,7 +36,7 @@ extern "C" {
* the parameter containing the format, and a2 the index of the first
* argument. Note that some gcc 2.x versions don't handle this
* properly **/
-#if (__GNUC__ >= 3)
+#if (__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1 )
#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
#else
#define PRINTF_ATTRIBUTE(a1, a2)
diff --git a/source/utils/net.c b/source/utils/net.c
index 2fe15c2b8ef..784612fc71b 100644
--- a/source/utils/net.c
+++ b/source/utils/net.c
@@ -479,11 +479,19 @@ static int net_getlocalsid(int argc, const char **argv)
"backend knowlege (such as the sid stored in LDAP)\n"));
}
+ /* first check to see if we can even access secrets, so we don't
+ panic when we can't. */
+
+ if (!secrets_init()) {
+ d_printf("Unable to open secrets.tdb. Can't fetch domain SID for name: %s\n", name);
+ return 1;
+ }
+
/* Generate one, if it doesn't exist */
get_global_sam_sid();
if (!secrets_fetch_domain_sid(name, &sid)) {
- DEBUG(0, ("Can't fetch domain SID for name: %s\n", name));
+ DEBUG(0, ("Can't fetch domain SID for name: %s\n", name));
return 1;
}
sid_to_string(sid_str, &sid);
diff --git a/source/utils/status.c b/source/utils/status.c
index 4585b101b28..122c6193f91 100644
--- a/source/utils/status.c
+++ b/source/utils/status.c
@@ -47,6 +47,8 @@ static int locks_only = 0; /* Added by RJS */
static BOOL processes_only=False;
static int show_brl;
+const char *username = NULL;
+
/* added by OH */
static void Ucrit_addUsername(const char *username)
{
@@ -578,6 +580,7 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
int c;
static int profile_only = 0;
TDB_CONTEXT *tdb;
+ BOOL show_processes, show_locks, show_shares;
poptContext pc;
struct poptOption long_options[] = {
POPT_AUTOHELP
@@ -585,7 +588,7 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
{"verbose", 'v', POPT_ARG_NONE, &verbose, 'v', "Be verbose" },
{"locks", 'L', POPT_ARG_NONE, &locks_only, 'L', "Show locks only" },
{"shares", 'S', POPT_ARG_NONE, &shares_only, 'S', "Show shares only" },
- {"user", 'u', POPT_ARG_STRING, 0, 'u', "Switch to user" },
+ {"user", 'u', POPT_ARG_STRING, &username, 'u', "Switch to user" },
{"brief", 'b', POPT_ARG_NONE, &brief, 'b', "Be brief" },
#ifdef WITH_PROFILE
{"profile", 'P', POPT_ARG_NONE, &profile_only, 'P', "Do profiling" },
@@ -615,6 +618,15 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
}
}
+ /* setup the flags based on the possible combincations */
+
+ show_processes = !(shares_only || locks_only || profile_only) || processes_only;
+ show_locks = !(shares_only || processes_only || profile_only) || locks_only;
+ show_shares = !(processes_only || locks_only || profile_only) || shares_only;
+
+ if ( username )
+ Ucrit_addUsername( username );
+
if (verbose) {
d_printf("using configfile = %s\n", dyn_CONFIGFILE);
}
@@ -628,43 +640,50 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
return profile_dump();
}
- tdb = tdb_open_log(lock_path("sessionid.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0);
- if (!tdb) {
- d_printf("sessionid.tdb not initialised\n");
- } else {
- if (locks_only) goto locks;
-
- d_printf("\nSamba version %s\n",SAMBA_VERSION_STRING);
- d_printf("PID Username Group Machine \n");
- d_printf("-------------------------------------------------------------------\n");
-
- tdb_traverse(tdb, traverse_sessionid, NULL);
- tdb_close(tdb);
+ if ( show_processes ) {
+ tdb = tdb_open_log(lock_path("sessionid.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0);
+ if (!tdb) {
+ d_printf("sessionid.tdb not initialised\n");
+ } else {
+ d_printf("\nSamba version %s\n",SAMBA_VERSION_STRING);
+ d_printf("PID Username Group Machine \n");
+ d_printf("-------------------------------------------------------------------\n");
+
+ tdb_traverse(tdb, traverse_sessionid, NULL);
+ tdb_close(tdb);
+ }
+
+ if (processes_only)
+ exit(0);
}
- tdb = tdb_open_log(lock_path("connections.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0);
- if (!tdb) {
- d_printf("%s not initialised\n", lock_path("connections.tdb"));
- d_printf("This is normal if an SMB client has never connected to your server.\n");
- } else {
- if (verbose) {
- d_printf("Opened %s\n", lock_path("connections.tdb"));
+ if ( show_shares ) {
+ tdb = tdb_open_log(lock_path("connections.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0);
+ if (!tdb) {
+ d_printf("%s not initialised\n", lock_path("connections.tdb"));
+ d_printf("This is normal if an SMB client has never connected to your server.\n");
+ } else {
+ if (verbose) {
+ d_printf("Opened %s\n", lock_path("connections.tdb"));
+ }
+
+ if (brief)
+ exit(0);
+
+ d_printf("\nService pid machine Connected at\n");
+ d_printf("-------------------------------------------------------\n");
+
+ tdb_traverse(tdb, traverse_fn1, NULL);
+ tdb_close(tdb);
+
+ d_printf("\n");
}
- if (brief)
+ if ( shares_only )
exit(0);
-
- d_printf("\nService pid machine Connected at\n");
- d_printf("-------------------------------------------------------\n");
-
- tdb_traverse(tdb, traverse_fn1, NULL);
- tdb_close(tdb);
}
- locks:
- if (processes_only) exit(0);
-
- if (!shares_only) {
+ if ( show_locks ) {
int ret;
if (!locking_init(1)) {
diff --git a/testsuite/libsmbclient/src/Makefile b/testsuite/libsmbclient/src/Makefile
index a59f1342801..8b4658f7db3 100644
--- a/testsuite/libsmbclient/src/Makefile
+++ b/testsuite/libsmbclient/src/Makefile
@@ -1,6 +1,6 @@
CC = gcc
-CFLAGS = -Wall -W -O2 -g
-LFLAGS = -L/root/samba-head-old/source/bin
+CFLAGS = -Wall -W -O2 -g -I../../../source/include
+LFLAGS = -L../../../source/bin
LIBS= -L/usr/lib -lsmbclient
INCPATH= -I. -I/usr/include -I./include
@@ -10,6 +10,13 @@ SUB_DIRS=init fstat open unlink chown close opendir closedir rename lseek lseekd
getdents creat read readdir mkdir rmdir write chmod open_print_job list_print_jobs \
print_file telldir unlink_print_job
+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
G_INIT = $(BIN_DIR)/init_1 \
$(BIN_DIR)/init_2 \
@@ -712,98 +719,122 @@ $(BIN_DIR)/read_13: read/read_13.o
$(BIN_DIR)/chmod_1: chmod/chmod_1.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ chmod/chmod_1.o $(INCPATH) $(LIBS)
$(BIN_DIR)/telldir_1: telldir/telldir_1.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ telldir/telldir_1.o $(INCPATH) $(LIBS)
$(BIN_DIR)/telldir_2: telldir/telldir_2.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ telldir/telldir_2.o $(INCPATH) $(LIBS)
$(BIN_DIR)/telldir_3: telldir/telldir_3.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ telldir/telldir_3.o $(INCPATH) $(LIBS)
$(BIN_DIR)/telldir_4: telldir/telldir_4.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ telldir/telldir_4.o $(INCPATH) $(LIBS)
$(BIN_DIR)/telldir_5: telldir/telldir_5.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ telldir/telldir_5.o $(INCPATH) $(LIBS)
$(BIN_DIR)/print_file_1: print_file/print_file_1.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ print_file/print_file_1.o $(INCPATH) $(LIBS)
$(BIN_DIR)/print_file_2: print_file/print_file_2.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ print_file/print_file_2.o $(INCPATH) $(LIBS)
$(BIN_DIR)/print_file_3: print_file/print_file_3.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ print_file/print_file_3.o $(INCPATH) $(LIBS)
$(BIN_DIR)/print_file_4: print_file/print_file_4.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ print_file/print_file_4.o $(INCPATH) $(LIBS)
$(BIN_DIR)/open_print_job_1: open_print_job/open_print_job_1.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ open_print_job/open_print_job_1.o $(INCPATH) $(LIBS)
$(BIN_DIR)/open_print_job_2: open_print_job/open_print_job_2.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ open_print_job/open_print_job_2.o $(INCPATH) $(LIBS)
$(BIN_DIR)/list_print_jobs_1: list_print_jobs/list_print_jobs_1.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ list_print_jobs/list_print_jobs_1.o $(INCPATH) $(LIBS)
$(BIN_DIR)/list_print_jobs_2: list_print_jobs/list_print_jobs_2.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ list_print_jobs/list_print_jobs_2.o $(INCPATH) $(LIBS)
$(BIN_DIR)/list_print_jobs_3: list_print_jobs/list_print_jobs_3.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ list_print_jobs/list_print_jobs_3.o $(INCPATH) $(LIBS)
$(BIN_DIR)/list_print_jobs_4: list_print_jobs/list_print_jobs_4.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ list_print_jobs/list_print_jobs_4.o $(INCPATH) $(LIBS)
$(BIN_DIR)/list_print_jobs_5: list_print_jobs/list_print_jobs_5.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ list_print_jobs/list_print_jobs_5.o $(INCPATH) $(LIBS)
$(BIN_DIR)/list_print_jobs_6: list_print_jobs/list_print_jobs_6.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ list_print_jobs/list_print_jobs_6.o $(INCPATH) $(LIBS)
$(BIN_DIR)/list_print_jobs_7: list_print_jobs/list_print_jobs_7.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ list_print_jobs/list_print_jobs_7.o $(INCPATH) $(LIBS)
$(BIN_DIR)/unlink_print_job_1: unlink_print_job/unlink_print_job_1.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ unlink_print_job/unlink_print_job_1.o $(INCPATH) $(LIBS)
$(BIN_DIR)/unlink_print_job_2: unlink_print_job/unlink_print_job_2.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ unlink_print_job/unlink_print_job_2.o $(INCPATH) $(LIBS)
$(BIN_DIR)/unlink_print_job_3: unlink_print_job/unlink_print_job_3.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ unlink_print_job/unlink_print_job_3.o $(INCPATH) $(LIBS)
$(BIN_DIR)/unlink_print_job_4: unlink_print_job/unlink_print_job_4.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ unlink_print_job/unlink_print_job_4.o $(INCPATH) $(LIBS)
$(BIN_DIR)/unlink_print_job_5: unlink_print_job/unlink_print_job_5.o
@echo Linking $@
+ @dir=$(BIN_DIR) $(MAKEDIR)@
@$(CC) $(LFLAGS) -o $@ unlink_print_job/unlink_print_job_5.o $(INCPATH) $(LIBS)
@@ -813,5 +844,6 @@ clean:
done
@rm -f $(GROUPS)
+ @rm -rf $(BIN_DIR)
@echo "Done"