[SCM] Samba Shared Repository - branch v3-2-test updated - initial-v3-2-unstable-1327-gb3afc83

Michael Adam obnox at samba.org
Sun Jan 13 22:46:57 GMT 2008


The branch, v3-2-test has been updated
       via  b3afc8391d40745328172ba012f0ffc166d75aa9 (commit)
       via  b5c533b06cba9a8ffd28a1fb3bc56ab248340775 (commit)
      from  aed01fd28c8e896e993239cbe9b2681132ddf980 (commit)

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


- Log -----------------------------------------------------------------
commit b3afc8391d40745328172ba012f0ffc166d75aa9
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 13 23:45:57 2008 +0100

    Add and modify comments in net_conf.c
    
    Michael

commit b5c533b06cba9a8ffd28a1fb3bc56ab248340775
Author: Michael Adam <obnox at samba.org>
Date:   Sun Jan 13 23:30:08 2008 +0100

    Add explicit creation of shares to net conf import function.
    
    It has been removed from libnet_conf_set_parameter().
    
    Michael

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

Summary of changes:
 source/utils/net_conf.c |   54 ++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 46 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/utils/net_conf.c b/source/utils/net_conf.c
index f212ed7..26ed41b 100644
--- a/source/utils/net_conf.c
+++ b/source/utils/net_conf.c
@@ -31,9 +31,11 @@
 #include "utils/net.h"
 #include "libnet/libnet.h"
 
-/*
+/**********************************************************************
+ *
  * usage functions
- */
+ *
+ **********************************************************************/
 
 static int net_conf_list_usage(int argc, const char **argv)
 {
@@ -109,10 +111,16 @@ static int net_conf_delparm_usage(int argc, const char **argv)
 }
 
 
-/*
+/**********************************************************************
+ *
  * Helper functions
- */
+ *
+ **********************************************************************/
 
+/**
+ * This formats an in-memory smbconf parameter to a string.
+ * The result string is allocated with talloc.
+ */
 static char *parm_valstr(TALLOC_CTX *ctx, struct parm_struct *parm,
 			 struct share_params *share)
 {
@@ -187,6 +195,10 @@ static char *parm_valstr(TALLOC_CTX *ctx, struct parm_struct *parm,
 	return valstr;
 }
 
+/**
+ * This functions imports a configuration that has previously
+ * been loaded with lp_load() to registry.
+ */
 static int import_process_service(TALLOC_CTX *ctx,
 				  struct libnet_conf_ctx *conf_ctx,
 				  struct share_params *share)
@@ -217,6 +229,10 @@ static int import_process_service(TALLOC_CTX *ctx,
 				goto done;
 			}
 		}
+		werr = libnet_conf_create_share(conf_ctx, servicename);
+		if (!W_ERROR_IS_OK(werr)) {
+			goto done;
+		}
 	}
 
 	while ((parm = lp_next_parameter(share->service, &pnum, 0)))
@@ -259,7 +275,10 @@ done:
 	return ret;
 }
 
-/* return true iff there are nondefault globals */
+/**
+ * Return true iff there are nondefault globals in the
+ * currently loaded configuration.
+ */
 static bool globals_exist(void)
 {
 	int i = 0;
@@ -273,9 +292,12 @@ static bool globals_exist(void)
 	return false;
 }
 
-/*
- * the conf functions
- */
+
+/**********************************************************************
+ *
+ * the main conf functions
+ *
+ **********************************************************************/
 
 static int net_conf_list(struct libnet_conf_ctx *conf_ctx,
 			 int argc, const char **argv)
@@ -848,6 +870,18 @@ done:
 	return ret;
 }
 
+
+/**********************************************************************
+ *
+ * Wrapper and net_conf_run_function mechanism.
+ *
+ **********************************************************************/
+
+/**
+ * Wrapper function to call the main conf functions.
+ * The wrapper calls handles opening and closing of the
+ * configuration.
+ */
 static int net_conf_wrap_function(int (*fn)(struct libnet_conf_ctx *,
 					    int, const char **),
 				  int argc, const char **argv)
@@ -881,6 +915,10 @@ struct conf_functable {
 	const char *helptext;
 };
 
+/**
+ * This imitates net_run_function2 but calls the main functions
+ * through the wrapper net_conf_wrap_function().
+ */
 static int net_conf_run_function(int argc, const char **argv,
 				 const char *whoami,
 				 struct conf_functable *table)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list