summaryrefslogtreecommitdiff
path: root/source4/lib/registry/tools/common.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2007-10-10 12:27:24 +0200
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:42:48 +0100
commit33032276f532f5344d56ca6c436befb2e3b74fc5 (patch)
treef139ab9101d45af122ccd2b667b5402284ba74f1 /source4/lib/registry/tools/common.c
parenta3e5710eda2e9fc7ee9dce1e9082dbf03f96faeb (diff)
downloadsamba-33032276f532f5344d56ca6c436befb2e3b74fc5.tar.gz
samba-33032276f532f5344d56ca6c436befb2e3b74fc5.tar.bz2
samba-33032276f532f5344d56ca6c436befb2e3b74fc5.zip
r25603: More reformat.
Guenther (This used to be commit 176614423ea57e853211c43b9853203243c6a978)
Diffstat (limited to 'source4/lib/registry/tools/common.c')
-rw-r--r--source4/lib/registry/tools/common.c28
1 files changed, 17 insertions, 11 deletions
diff --git a/source4/lib/registry/tools/common.c b/source4/lib/registry/tools/common.c
index aa11eccbee..0233f27437 100644
--- a/source4/lib/registry/tools/common.c
+++ b/source4/lib/registry/tools/common.c
@@ -1,4 +1,4 @@
-/*
+/*
Unix SMB/CIFS implementation.
Popt routines specifically for registry
@@ -8,12 +8,12 @@
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/>.
*/
@@ -23,22 +23,25 @@
#include "lib/registry/registry.h"
#include "lib/registry/tools/common.h"
-struct registry_context *reg_common_open_remote(const char *remote, struct cli_credentials *creds)
+struct registry_context *reg_common_open_remote(const char *remote,
+ struct cli_credentials *creds)
{
struct registry_context *h;
WERROR error;
-
+
error = reg_open_remote(&h, NULL, creds, remote, NULL);
if (!W_ERROR_IS_OK(error)) {
- fprintf(stderr, "Unable to open remote registry at %s:%s \n", remote, win_errstr(error));
+ fprintf(stderr, "Unable to open remote registry at %s:%s \n",
+ remote, win_errstr(error));
return NULL;
}
return h;
}
-struct registry_key *reg_common_open_file(const char *path, struct cli_credentials *creds)
+struct registry_key *reg_common_open_file(const char *path,
+ struct cli_credentials *creds)
{
struct hive_key *hive_root;
struct registry_context *h;
@@ -47,13 +50,15 @@ struct registry_key *reg_common_open_file(const char *path, struct cli_credentia
error = reg_open_hive(NULL, path, NULL, creds, &hive_root);
if(!W_ERROR_IS_OK(error)) {
- fprintf(stderr, "Unable to open '%s': %s \n", path, win_errstr(error));
+ fprintf(stderr, "Unable to open '%s': %s \n",
+ path, win_errstr(error));
return NULL;
}
error = reg_open_local(NULL, &h, NULL, creds);
if (!W_ERROR_IS_OK(error)) {
- fprintf(stderr, "Unable to initialize local registry: %s\n", win_errstr(error));
+ fprintf(stderr, "Unable to initialize local registry: %s\n",
+ win_errstr(error));
return NULL;
}
@@ -64,11 +69,12 @@ struct registry_context *reg_common_open_local(struct cli_credentials *creds)
{
WERROR error;
struct registry_context *h;
-
+
error = reg_open_samba(NULL, &h, NULL, creds);
if(!W_ERROR_IS_OK(error)) {
- fprintf(stderr, "Unable to open local registry:%s \n", win_errstr(error));
+ fprintf(stderr, "Unable to open local registry:%s \n",
+ win_errstr(error));
return NULL;
}