Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
#include <nss.h>
#include <shadow.h>
#include <errno.h>
#include <syslog.h>
#define COMMON_LOG(prio, msg, ...) (syslog(LOG_AUTH|prio, msg, ## __VA_ARGS__ ))
#include "get_shadow_line.c"
#include "common.h"
enum nss_status _nss_mxshadow_getspnam_r(const char *name, struct spwd *spwd, char *buffer, size_t buflen, int *errnop) {
char *line _cleanup_(free_string) = NULL;
int status = get_shadow_line((char *)name, &line);
if (status == -1) {
*errnop = errno;
return NSS_STATUS_UNAVAIL;
}
if (line[0] == '\0') {
errno = ENOENT;
*errnop = errno;
return NSS_STATUS_NOTFOUND;
}
struct spwd *spbufp;
status = sgetspent_r(line, spwd, buffer, buflen, &spbufp);
if (status == -1) {
*errnop = errno;
return NSS_STATUS_UNAVAIL;
}
return NSS_STATUS_SUCCESS;
}