[SCM] Samba Shared Repository - branch v3-2-stable updated -
release-3-2-0rc2-76-g31a23b3
Karolin Seeger
kseeger at samba.org
Tue Jun 24 07:42:14 GMT 2008
The branch, v3-2-stable has been updated
via 31a23b3fe4ca3cf7c65a6b3e079d10ef2956fae2 (commit)
via 1cbae6583e04aa382c27d459f8d1c58488b3af7a (commit)
via c7d963191e1858000752ff57eac1501777f0ebda (commit)
from 44031107568fae0afe501bf218b48aa74598f132 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-stable
- Log -----------------------------------------------------------------
commit 31a23b3fe4ca3cf7c65a6b3e079d10ef2956fae2
Author: Derrell Lipman <derrell.lipman at unwireduniverse.com>
Date: Wed Jun 18 11:00:46 2008 -0400
Remove prototype of unimplemented smbc_chown() function.
(cherry picked from commit 0e84e3bb800cec2b63df4692afbf9c40850b108f)
commit 1cbae6583e04aa382c27d459f8d1c58488b3af7a
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>
(cherry picked from commit fa803ce183376c938f92b0f31a7d89d522fd309f)
commit c7d963191e1858000752ff57eac1501777f0ebda
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>
(cherry picked from commit 84b1ea39a4f27ebcf06a2bafed78396c7353df0e)
-----------------------------------------------------------------------
Summary of changes:
examples/libsmbclient/get_auth_data_fn.h | 13 ++++++++++-
examples/libsmbclient/testbrowse.c | 3 ++
source/include/libsmbclient.h | 36 ++++++++---------------------
3 files changed, 25 insertions(+), 27 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 2e38944..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
@@ -1580,32 +1590,6 @@ int smbc_fstat(int fd, struct stat *st);
int smbc_ftruncate(int fd, off_t size);
-/**@ingroup attribue
- * Change the ownership of a file or directory.
- *
- * @param url The smb url of the file or directory to change
- * ownership of.
- *
- * @param owner I have no idea?
- *
- * @param group I have not idea?
- *
- * @return 0 on success, < 0 on error with errno set:
- * - EPERM The effective UID does not match the owner
- * of the file, and is not zero; or the owner or group
- * were specified incorrectly.
- * - ENOENT The file does not exist.
- * - ENOMEM Insufficient was available.
- * - ENOENT file or directory does not exist
- *
- * @todo Are we actually going to be able to implement this function
- *
- * @todo How do we abstract owner and group uid and gid?
- *
- */
-int smbc_chown(const char *url, uid_t owner, gid_t group);
-
-
/**@ingroup attribute
* Change the permissions of a file.
*
--
Samba Shared Repository
More information about the samba-cvs
mailing list