pidentd  3.0.19
About: implementation of the RFC1413 identification server (more or less complete rewrite compared to version 2)
  Fossies Dox: pidentd-3.0.19.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)  

support.c File Reference
#include "config.h"
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <syslog.h>
#include <pwd.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include "pidentd.h"
Include dependency graph for support.c:

Go to the source code of this file.

Functions

char * osinfo_get (char *buf)
 
int socktype (int fd)
 
char * s_strtok_r (char *s, const char *d, char **bp)
 
static void pwd_lock_init (void)
 
static char * strcopy (const char *str, char **buf, size_t *avail)
 
int s_getpwnam_r (const char *name, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result)
 
int s_getpwuid_r (uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result)
 
int s_strcasecmp (const char *s1, const char *s2)
 
void s_openlog (const char *ident, int logopt, int facility)
 
int syslog_str2fac (const char *name)
 
const char * s_inet_ntox (struct sockaddr_in *ia, char *buf, size_t bufsize)
 

Variables

static int pwd_lock
 
static int pwd_once = 0
 

Function Documentation

◆ osinfo_get()

char* osinfo_get ( char *  buf)

Definition at line 39 of file support.c.

Referenced by ka_init(), and main().

◆ pwd_lock_init()

static void pwd_lock_init ( void  )
static

Definition at line 145 of file support.c.

References pthread_mutex_init(), and pwd_lock.

Referenced by s_getpwnam_r(), and s_getpwuid_r().

◆ s_getpwnam_r()

int s_getpwnam_r ( const char *  name,
struct passwd *  pwd,
char *  buffer,
size_t  bufsize,
struct passwd **  result 
)

◆ s_getpwuid_r()

int s_getpwuid_r ( uid_t  uid,
struct passwd *  pwd,
char *  buffer,
size_t  bufsize,
struct passwd **  result 
)

◆ s_inet_ntox()

const char* s_inet_ntox ( struct sockaddr_in *  ia,
char *  buf,
size_t  bufsize 
)

Definition at line 468 of file support.c.

References s_snprintf(), SGADDRP, and SGFAM.

Referenced by kernel_thread(), send_error(), send_result(), and send_version().

◆ s_openlog()

void s_openlog ( const char *  ident,
int  logopt,
int  facility 
)

Definition at line 348 of file support.c.

Referenced by conf_parse(), and main().

◆ s_strcasecmp()

int s_strcasecmp ( const char *  s1,
const char *  s2 
)

Definition at line 332 of file support.c.

◆ s_strtok_r()

char* s_strtok_r ( char *  s,
const char *  d,
char **  bp 
)

Definition at line 106 of file support.c.

Referenced by conf_parse(), and handle_request().

◆ socktype()

int socktype ( int  fd)

Definition at line 64 of file support.c.

References errno, SOCKTYPE_CONNECTED, SOCKTYPE_LISTEN, and SOCKTYPE_NOTSOCKET.

Referenced by main().

◆ strcopy()

static char* strcopy ( const char *  str,
char **  buf,
size_t *  avail 
)
static

Definition at line 151 of file support.c.

Referenced by s_getpwnam_r(), and s_getpwuid_r().

◆ syslog_str2fac()

int syslog_str2fac ( const char *  name)

Definition at line 411 of file support.c.

Referenced by conf_parse(), and main().

Variable Documentation

◆ pwd_lock

int pwd_lock
static

Definition at line 141 of file support.c.

Referenced by pwd_lock_init(), s_getpwnam_r(), and s_getpwuid_r().

◆ pwd_once

int pwd_once = 0
static

Definition at line 142 of file support.c.

Referenced by s_getpwnam_r(), and s_getpwuid_r().