From 4d82f69f884c0c9105d7c1cc53a1235e26222fbc Mon Sep 17 00:00:00 2001 From: Tim Prouty Date: Wed, 31 Dec 2008 21:24:25 -0800 Subject: s3: Fix caller of print_fsp_open --- source3/modules/onefs_open.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3') 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)) { -- cgit From 74ea79cb8fa42b1bc13ac2bd9450beb13ad1cd5e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 1 Jan 2009 13:28:38 +0100 Subject: The Tru64 shell doesn't like (*) in a case statement --- source3/autogen.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3') 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 -- cgit From e551f43b4b690d92cbf00a510e6c79a497d91464 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 1 Jan 2009 18:16:42 +0100 Subject: Remove two pointless globals --- source3/lib/ldb/tools/ldbadd.c | 13 ++++++------- source3/lib/ldb/tools/ldbmodify.c | 12 ++++++------ 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'source3') 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 \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;iargc;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 \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;iargc;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); } } -- cgit From bf34e998f967a2e9c3528b61a825569378b480af Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 1 Jan 2009 19:47:40 +0100 Subject: fix some nonempty blank lines --- source3/libsmb/smb_share_modes.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c index 16b3b10925..7d363f5d8b 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 . */ @@ -115,7 +115,7 @@ int smb_lock_share_mode_entry(struct smbdb_ctx *db_ctx, { return tdb_chainlock(db_ctx->smb_tdb, get_locking_key(dev, ino)); } - + int smb_unlock_share_mode_entry(struct smbdb_ctx *db_ctx, uint64_t dev, uint64_t ino) -- cgit From 707a5a41b5818b7a59027d16abdce9f57be9cdcd Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 1 Jan 2009 19:55:20 +0100 Subject: Remove a global variable --- source3/libsmb/smb_share_modes.c | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'source3') diff --git a/source3/libsmb/smb_share_modes.c b/source3/libsmb/smb_share_modes.c index 7d363f5d8b..af3f7b0dd5 100644 --- a/source3/libsmb/smb_share_modes.c +++ b/source3/libsmb/smb_share_modes.c @@ -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; -- cgit From 7458111ea4cf33b2a093e5edfb3b42ebfdc330c5 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 1 Jan 2009 22:05:03 +0100 Subject: Fix bug 5913. Never seen this to be a problem, but it doesn't hurt either :-) --- source3/lib/ldb/include/ldb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3') 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 -- cgit From 8b81e7c7c65f3923aaa7a366733000517b44756e Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 2 Jan 2009 09:44:53 +0100 Subject: Happy New Year! metze --- source3/include/smb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3') 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) -- cgit From c033ea562669a2d28da53b3dbe566cdb7d26d43e Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 2 Jan 2009 14:51:06 +0100 Subject: Revert "s3:idmap: Remove passd check from idmap_backends_unixid_to_sid()." This reverts commit 45db33e73262d8e195a46fb96405dfb3dc43d6bc. --- source3/winbindd/idmap.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3') diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index 6be55ef03c..38cc0d0c0a 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -735,6 +735,15 @@ NTSTATUS idmap_backends_unixid_to_sid(const char *domname, struct id_map *id) maps[0] = id; maps[1] = NULL; + if (sid_check_is_in_builtin(id->sid) + || (sid_check_is_in_our_domain(id->sid))) { + dom = idmap_init_passdb_domain(NULL); + if (dom == NULL) { + return NT_STATUS_NONE_MAPPED; + } + return dom->methods->unixids_to_sids(dom, maps); + } + dom = idmap_find_domain(domname); if (dom == NULL) { return NT_STATUS_NONE_MAPPED; -- cgit From 13248e8917015435c8979535531484344e3f2262 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 2 Jan 2009 14:51:23 +0100 Subject: Revert "s:Fix uid_to_sid mapping when the idmap cache is empty." This reverts commit 9a9b64dbdfce4414ada22d4f882c8c757b5813e1. --- source3/winbindd/idmap.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source3') diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index 38cc0d0c0a..aaba7e53ee 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -735,13 +735,14 @@ NTSTATUS idmap_backends_unixid_to_sid(const char *domname, struct id_map *id) maps[0] = id; maps[1] = NULL; - if (sid_check_is_in_builtin(id->sid) - || (sid_check_is_in_our_domain(id->sid))) { - dom = idmap_init_passdb_domain(NULL); - if (dom == NULL) { - return NT_STATUS_NONE_MAPPED; - } - return dom->methods->unixids_to_sids(dom, maps); + /* + * 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))) { + return NT_STATUS_OK; } dom = idmap_find_domain(domname); -- cgit From 76d53e7648869bbdc83be1e07941467019b96321 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 2 Jan 2009 14:53:26 +0100 Subject: Alternative fix for 45db33e73 and 0d443ae7931 Simo is right, we need to ask passdb first. At least this fixes a nasty to find NT_STATUS_ACCESS_DENIED problem in the build farm for the test run I just did on host "opi". Michael, can you re-check if this also fixes the error you found, leading to the two fixes? Thanks, Volker --- source3/winbindd/idmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index aaba7e53ee..ca07f230ab 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -741,7 +741,8 @@ NTSTATUS idmap_backends_unixid_to_sid(const char *domname, struct id_map *id) dom = idmap_init_passdb_domain(NULL); if ((dom != NULL) - && NT_STATUS_IS_OK(dom->methods->unixids_to_sids(dom, maps))) { + && NT_STATUS_IS_OK(dom->methods->unixids_to_sids(dom, maps)) + && id->status == ID_MAPPED) { return NT_STATUS_OK; } -- cgit