Author: jelmer
Date: 2007-11-26 02:31:53 +0000 (Mon, 26 Nov 2007)
New Revision: 26128

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26128

Log:
Some formatting fixes in secrets.c, fix free of filename, update ignores for 
source/..
Modified:
   branches/SAMBA_4_0/source/
   branches/SAMBA_4_0/source/param/secrets.c


Changeset:

Property changes on: branches/SAMBA_4_0/source
___________________________________________________________________
Name: svn:ignore
   - .sconsign
st
ID
*.d
Makefile
dox
typescript*
configure
TAGS
tags
*.*
extra_cflags.txt

   + _trial_temp
.sconsign
st
ID
*.d
Makefile
dox
typescript*
configure
TAGS
tags
*.*
extra_cflags.txt


Modified: branches/SAMBA_4_0/source/param/secrets.c
===================================================================
--- branches/SAMBA_4_0/source/param/secrets.c   2007-11-26 02:25:20 UTC (rev 
26127)
+++ branches/SAMBA_4_0/source/param/secrets.c   2007-11-26 02:31:53 UTC (rev 
26128)
@@ -46,37 +46,42 @@
 static void get_rand_seed(int *new_seed) 
 {
        *new_seed = getpid();
-       if (tdb) {
+       if (tdb != NULL) {
                tdb_change_int32_atomic(tdb->tdb, "INFO/random_seed", new_seed, 
1);
        }
 }
 
-/* close the secrets database */
+/**
+ * close the secrets database
+ */
 void secrets_shutdown(void)
 {
        talloc_free(tdb);
 }
 
-/* open up the secrets database */
+/**
+ * open up the secrets database
+ */
 bool secrets_init(void)
 {
        char *fname;
        uint8_t dummy;
 
-       if (tdb)
+       if (tdb != NULL)
                return true;
 
-       fname = private_path(talloc_autofree_context(), global_loadparm,
+       fname = private_path(NULL, global_loadparm,
                                                 "secrets.tdb");
 
-       tdb = tdb_wrap_open(talloc_autofree_context(), fname, 0, TDB_DEFAULT, 
O_RDWR|O_CREAT, 0600);
+       tdb = tdb_wrap_open(talloc_autofree_context(), fname, 0, TDB_DEFAULT, 
+                                               O_RDWR|O_CREAT, 0600);
 
        if (!tdb) {
                DEBUG(0,("Failed to open %s\n", fname));
-               SAFE_FREE(fname);
+               talloc_free(fname);
                return false;
        }
-       SAFE_FREE(fname);
+       talloc_free(fname);
 
        /**
         * Set a reseed function for the crypto random generator 
@@ -92,8 +97,8 @@
        return true;
 }
 
-/*
-  connect to the schannel ldb
+/**
+  connect to the secrets ldb
 */
 struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx)
 {
@@ -133,6 +138,10 @@
        return ldb;
 }
 
+/**
+ * Retrieve the domain SID from the secrets database.
+ * @return pointer to a SID object if the SID could be obtained, NULL otherwise
+ */
 struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx,
                                       const char *domain)
 {

Reply via email to