summaryrefslogtreecommitdiffstats
path: root/worker/ipaaction.c
diff options
context:
space:
mode:
authorSumit Bose <sbose@nb.localdomain>2008-11-20 22:37:14 +0100
committerSumit Bose <sbose@nb.localdomain>2008-11-20 22:37:14 +0100
commit1be6a957fa90294f982f9e8531a05c86c49028fb (patch)
treecc285beaa02b2e7e75fb2d7173bbacf96611ed9c /worker/ipaaction.c
parent89b70bfd78bb02c8141c4db58db01c7b1af5331c (diff)
downloadipa_policy-1be6a957fa90294f982f9e8531a05c86c49028fb.tar.gz
ipa_policy-1be6a957fa90294f982f9e8531a05c86c49028fb.tar.xz
ipa_policy-1be6a957fa90294f982f9e8531a05c86c49028fb.zip
removed default_namespace from most parameter lists
Diffstat (limited to 'worker/ipaaction.c')
-rw-r--r--worker/ipaaction.c46
1 files changed, 16 insertions, 30 deletions
diff --git a/worker/ipaaction.c b/worker/ipaaction.c
index 7bf7422..de01d94 100644
--- a/worker/ipaaction.c
+++ b/worker/ipaaction.c
@@ -39,9 +39,9 @@
#define XPATH_IPAACTION_RUN_USER (xmlChar *) "//def:ipa/def:ipaaction/def:run/def:user"
#define XPATH_IPAACTION_RUN_GROUP (xmlChar *) "//def:ipa/def:ipaaction/def:run/def:group"
-char *find_value(const xmlDocPtr doc, const xmlChar *xpath_expr, const char *default_value, const xmlChar *prefix, const xmlChar *namespace) {
+char *find_value(const xmlDocPtr doc, const xmlChar *xpath_expr, const char *default_value) {
char *val;
- val = find_by_xpath(doc, xpath_expr, FIND_VALUE, prefix, namespace);
+ val = find_by_xpath(doc, xpath_expr, FIND_VALUE);
if (val==NULL) {
DEBUG(3, ("No value found with XPath %s.\n", xpath_expr));
if (default_value!=NULL) {
@@ -60,17 +60,14 @@ int check_ipaaction_condition(const xmlDocPtr doc, const xmlChar *default_namesp
char *group;
char *arguments;
- condition = find_value(doc, XPATH_IPAACTION_CONDITION_COMMAND, NULL,
- default_namespace_prefix, default_namespace);
+ condition = find_value(doc, XPATH_IPAACTION_CONDITION_COMMAND, NULL);
CHECK(condition, NULL, ("No condition found for current ipaaction.\n"), return 0);
DEBUG(3, ("Found condition for current ipaaction: |%s|\n", condition));
- user = find_value(doc, XPATH_IPAACTION_CONDITION_USER, "nobody",
- default_namespace_prefix, default_namespace);
+ user = find_value(doc, XPATH_IPAACTION_CONDITION_USER, "nobody");
DEBUG(3, ("Found user for condition: %s\n", user));
- group = find_value(doc, XPATH_IPAACTION_CONDITION_GROUP, "nobody",
- default_namespace_prefix, default_namespace);
+ group = find_value(doc, XPATH_IPAACTION_CONDITION_GROUP, "nobody");
DEBUG(3, ("Found group for condition: %s\n", group));
arguments=strchr(condition,' ');
@@ -106,11 +103,9 @@ int ipaaction_file(const xmlDocPtr doc, const xmlChar *default_namespace) {
int ret;
struct stat stat_buffer;
- url = find_value(doc, XPATH_IPAACTION_FILE_URL, NULL,
- default_namespace_prefix, default_namespace);
+ url = find_value(doc, XPATH_IPAACTION_FILE_URL, NULL);
DEBUG(3, ("Found the following ipaaction file url: |%s|\n", url));
- data = find_value(doc, XPATH_IPAACTION_FILE_DATA, NULL,
- default_namespace_prefix, default_namespace);
+ data = find_value(doc, XPATH_IPAACTION_FILE_DATA, NULL);
DEBUG(3, ("Found the following ipaaction file data: |%s|\n", data));
if (url==NULL && data==NULL) {
DEBUG(0,("Found no url or data element for ipaaction file. This should never happen.\n"));
@@ -121,31 +116,25 @@ int ipaaction_file(const xmlDocPtr doc, const xmlChar *default_namespace) {
return -1;
}
- path = find_value(doc, XPATH_IPAACTION_FILE_PATH, NULL,
- default_namespace_prefix, default_namespace);
+ path = find_value(doc, XPATH_IPAACTION_FILE_PATH, NULL);
CHECK(path, NULL, ("Path for ipaaction file not found.\n"), return -1);
DEBUG(3, ("Found path for ipaaction file: %s\n", path));
ret=stat(path, &stat_buffer);
CHECK(ret, 0, ("Destination file %s alread exists.\n", path), return -1);
- owner = find_value(doc, XPATH_IPAACTION_FILE_OWNER, "root",
- default_namespace_prefix, default_namespace);
+ owner = find_value(doc, XPATH_IPAACTION_FILE_OWNER, "root");
DEBUG(3, ("Found owner for ipaaction file: %s\n", owner));
- group = find_value(doc, XPATH_IPAACTION_FILE_GROUP, "root",
- default_namespace_prefix, default_namespace);
+ group = find_value(doc, XPATH_IPAACTION_FILE_GROUP, "root");
DEBUG(3, ("Found group for ipaaction file: %s\n", group));
- access = find_value(doc, XPATH_IPAACTION_FILE_ACCESS, "0400",
- default_namespace_prefix, default_namespace);
+ access = find_value(doc, XPATH_IPAACTION_FILE_ACCESS, "0400");
DEBUG(3, ("Found access permissions for ipaaction file: %s\n", access));
- selinux_context = find_value(doc, XPATH_IPAACTION_FILE_SELINUX_CONTEXT, NULL,
- default_namespace_prefix, default_namespace);
+ selinux_context = find_value(doc, XPATH_IPAACTION_FILE_SELINUX_CONTEXT, NULL);
DEBUG(3, ("Found SELinux file context for ipaaction file: %s\n", selinux_context));
- cleanup = find_value(doc, XPATH_IPAACTION_FILE_CLEANUP, "no",
- default_namespace_prefix, default_namespace);
+ cleanup = find_value(doc, XPATH_IPAACTION_FILE_CLEANUP, "no");
DEBUG(3, ("Found cleanup information for ipaaction file: %s\n", cleanup));
@@ -186,19 +175,16 @@ int ipaaction_run(const xmlDocPtr doc, const xmlChar *default_namespace) {
char *group;
char *arguments;
- command = find_value(doc, XPATH_IPAACTION_RUN_COMMAND, NULL,
- default_namespace_prefix, default_namespace);
+ command = find_value(doc, XPATH_IPAACTION_RUN_COMMAND, NULL);
CHECK(command, NULL,
("No command in ipaaction run section found, this should neven happen.\n"),
return -1);
DEBUG(3, ("Found command for current ipaaction: |%s|\n", command));
- user = find_value(doc, XPATH_IPAACTION_RUN_USER, "nobody",
- default_namespace_prefix, default_namespace);
+ user = find_value(doc, XPATH_IPAACTION_RUN_USER, "nobody");
DEBUG(3, ("Found user for ipaaction run command: %s\n", user));
- group = find_value(doc, XPATH_IPAACTION_RUN_GROUP, "nobody",
- default_namespace_prefix, default_namespace);
+ group = find_value(doc, XPATH_IPAACTION_RUN_GROUP, "nobody");
DEBUG(3, ("Found group for ipaaction run command: %s\n", group));
arguments=strchr(command,' ');