Fwd: [SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-2953-gfa803ce

Derrell Lipman derrell at samba.org
Mon Jun 23 19:46:34 GMT 2008


Karolin, at your convenience, please pull these two commits (below) plus
0e84e3bb800cec2b63df4692afbf9c40850b108f.  They are all fairly low-risk.  If
you're not comfortable with doing them for this release, feel free to delay
until the subsequent release.

Cheers,

Derrell


---------- Forwarded message ----------
From: Derrell Lipman <derrell at samba.org>
Date: Mon, Jun 23, 2008 at 3:42 PM
Subject: [SCM] Samba Shared Repository - branch v3-3-test updated -
release-3-2-0pre2-2953-gfa803ce
To: samba-cvs at samba.org


The branch, v3-3-test has been updated
      via  fa803ce183376c938f92b0f31a7d89d522fd309f (commit)
      via  84b1ea39a4f27ebcf06a2bafed78396c7353df0e (commit)
     from  b20019ceaaf4a8964792f6ba37f50f91b6847e7f (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit fa803ce183376c938f92b0f31a7d89d522fd309f
Author: Andreas Schneider <anschneider at suse.de>
Date:   Mon Jun 23 16:29:40 2008 +0200

   Add documentation for kerberos support in libsmbclient.

   Signed-off-by: Andreas Schneider <anschneider at suse.de>
   Signed-off-by: Derrell Lipman <derrell.lipman at unwireduniverse.com>

commit 84b1ea39a4f27ebcf06a2bafed78396c7353df0e
Author: Andreas Schneider <anschneider at suse.de>
Date:   Mon Jun 23 11:00:20 2008 +0200

   Add krb5 support for the testbrowse example.

   Signed-off-by: Andreas Schneider <anschneider at suse.de>
   Signed-off-by: Derrell Lipman <derrell.lipman at unwireduniverse.com>

-----------------------------------------------------------------------

Summary of changes:
 examples/libsmbclient/get_auth_data_fn.h |   13 ++++++++++++-
 examples/libsmbclient/testbrowse.c       |    3 +++
 source/include/libsmbclient.h            |   10 ++++++++++
 3 files changed, 25 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/libsmbclient/get_auth_data_fn.h
b/examples/libsmbclient/get_auth_data_fn.h
index b1d36c8..6b91c97 100644
--- a/examples/libsmbclient/get_auth_data_fn.h
+++ b/examples/libsmbclient/get_auth_data_fn.h
@@ -1,3 +1,5 @@
+#include <stdlib.h>
+
 static void
 get_auth_data_fn(const char * pServer,
                 const char * pShare,
@@ -15,6 +17,8 @@ get_auth_data_fn(const char * pServer,
    char            username[256] = { '\0' };
    char            password[256] = { '\0' };

+    static int krb5_set = 1;
+
    if (strcmp(server, pServer) == 0 &&
        strcmp(share, pShare) == 0 &&
        *workgroup != '\0' &&
@@ -25,7 +29,12 @@ get_auth_data_fn(const char * pServer,
        strncpy(pPassword, password, maxLenPassword - 1);
        return;
    }
-
+
+    if (krb5_set && getenv("KRB5CCNAME")) {
+      krb5_set = 0;
+      return;
+    }
+
    fprintf(stdout, "Workgroup: [%s] ", pWorkgroup);
    fgets(temp, sizeof(temp), stdin);

@@ -68,4 +77,6 @@ get_auth_data_fn(const char * pServer,
    strncpy(workgroup, pWorkgroup, sizeof(workgroup) - 1);
    strncpy(username, pUsername, sizeof(username) - 1);
    strncpy(password, pPassword, sizeof(password) - 1);
+
+    krb5_set = 1;
 }
diff --git a/examples/libsmbclient/testbrowse.c
b/examples/libsmbclient/testbrowse.c
index a7eda36..a6e6395 100644
--- a/examples/libsmbclient/testbrowse.c
+++ b/examples/libsmbclient/testbrowse.c
@@ -117,6 +117,9 @@ main(int argc, char * argv[])
        smbc_setFunctionAuthData(context, get_auth_data_fn);
    }

+    smbc_setOptionUseKerberos(context, 1);
+    smbc_setOptionFallbackAfterKerberos(context, 1);
+
    /* If we've been asked to log to stderr instead of stdout, ... */
    if (debug_stderr) {
        /* ... then set the option to do so */
diff --git a/source/include/libsmbclient.h b/source/include/libsmbclient.h
index 9600264..74d0d5c 100644
--- a/source/include/libsmbclient.h
+++ b/source/include/libsmbclient.h
@@ -259,6 +259,11 @@ typedef struct _SMBCCTX SMBCCTX;
 * Type for the the authentication function called by the library to
 * obtain authentication credentals
 *
+ * For kerberos support the function should just be called without
+ * prompting the user for credentials. Which means a simple 'return'
+ * should work. Take a look at examples/libsmbclient/get_auth_data_fn.h
+ * and examples/libsmbclient/testbrowse.c.
+ *
 * @param srv       Server being authenticated to
 *
 * @param shr       Share being authenticated to
@@ -293,6 +298,11 @@ typedef void (*smbc_get_auth_data_fn)(const char *srv,
 * Type for the the authentication function called by the library to
 * obtain authentication credentals
 *
+ * For kerberos support the function should just be called without
+ * prompting the user for credentials. Which means a simple 'return'
+ * should work. Take a look at examples/libsmbclient/get_auth_data_fn.h
+ * and examples/libsmbclient/testbrowse.c.
+ *
 * @param c         Pointer to the smb context
 *
 * @param srv       Server being authenticated to


--
Samba Shared Repository



-- 
"There is nothing more difficult to plan, more doubtful of success, nor more
dangerous to manage than the creation of a new system. For the initiator has
the enmity of all who would profit by the preservation of the old system and
merely lukewarm defenders in those who would gain by the new one."
--Machiavelli, 1513


More information about the samba-technical mailing list