aboutsummaryrefslogtreecommitdiff
path: root/ident/ident.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 /ident/ident.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 'ident/ident.c')
-rw-r--r--ident/ident.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/ident/ident.c b/ident/ident.c
index dbf3f9b..75d51fa 100644
--- a/ident/ident.c
+++ b/ident/ident.c
@@ -1,8 +1,8 @@
/* This file is part of GNU Pies.
- Copyright (C) 2015 Sergey Poznyakoff
+ Copyright (C) 2015-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
the Free Software Foundation; either version 3, or (at your option)
any later version.
@@ -16,16 +16,26 @@
#include "ident.h"
pies_identity_t
pies_identity_create (char const *user)
{
- pies_identity_t id = xmalloc (sizeof (*id));
- id->provider = NULL;
- id->username = xstrdup (user);
- id->data = NULL;
+ pies_identity_t id = malloc (sizeof (*id));
+ if (id)
+ {
+ id->provider = NULL;
+ id->data = NULL;
+ id->username = strdup (user);
+ if (!id)
+ {
+ int ec = errno;
+ free (id);
+ errno = ec;
+ id = NULL;
+ }
+ }
return id;
}
int
pies_authenticate (pies_identity_provider_t pr, pies_identity_t id,
char const *passwd)

Return to:

Send suggestions and report system problems to the System administrator.