summaryrefslogtreecommitdiff
path: root/nslcd/common.c
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-11-29 02:20:13 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-11-29 02:20:13 -0500
commitdba5f85e8f1943863b4cbab1ab52913c62365ce1 (patch)
tree08c1745b2c12b5f20b7f907e008026d952707293 /nslcd/common.c
parent8acfce5c8916bb98768e3e351b7614b4eaf5954a (diff)
fix errors: the only erroring files left are db_pam.c and nslcd.c
Diffstat (limited to 'nslcd/common.c')
-rw-r--r--nslcd/common.c67
1 files changed, 0 insertions, 67 deletions
diff --git a/nslcd/common.c b/nslcd/common.c
index 421e8a5..3c82d71 100644
--- a/nslcd/common.c
+++ b/nslcd/common.c
@@ -185,73 +185,6 @@ int isvalidname(const char *name)
return regexec(&nslcd_cfg->validnames, name, 0, NULL, 0) == 0;
}
-/* this writes a single address to the stream */
-int write_address(TFILE *fp, MYLDAP_ENTRY *entry, const char *attr,
- const char *addr)
-{
- int32_t tmpint32;
- struct in_addr ipv4addr;
- struct in6_addr ipv6addr;
- /* try to parse the address as IPv4 first, fall back to IPv6 */
- if (inet_pton(AF_INET, addr, &ipv4addr) > 0)
- {
- /* write address type */
- WRITE_INT32(fp, AF_INET);
- /* write the address length */
- WRITE_INT32(fp, sizeof(struct in_addr));
- /* write the address itself (in network byte order) */
- WRITE(fp, &ipv4addr, sizeof(struct in_addr));
- }
- else if (inet_pton(AF_INET6, addr, &ipv6addr) > 0)
- {
- /* write address type */
- WRITE_INT32(fp, AF_INET6);
- /* write the address length */
- WRITE_INT32(fp, sizeof(struct in6_addr));
- /* write the address itself (in network byte order) */
- WRITE(fp, &ipv6addr, sizeof(struct in6_addr));
- }
- else
- {
- /* failure, log but write simple invalid address
- (otherwise the address list is messed up) */
- /* TODO: have error message in correct format */
- log_log(LOG_WARNING, "%s: %s: \"%s\" unparsable",
- myldap_get_dn(entry), attr, addr);
- /* write an illegal address type */
- WRITE_INT32(fp, -1);
- /* write an emtpy address */
- WRITE_INT32(fp, 0);
- }
- /* we're done */
- return 0;
-}
-
-int read_address(TFILE *fp, char *addr, int *addrlen, int *af)
-{
- int32_t tmpint32;
- int len;
- /* read address family */
- READ_INT32(fp, *af);
- if ((*af != AF_INET) && (*af != AF_INET6))
- {
- log_log(LOG_WARNING, "incorrect address family specified: %d", *af);
- return -1;
- }
- /* read address length */
- READ_INT32(fp, len);
- if ((len > *addrlen) || (len <= 0))
- {
- log_log(LOG_WARNING, "address length incorrect: %d", len);
- return -1;
- }
- *addrlen = len;
- /* read address */
- READ(fp, addr, len);
- /* we're done */
- return 0;
-}
-
/* convert the provided string representation of a sid
(e.g. S-1-5-21-1936905831-823966427-12391542-23578)
to a format that can be used to search the objectSid property with */