[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Sat Nov 21 15:20:43 MST 2009


The branch, master has been updated
       via  e28545e... s3: Fix some nonempty blank lines
       via  384f303... s3: Remove a struct typedef
      from  cf2febf... s3: Make alloc_sub_basic() static

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e28545e85472c630244205f5c3fae4956089daa3
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Nov 21 22:52:12 2009 +0100

    s3: Fix some nonempty blank lines

commit 384f303c2cafa6659c24a62209de846cd5d45d84
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Nov 21 21:36:01 2009 +0100

    s3: Remove a struct typedef

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

Summary of changes:
 source3/include/msdfs.h          |    4 +-
 source3/include/proto.h          |    2 +-
 source3/libsmb/clidfs.c          |   12 +-
 source3/libsmb/libsmb_cache.c    |   55 +++---
 source3/libsmb/libsmb_compat.c   |   57 +++---
 source3/libsmb/libsmb_file.c     |  224 ++++++++-------------
 source3/libsmb/libsmb_misc.c     |   18 +-
 source3/libsmb/libsmb_path.c     |   88 ++++----
 source3/libsmb/libsmb_printjob.c |  100 ++++------
 source3/libsmb/libsmb_setget.c   |    6 +-
 source3/libsmb/libsmb_stat.c     |   79 +++-----
 source3/libsmb/libsmb_xattr.c    |  409 ++++++++++++++++++-------------------
 12 files changed, 477 insertions(+), 577 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/msdfs.h b/source3/include/msdfs.h
index 800393c..b389229 100644
--- a/source3/include/msdfs.h
+++ b/source3/include/msdfs.h
@@ -37,11 +37,11 @@
 #define MAX_REFERRAL_COUNT   256
 #define MAX_MSDFS_JUNCTIONS 256
 
-typedef struct _client_referral {
+struct client_dfs_referral {
 	uint32 proximity;
 	uint32 ttl;
 	char *dfspath;
-} CLIENT_DFS_REFERRAL;
+};
 
 struct referral {
 	char *alternate_path; /* contains the path referred */
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 6a5b3ec..970c8af 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -2256,7 +2256,7 @@ void cli_cm_display(const struct cli_state *c);
 bool cli_dfs_get_referral(TALLOC_CTX *ctx,
 			struct cli_state *cli,
 			const char *path,
-			CLIENT_DFS_REFERRAL**refs,
+			struct client_dfs_referral **refs,
 			size_t *num_refs,
 			size_t *consumed);
 bool cli_resolve_path(TALLOC_CTX *ctx,
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 0afb759..afae4ff 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -602,7 +602,7 @@ static bool cli_dfs_check_error( struct cli_state *cli, NTSTATUS status )
 bool cli_dfs_get_referral(TALLOC_CTX *ctx,
 			struct cli_state *cli,
 			const char *path,
-			CLIENT_DFS_REFERRAL**refs,
+			struct client_dfs_referral **refs,
 			size_t *num_refs,
 			size_t *consumed)
 {
@@ -618,7 +618,7 @@ bool cli_dfs_get_referral(TALLOC_CTX *ctx,
 	char *consumed_path = NULL;
 	uint16_t consumed_ucs;
 	uint16 num_referrals;
-	CLIENT_DFS_REFERRAL *referrals = NULL;
+	struct client_dfs_referral *referrals = NULL;
 	bool ret = false;
 
 	*num_refs = 0;
@@ -687,8 +687,8 @@ bool cli_dfs_get_referral(TALLOC_CTX *ctx,
 		int i;
 		uint16 node_offset;
 
-		referrals = TALLOC_ARRAY(ctx, CLIENT_DFS_REFERRAL,
-				num_referrals);
+		referrals = talloc_array(ctx, struct client_dfs_referral,
+					 num_referrals);
 
 		if (!referrals) {
 			goto out;
@@ -755,7 +755,7 @@ bool cli_resolve_path(TALLOC_CTX *ctx,
 			struct cli_state **targetcli,
 			char **pp_targetpath)
 {
-	CLIENT_DFS_REFERRAL *refs = NULL;
+	struct client_dfs_referral *refs = NULL;
 	size_t num_refs = 0;
 	size_t consumed = 0;
 	struct cli_state *cli_ipc = NULL;
@@ -986,7 +986,7 @@ bool cli_check_msdfs_proxy(TALLOC_CTX *ctx,
 				const char *password,
 				const char *domain)
 {
-	CLIENT_DFS_REFERRAL *refs = NULL;
+	struct client_dfs_referral *refs = NULL;
 	size_t num_refs = 0;
 	size_t consumed = 0;
 	char *fullpath = NULL;
diff --git a/source3/libsmb/libsmb_cache.c b/source3/libsmb/libsmb_cache.c
index bfacea3..53cd3d5 100644
--- a/source3/libsmb/libsmb_cache.c
+++ b/source3/libsmb/libsmb_cache.c
@@ -5,17 +5,17 @@
    Copyright (C) Richard Sharpe 2000
    Copyright (C) John Terpstra 2000
    Copyright (C) Tom Jansen (Ninja ISD) 2002 
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program 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 General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -34,7 +34,7 @@ struct smbc_server_cache {
 	char *workgroup;
 	char *username;
 	SMBCSRV *server;
-        
+
 	struct smbc_server_cache *next, *prev;
 };
 
@@ -53,51 +53,51 @@ SMBC_add_cached_server(SMBCCTX * context,
                        const char * username)
 {
 	struct smbc_server_cache * srvcache = NULL;
-        
+
 	if (!(srvcache = SMB_MALLOC_P(struct smbc_server_cache))) {
 		errno = ENOMEM;
 		DEBUG(3, ("Not enough space for server cache allocation\n"));
 		return 1;
 	}
-        
+
 	ZERO_STRUCTP(srvcache);
-        
+
 	srvcache->server = newsrv;
-        
+
 	srvcache->server_name = SMB_STRDUP(server);
 	if (!srvcache->server_name) {
 		errno = ENOMEM;
 		goto failed;
 	}
-        
+
 	srvcache->share_name = SMB_STRDUP(share);
 	if (!srvcache->share_name) {
 		errno = ENOMEM;
 		goto failed;
 	}
-        
+
 	srvcache->workgroup = SMB_STRDUP(workgroup);
 	if (!srvcache->workgroup) {
 		errno = ENOMEM;
 		goto failed;
 	}
-        
+
 	srvcache->username = SMB_STRDUP(username);
 	if (!srvcache->username) {
 		errno = ENOMEM;
 		goto failed;
 	}
-        
+
 	DLIST_ADD(context->internal->server_cache, srvcache);
 	return 0;
-        
+
 failed:
 	SAFE_FREE(srvcache->server_name);
 	SAFE_FREE(srvcache->share_name);
 	SAFE_FREE(srvcache->workgroup);
 	SAFE_FREE(srvcache->username);
 	SAFE_FREE(srvcache);
-        
+
 	return 1;
 }
 
@@ -116,19 +116,19 @@ SMBC_get_cached_server(SMBCCTX * context,
                        const char * user)
 {
 	struct smbc_server_cache * srv = NULL;
-        
+
 	/* Search the cache lines */
 	for (srv = context->internal->server_cache; srv; srv = srv->next) {
-                
+
 		if (strcmp(server,srv->server_name)  == 0 &&
 		    strcmp(workgroup,srv->workgroup) == 0 &&
 		    strcmp(user, srv->username)  == 0) {
-                        
+
                         /* If the share name matches, we're cool */
                         if (strcmp(share, srv->share_name) == 0) {
                                 return srv->server;
                         }
-                        
+
                         /*
                          * We only return an empty share name or the attribute
                          * server on an exact match (which would have been
@@ -136,7 +136,7 @@ SMBC_get_cached_server(SMBCCTX * context,
                          */
                         if (*share == '\0' || strcmp(share, "*IPC$") == 0)
                                 continue;
-                        
+
                         /*
                          * Never return an empty share name or the attribute
                          * server if it wasn't what was requested.
@@ -144,7 +144,7 @@ SMBC_get_cached_server(SMBCCTX * context,
                         if (*srv->share_name == '\0' ||
                             strcmp(srv->share_name, "*IPC$") == 0)
                                 continue;
-                        
+
                         /*
                          * If we're only allowing one share per server, then
                          * a connection to the server (other than the
@@ -163,7 +163,7 @@ SMBC_get_cached_server(SMBCCTX * context,
                                         smbc_getFunctionRemoveCachedServer(context)(context, srv->server);
                                         continue;
                                 }
-                                
+
                                 /*
                                  * Save the new share name.  We've
                                  * disconnected from the old share, and are
@@ -178,13 +178,12 @@ SMBC_get_cached_server(SMBCCTX * context,
                                         smbc_getFunctionRemoveCachedServer(context)(context, srv->server);
                                         continue;
                                 }
-                                
-                                
+
                                 return srv->server;
                         }
                 }
 	}
-        
+
 	return NULL;
 }
 
@@ -199,10 +198,10 @@ SMBC_remove_cached_server(SMBCCTX * context,
                           SMBCSRV * server)
 {
 	struct smbc_server_cache * srv = NULL;
-        
+
 	for (srv = context->internal->server_cache; srv; srv = srv->next) {
 		if (server == srv->server) { 
-                        
+
 			/* remove this sucker */
 			DLIST_REMOVE(context->internal->server_cache, srv);
 			SAFE_FREE(srv->server_name);
@@ -228,13 +227,13 @@ SMBC_purge_cached_servers(SMBCCTX * context)
 	struct smbc_server_cache * srv;
 	struct smbc_server_cache * next;
 	int could_not_purge_all = 0;
-        
+
 	for (srv = context->internal->server_cache,
                      next = (srv ? srv->next :NULL);
              srv;
              srv = next,
                      next = (srv ? srv->next : NULL)) {
-                
+
 		if (SMBC_remove_unused_server(context, srv->server)) {
 			/* could not be removed */
 			could_not_purge_all = 1;
diff --git a/source3/libsmb/libsmb_compat.c b/source3/libsmb/libsmb_compat.c
index 56d113f..5b2ef2d 100644
--- a/source3/libsmb/libsmb_compat.c
+++ b/source3/libsmb/libsmb_compat.c
@@ -6,17 +6,17 @@
    Copyright (C) John Terpstra 2000
    Copyright (C) Tom Jansen (Ninja ISD) 2002 
    Copyright (C) Derrell Lipman 2003, 2008
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program 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 General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -55,11 +55,10 @@ static int
 add_fd(SMBCFILE * file)
 {
         struct smbc_compat_fdlist * f = smbc_compat_fd_avail;
-        
+
 	if (f) {
                 /* We found one that's available */
                 DLIST_REMOVE(smbc_compat_fd_avail, f);
-                
 	} else {
                 /*
                  * None were available, so allocate one.  Keep the number of
@@ -72,19 +71,19 @@ add_fd(SMBCFILE * file)
                         errno = EMFILE;
                         return -1;
                 }
-                
+
                 f = SMB_MALLOC_P(struct smbc_compat_fdlist);
                 if (!f) {
                         errno = ENOMEM;
                         return -1;
                 }
-                
+
                 f->fd = SMBC_BASE_FD + smbc_compat_nextfd++;
         }
-        
+
 	f->file = file;
 	DLIST_ADD(smbc_compat_fd_in_use, f);
-        
+
 	return f->fd;
 }
 
@@ -95,13 +94,13 @@ static int
 del_fd(int fd)
 {
 	struct smbc_compat_fdlist * f = smbc_compat_fd_in_use;
-        
+
 	while (f) {
 		if (f->fd == fd) 
 			break;
 		f = f->next;
 	}
-        
+
 	if (f) {
 		/* found */
 		DLIST_REMOVE(smbc_compat_fd_in_use, f);
@@ -122,17 +121,17 @@ smbc_init(smbc_get_auth_data_fn fn,
 		statcont = smbc_new_context();
 		if (!statcont) 
 			return -1;
-                
+
                 smbc_setDebug(statcont, debug);
                 smbc_setFunctionAuthData(statcont, fn);
-                
+
 		if (!smbc_init_context(statcont)) {
 			smbc_free_context(statcont, False);
 			return -1;
 		}
-                
+
 		smbc_compat_initialized = 1;
-                
+
 		return 0;
 	}
 	return 0;
@@ -143,15 +142,15 @@ SMBCCTX *
 smbc_set_context(SMBCCTX * context)
 {
         SMBCCTX *old_context = statcont;
-        
+
         if (context) {
                 /* Save provided context.  It must have been initialized! */
                 statcont = context;
-                
+
                 /* You'd better know what you're doing.  We won't help you. */
 		smbc_compat_initialized = 1;
         }
-        
+
         return old_context;
 }
 
@@ -163,11 +162,11 @@ smbc_open(const char *furl,
 {
 	SMBCFILE * file;
 	int fd;
-        
+
         file = smbc_getFunctionOpen(statcont)(statcont, furl, flags, mode);
 	if (!file)
 		return -1;
-        
+
 	fd = add_fd(file);
 	if (fd == -1) 
                 smbc_getFunctionClose(statcont)(statcont, file);
@@ -181,11 +180,11 @@ smbc_creat(const char *furl,
 {
 	SMBCFILE * file;
 	int fd;
-        
+
         file = smbc_getFunctionCreat(statcont)(statcont, furl, mode);
 	if (!file)
 		return -1;
-        
+
 	fd = add_fd(file);
 	if (fd == -1) {
 		/* Hmm... should we delete the file too ? I guess we could try */
@@ -250,15 +249,15 @@ smbc_opendir(const char *durl)
 {
 	SMBCFILE * file;
 	int fd;
-        
+
         file = smbc_getFunctionOpendir(statcont)(statcont, durl);
 	if (!file)
 		return -1;
-        
+
 	fd = add_fd(file);
 	if (fd == -1) 
                 smbc_getFunctionClosedir(statcont)(statcont, file);
-        
+
 	return fd;
 }
 
@@ -372,14 +371,14 @@ smbc_utime(const char *fname,
            struct utimbuf *utbuf)
 {
         struct timeval tv[2];
-        
+
         if (utbuf == NULL)
                 return smbc_getFunctionUtimes(statcont)(statcont, fname, NULL);
-        
+
         tv[0].tv_sec = utbuf->actime;
         tv[1].tv_sec = utbuf->modtime;
         tv[0].tv_usec = tv[1].tv_usec = 0;
-        
+
         return smbc_getFunctionUtimes(statcont)(statcont, fname, tv);
 }
 #endif
@@ -534,7 +533,7 @@ int
 smbc_open_print_job(const char *fname)
 {
         SMBCFILE * file;
-        
+
         file = smbc_getFunctionOpenPrintJob(statcont)(statcont, fname);
 	if (!file) return -1;
 	return file->cli_fd;
diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c
index f6cd8ec..b3b0bc2 100644
--- a/source3/libsmb/libsmb_file.c
+++ b/source3/libsmb/libsmb_file.c
@@ -7,17 +7,17 @@
    Copyright (C) Tom Jansen (Ninja ISD) 2002 
    Copyright (C) Derrell Lipman 2003-2008
    Copyright (C) Jeremy Allison 2007, 2008
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program 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 General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -50,23 +50,19 @@ SMBC_open_ctx(SMBCCTX *context,
 	uint16_t fd;
 	NTSTATUS status = NT_STATUS_OBJECT_PATH_INVALID;
 	TALLOC_CTX *frame = talloc_stackframe();
-        
+
 	if (!context || !context->internal->initialized) {
-                


-- 
Samba Shared Repository


More information about the samba-cvs mailing list