summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-01-02 11:39:04 -0800
committerJeremy Allison <jra@samba.org>2009-01-02 11:39:04 -0800
commit11576353f645d7d7f44a74d27545b946c6175658 (patch)
treea756a430d3fea82ac8a24144613d5d7e04d163f1 /source3
parent2234173220c51c2e37818149ddf41421672904c0 (diff)
parent268f3e93a4dd66ce43dc53278eff01f801ba5083 (diff)
downloadsamba-11576353f645d7d7f44a74d27545b946c6175658.tar.gz
samba-11576353f645d7d7f44a74d27545b946c6175658.tar.bz2
samba-11576353f645d7d7f44a74d27545b946c6175658.zip
Merge branch 'master' of ssh://jra@git.samba.org/data/git/samba
Diffstat (limited to 'source3')
-rwxr-xr-xsource3/autogen.sh4
-rw-r--r--source3/include/smb.h2
-rw-r--r--source3/lib/ldb/include/ldb.h2
-rw-r--r--source3/lib/ldb/tools/ldbadd.c13
-rw-r--r--source3/lib/ldb/tools/ldbmodify.c12
-rw-r--r--source3/libsmb/smb_share_modes.c43
-rw-r--r--source3/modules/onefs_open.c6
-rw-r--r--source3/winbindd/idmap.c11
8 files changed, 55 insertions, 38 deletions
diff --git a/source3/autogen.sh b/source3/autogen.sh
index 61316a8f70..1a33eb22cc 100755
--- a/source3/autogen.sh
+++ b/source3/autogen.sh
@@ -4,11 +4,11 @@
while true; do
case $1 in
- (--version-file)
+ --version-file)
VERSION_FILE=$2
shift 2
;;
- (*)
+ *)
break
;;
esac
diff --git a/source3/include/smb.h b/source3/include/smb.h
index a8a2d98154..3253773903 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -27,7 +27,7 @@
#define _SMB_H
/* logged when starting the various Samba daemons */
-#define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2008"
+#define COPYRIGHT_STARTUP_MESSAGE "Copyright Andrew Tridgell and the Samba Team 1992-2009"
#if defined(LARGE_SMB_OFF_T)
diff --git a/source3/lib/ldb/include/ldb.h b/source3/lib/ldb/include/ldb.h
index 0a745742d9..3891c1c6a3 100644
--- a/source3/lib/ldb/include/ldb.h
+++ b/source3/lib/ldb/include/ldb.h
@@ -991,7 +991,7 @@ int ldb_search(struct ldb_context *ldb,
const struct ldb_dn *base,
enum ldb_scope scope,
const char *expression,
- const char * const *attrs, struct ldb_result **res);
+ const char * const *attrs, struct ldb_result **_res);
/*
* a useful search function where you can easily define the expression and
diff --git a/source3/lib/ldb/tools/ldbadd.c b/source3/lib/ldb/tools/ldbadd.c
index 4dde2a1ef5..155395e065 100644
--- a/source3/lib/ldb/tools/ldbadd.c
+++ b/source3/lib/ldb/tools/ldbadd.c
@@ -35,8 +35,6 @@
#include "ldb/include/includes.h"
#include "ldb/tools/cmdline.h"
-static int failures;
-
static void usage(void)
{
printf("Usage: ldbadd <options> <ldif...>\n");
@@ -53,7 +51,8 @@ static void usage(void)
/*
add records from an opened file
*/
-static int process_file(struct ldb_context *ldb, FILE *f, int *count)
+static int process_file(struct ldb_context *ldb, FILE *f, int *count,
+ int *failures)
{
struct ldb_ldif *ldif;
int ret = LDB_SUCCESS;
@@ -71,7 +70,7 @@ static int process_file(struct ldb_context *ldb, FILE *f, int *count)
if (ret != LDB_SUCCESS) {
fprintf(stderr, "ERR: \"%s\" on DN %s\n",
ldb_errstring(ldb), ldb_dn_linearize(ldb, ldif->msg->dn));
- failures++;
+ (*failures)++;
} else {
(*count)++;
}
@@ -86,7 +85,7 @@ static int process_file(struct ldb_context *ldb, FILE *f, int *count)
int main(int argc, const char **argv)
{
struct ldb_context *ldb;
- int i, ret=0, count=0;
+ int i, ret=0, count=0, failures=0;
struct ldb_cmdline *options;
ldb_global_init();
@@ -96,7 +95,7 @@ int main(int argc, const char **argv)
options = ldb_cmdline_process(ldb, argc, argv, usage);
if (options->argc == 0) {
- ret = process_file(ldb, stdin, &count);
+ ret = process_file(ldb, stdin, &count, &failures);
} else {
for (i=0;i<options->argc;i++) {
const char *fname = options->argv[i];
@@ -106,7 +105,7 @@ int main(int argc, const char **argv)
perror(fname);
exit(1);
}
- ret = process_file(ldb, f, &count);
+ ret = process_file(ldb, f, &count, &failures);
fclose(f);
}
}
diff --git a/source3/lib/ldb/tools/ldbmodify.c b/source3/lib/ldb/tools/ldbmodify.c
index 368b4cf996..f12387a8f6 100644
--- a/source3/lib/ldb/tools/ldbmodify.c
+++ b/source3/lib/ldb/tools/ldbmodify.c
@@ -35,8 +35,6 @@
#include "ldb/include/includes.h"
#include "ldb/tools/cmdline.h"
-static int failures;
-
static void usage(void)
{
printf("Usage: ldbmodify <options> <ldif...>\n");
@@ -52,7 +50,8 @@ static void usage(void)
/*
process modifies for one file
*/
-static int process_file(struct ldb_context *ldb, FILE *f, int *count)
+static int process_file(struct ldb_context *ldb, FILE *f, int *count,
+ int *failures)
{
struct ldb_ldif *ldif;
int ret = LDB_SUCCESS;
@@ -73,7 +72,7 @@ static int process_file(struct ldb_context *ldb, FILE *f, int *count)
if (ret != LDB_SUCCESS) {
fprintf(stderr, "ERR: \"%s\" on DN %s\n",
ldb_errstring(ldb), ldb_dn_linearize(ldb, ldif->msg->dn));
- failures++;
+ (*failures)++;
} else {
(*count)++;
}
@@ -87,6 +86,7 @@ int main(int argc, const char **argv)
{
struct ldb_context *ldb;
int count=0;
+ int failures=0;
int i, ret=LDB_SUCCESS;
struct ldb_cmdline *options;
@@ -97,7 +97,7 @@ int main(int argc, const char **argv)
options = ldb_cmdline_process(ldb, argc, argv, usage);
if (options->argc == 0) {
- ret = process_file(ldb, stdin, &count);
+ ret = process_file(ldb, stdin, &count, &failures);
} else {
for (i=0;i<options->argc;i++) {
const char *fname = options->argv[i];
@@ -107,7 +107,7 @@ int main(int argc, const char **argv)
perror(fname);
exit(1);
}
- ret = process_file(ldb, f, &count);
+ ret = process_file(ldb, f, &count, &failures);
}
}
diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c
index 16b3b10925..af3f7b0dd5 100644
--- a/source3/libsmb/smb_share_modes.c
+++ b/source3/libsmb/smb_share_modes.c
@@ -1,7 +1,7 @@
/*
Samba share mode database library external interface library.
Used by non-Samba products needing access to the Samba share mode db.
-
+
Copyright (C) Jeremy Allison 2005 - 2006
sharemodes_procid functions (C) Copyright (C) Volker Lendecke 2005
@@ -9,17 +9,17 @@
** NOTE! The following LGPL license applies to this module only.
** This does NOT imply that all of Samba is released
** under the LGPL
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
-
+
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
-
+
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
@@ -92,16 +92,16 @@ int smb_share_mode_db_close(struct smbdb_ctx *db_ctx)
return ret;
}
-static TDB_DATA get_locking_key(uint64_t dev, uint64_t ino)
+static TDB_DATA get_locking_key(struct locking_key *lk, uint64_t dev,
+ uint64_t ino)
{
- static struct locking_key lk;
TDB_DATA ld;
- memset(&lk, '\0', sizeof(struct locking_key));
- lk.dev = (SMB_DEV_T)dev;
- lk.inode = (SMB_INO_T)ino;
- ld.dptr = (uint8 *)&lk;
- ld.dsize = sizeof(lk);
+ memset(lk, '\0', sizeof(*lk));
+ lk->dev = (SMB_DEV_T)dev;
+ lk->inode = (SMB_INO_T)ino;
+ ld.dptr = (uint8 *)lk;
+ ld.dsize = sizeof(*lk);
return ld;
}
@@ -113,14 +113,17 @@ int smb_lock_share_mode_entry(struct smbdb_ctx *db_ctx,
uint64_t dev,
uint64_t ino)
{
- return tdb_chainlock(db_ctx->smb_tdb, get_locking_key(dev, ino));
+ struct locking_key lk;
+ return tdb_chainlock(db_ctx->smb_tdb, get_locking_key(&lk, dev, ino));
}
-
+
int smb_unlock_share_mode_entry(struct smbdb_ctx *db_ctx,
uint64_t dev,
uint64_t ino)
{
- return tdb_chainunlock(db_ctx->smb_tdb, get_locking_key(dev, ino));
+ struct locking_key lk;
+ return tdb_chainunlock(db_ctx->smb_tdb,
+ get_locking_key(&lk, dev, ino));
}
/*
@@ -172,6 +175,7 @@ int smb_get_share_mode_entries(struct smbdb_ctx *db_ctx,
struct smb_share_mode_entry **pp_list,
unsigned char *p_delete_on_close)
{
+ struct locking_key lk;
TDB_DATA db_data;
struct smb_share_mode_entry *list = NULL;
int num_share_modes = 0;
@@ -183,7 +187,7 @@ int smb_get_share_mode_entries(struct smbdb_ctx *db_ctx,
*pp_list = NULL;
*p_delete_on_close = 0;
- db_data = tdb_fetch(db_ctx->smb_tdb, get_locking_key(dev, ino));
+ db_data = tdb_fetch(db_ctx->smb_tdb, get_locking_key(&lk, dev, ino));
if (!db_data.dptr) {
return 0;
}
@@ -258,7 +262,8 @@ int smb_create_share_mode_entry_ex(struct smbdb_ctx *db_ctx,
const char *filename) /* Must be relative utf8 path. */
{
TDB_DATA db_data;
- TDB_DATA locking_key = get_locking_key(dev, ino);
+ struct locking_key lk;
+ TDB_DATA locking_key = get_locking_key(&lk, dev, ino);
int orig_num_share_modes = 0;
struct locking_data *ld = NULL; /* internal samba db state. */
struct share_mode_entry *shares = NULL;
@@ -371,7 +376,8 @@ int smb_delete_share_mode_entry(struct smbdb_ctx *db_ctx,
const struct smb_share_mode_entry *del_entry)
{
TDB_DATA db_data;
- TDB_DATA locking_key = get_locking_key(dev, ino);
+ struct locking_key lk;
+ TDB_DATA locking_key = get_locking_key(&lk, dev, ino);
int orig_num_share_modes = 0;
struct locking_data *ld = NULL; /* internal samba db state. */
struct share_mode_entry *shares = NULL;
@@ -473,7 +479,8 @@ int smb_change_share_mode_entry(struct smbdb_ctx *db_ctx,
const struct smb_share_mode_entry *new_entry)
{
TDB_DATA db_data;
- TDB_DATA locking_key = get_locking_key(dev, ino);
+ struct locking_key lk;
+ TDB_DATA locking_key = get_locking_key(&lk, dev, ino);
int num_share_modes = 0;
struct locking_data *ld = NULL; /* internal samba db state. */
struct share_mode_entry *shares = NULL;
diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index a4a317d905..a86d39948d 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -1,8 +1,8 @@
/*
* Unix SMB/CIFS implementation.
*
- * This file began with some code from source3/smbd/open.c and modified it to
- * work with ifs_createfile.
+ * This file began with some code from source3/smbd/open.c and has been
+ * modified it work with ifs_createfile.
*
* ifs_createfile is a CIFS-specific syscall for opening/files and
* directories. It adds support for:
@@ -459,7 +459,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
DEBUG(10, ("onefs_open_file_ntcreate: printer open fname=%s\n",
fname));
- return print_fsp_open(req, conn, fname, req->vuid, fsp);
+ return print_fsp_open(req, conn, fname, req->vuid, fsp, psbuf);
}
if (!parent_dirname(talloc_tos(), fname, &parent_dir, &newname)) {
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c
index 6be55ef03c..ca07f230ab 100644
--- a/source3/winbindd/idmap.c
+++ b/source3/winbindd/idmap.c
@@ -735,6 +735,17 @@ NTSTATUS idmap_backends_unixid_to_sid(const char *domname, struct id_map *id)
maps[0] = id;
maps[1] = NULL;
+ /*
+ * Always give passdb a chance first
+ */
+
+ dom = idmap_init_passdb_domain(NULL);
+ if ((dom != NULL)
+ && NT_STATUS_IS_OK(dom->methods->unixids_to_sids(dom, maps))
+ && id->status == ID_MAPPED) {
+ return NT_STATUS_OK;
+ }
+
dom = idmap_find_domain(domname);
if (dom == NULL) {
return NT_STATUS_NONE_MAPPED;