#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <stdarg.h>
#include <pwd.h>
#include <libutil.h>
#include <errno.h>
}
static int
-pwdb(char *arg,...)
+pwdb_check(void)
{
int i = 0;
pid_t pid;
- va_list ap;
char *args[10];
args[i++] = _PATH_PWD_MKDB;
- va_start(ap, arg);
- while (i < 6 && arg != NULL) {
- args[i++] = arg;
- arg = va_arg(ap, char *);
- }
+ args[i++] = "-C";
+
if (pwpath != pathpwd) {
args[i++] = "-d";
args[i++] = pwpath;
if (WEXITSTATUS(i))
i = EIO;
}
- va_end(ap);
return (i);
}
struct passwd *old_pw = NULL;
int rc, pfd, tfd;
- if ((rc = pwdb("-C", NULL)) != 0)
+ if ((rc = pwdb_check()) != 0)
return (rc);
if (pwd != NULL)