[SCM] Samba Shared Repository - branch master updated
Michael Adam
obnox at samba.org
Mon Sep 20 23:41:25 MDT 2010
The branch, master has been updated
via d86d225 s3:services_db: convert get_common_service_dispname() to talloc
via 919450a s3:registry: regfio fix the build
from 58cfbc5 rpc_talloc: Update test now that we create fewer references.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit d86d2256b98e8975d536b85ba5221508642dea22
Author: Michael Adam <obnox at samba.org>
Date: Tue Sep 21 07:40:36 2010 +0200
s3:services_db: convert get_common_service_dispname() to talloc
commit 919450a60ed996c35a1443a18d057031d56649c7
Author: Michael Adam <obnox at samba.org>
Date: Tue Sep 21 07:40:13 2010 +0200
s3:registry: regfio fix the build
-----------------------------------------------------------------------
Summary of changes:
source3/include/regfio.h | 1 +
source3/services/services_db.c | 16 ++++++++--------
2 files changed, 9 insertions(+), 8 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/include/regfio.h b/source3/include/regfio.h
index f2d952b..3c2b656 100644
--- a/source3/include/regfio.h
+++ b/source3/include/regfio.h
@@ -24,6 +24,7 @@
***********************************************************/
#include "registry/reg_parse_prs.h"
+#include "registry/reg_objects.h"
#ifndef _REGFIO_H
#define _REGFIO_H
diff --git a/source3/services/services_db.c b/source3/services/services_db.c
index 6d361c7..7de613e 100644
--- a/source3/services/services_db.c
+++ b/source3/services/services_db.c
@@ -134,24 +134,25 @@ static struct security_descriptor* construct_service_sd( TALLOC_CTX *ctx )
Display name, Description, etc...
********************************************************************/
-static char *get_common_service_dispname( const char *servicename )
+static char *get_common_service_dispname(TALLOC_CTX *mem_ctx,
+ const char *servicename)
{
int i;
for ( i=0; common_unix_svcs[i].servicename; i++ ) {
if (strequal(servicename, common_unix_svcs[i].servicename)) {
char *dispname;
- if (asprintf(&dispname,
- "%s (%s)",
- common_unix_svcs[i].dispname,
- common_unix_svcs[i].servicename) < 0) {
+ dispname = talloc_asprintf(mem_ctx, "%s (%s)",
+ common_unix_svcs[i].dispname,
+ common_unix_svcs[i].servicename);
+ if (dispname == NULL) {
return NULL;
}
return dispname;
}
}
- return SMB_STRDUP(servicename );
+ return talloc_strdup(mem_ctx, servicename);
}
/********************************************************************
@@ -376,9 +377,8 @@ static void fill_service_values(struct registry_key *key)
name);
/* lookup common unix display names */
- dispname = get_common_service_dispname(name);
+ dispname = get_common_service_dispname(mem_ctx, name);
dname = talloc_strdup(mem_ctx, dispname ? dispname : "");
- SAFE_FREE(dispname);
/* get info from init file itself */
if ( read_init_file( name, &init_info ) ) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list