aboutsummaryrefslogtreecommitdiff
path: root/src/acl.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-01-08 15:31:17 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2016-01-08 16:17:35 +0200
commit489432d354d88049afe4af54c29965d382d67f7a (patch)
tree84725496a92564824f75f0a2edd5a595411ffab2 /src/acl.c
parent3325fed2895f079486b88c65409c73153fec306f (diff)
downloadpies-489432d354d88049afe4af54c29965d382d67f7a.tar.gz
pies-489432d354d88049afe4af54c29965d382d67f7a.tar.bz2
Uniformly use grecs memory management functions.
* gnulib.modules: Remove unneded modules. * ident/ident.h: Remove xalloc.h, include errno.h * ident/ident.c: Use standard allocation functions instead of x* * ident/pam.c: Remove. * ident/provider.c: Remove. * ident/system.c: Remove. * src/meta.c: Remove. * src/Makefile.am: Remove meta.c * src/progman.c: Use grecs_* allocation functions instead of x*. (notify): Use wordsplit to expand variables within message. Rename variables: program-name to program_name; canonical-program-name to canonical_program_name. * doc/pies.texi: Update. * src/depmap.c: Use grecs_* allocation functions instead of x*. (depmap_end): New function. * src/diag.c (logmsg_vprintf): Use grecs_txtacc instead of obstack. * src/pies.h (depmap_end): New proto. Remove unused includes. * src/acl.c: Use grecs_* allocation functions instead of x*. * src/ctl.c: Likewise. * src/inetd.c: Likewise. * src/limits.c: Likewise. * src/meta1gram.y: Likewise. * src/meta1lex.l: Likewise. * src/pies.c: Likewise. * src/socket.c: Likewise. * src/sysvinit.c: Likewise. * src/userprivs.c: Likewise.
Diffstat (limited to 'src/acl.c')
-rw-r--r--src/acl.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/acl.c b/src/acl.c
index 94dd561..412f3ac 100644
--- a/src/acl.c
+++ b/src/acl.c
@@ -1,5 +1,5 @@
/* This file is part of GNU Pies
- Copyright (C) 2009-2013 Sergey Poznyakoff
+ Copyright (C) 2009-2016 Sergey Poznyakoff
GNU Pies is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -111,8 +111,8 @@ acl_free_entry (void *p)
pies_acl_t
pies_acl_create (const char *name, grecs_locus_t *locus)
{
- pies_acl_t acl = xmalloc (sizeof (acl[0]));
- acl->name = name ? xstrdup (name) : NULL;
+ pies_acl_t acl = grecs_malloc (sizeof (acl[0]));
+ acl->name = name ? grecs_strdup (name) : NULL;
grecs_locus_copy (&acl->locus, locus);
acl->list = grecs_list_create ();
acl->list->free_entry = acl_free_entry;
@@ -131,7 +131,7 @@ pies_acl_free (pies_acl_t acl)
static struct pies_sockaddr *
create_acl_sockaddr (int family, int len)
{
- struct pies_sockaddr *p = xzalloc (sizeof (*p));
+ struct pies_sockaddr *p = grecs_zalloc (sizeof (*p));
p->salen = len;
p->sa.sa_family = family;
return p;
@@ -369,18 +369,18 @@ _parse_group (struct acl_entry *entry, size_t argc, grecs_value_t **argv)
}
if (argv[0]->type == GRECS_TYPE_STRING)
{
- entry->names = xcalloc (2, sizeof (entry->names[0]));
- entry->names[0] = xstrdup (argv[0]->v.string);
+ entry->names = grecs_calloc (2, sizeof (entry->names[0]));
+ entry->names[0] = grecs_strdup (argv[0]->v.string);
entry->names[1] = NULL;
}
else
{
size_t i;
struct grecs_list_entry *ep;
- entry->names = xcalloc (argv[0]->v.list->count + 1,
- sizeof (entry->names[0]));
+ entry->names = grecs_calloc (argv[0]->v.list->count + 1,
+ sizeof (entry->names[0]));
for (i = 0, ep = argv[0]->v.list->head; ep; ep = ep->next, ++i)
- entry->names[i] = xstrdup (ep->data);
+ entry->names[i] = grecs_strdup (ep->data);
entry->names[i] = NULL;
}
argc--;
@@ -404,7 +404,7 @@ int
parse_acl_line (grecs_locus_t *locus, int allow, pies_acl_t acl,
grecs_value_t *value)
{
- struct acl_entry *entry = xzalloc (sizeof (*entry));
+ struct acl_entry *entry = grecs_zalloc (sizeof (*entry));
grecs_locus_copy (&entry->locus, locus);
entry->allow = allow;
@@ -742,7 +742,7 @@ pies_acl_install (pies_acl_t acl)
NULL,
acl_free);
if (!acl_table)
- xalloc_die ();
+ grecs_alloc_die ();
}
ret = grecs_symtab_lookup_or_install (acl_table, acl, &install);

Return to:

Send suggestions and report system problems to the System administrator.