extern char *tempname;
static pid_t editpid = -1;
static int lockfd;
-char *mppath = _PATH_PWD;
-char *masterpasswd = _PATH_MASTERPASSWD;
+static char _default_editor[] = _PATH_VI;
+char mppath[] = _PATH_PWD;
+char masterpasswd[] = _PATH_MASTERPASSWD;
+
+void pw_cont(int);
void
-pw_cont(sig)
- int sig;
+pw_cont(int sig)
{
if (editpid != -1)
}
void
-pw_init()
+pw_init(void)
{
struct rlimit rlim;
}
int
-pw_lock()
+pw_lock(void)
{
/*
* If the master password file doesn't exist, the system is hosed.
}
int
-pw_tmp()
+pw_tmp(void)
{
static char path[MAXPATHLEN];
int fd;
}
int
-pw_mkdb(username)
-char *username;
+pw_mkdb(const char *username)
{
int pstat;
pid_t pid;
if(!username) {
warnx("rebuilding the database...");
execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-d", mppath,
- tempname, NULL);
+ tempname, (char *)NULL);
} else {
warnx("updating the database...");
execl(_PATH_PWD_MKDB, "pwd_mkdb", "-p", "-d", mppath,
- "-u", username, tempname, NULL);
+ "-u", username, tempname, (char *)NULL);
}
pw_error(_PATH_PWD_MKDB, 1, 1);
}
}
void
-pw_edit(notsetuid)
- int notsetuid;
+pw_edit(int notsetuid)
{
int pstat;
char *p, *editor;
if (!(editor = getenv("EDITOR")))
- editor = _PATH_VI;
+ editor = _default_editor;
if ((p = strrchr(editor, '/')))
++p;
else
(void)setuid(getuid());
}
errno = 0;
- execlp(editor, p, tempname, NULL);
+ execlp(editor, p, tempname, (char *)NULL);
_exit(errno);
}
for (;;) {
}
void
-pw_prompt()
+pw_prompt(void)
{
int c, first;
}
void
-pw_error(name, err, eval)
- char *name;
- int err, eval;
+pw_error(const char *name, int error, int eval)
{
#ifdef YP
extern int _use_yp;
#endif /* YP */
- if (err)
- warn("%s", name);
+ if (error) {
+ if (name != NULL)
+ warn("%s", name);
+ else
+ warn(NULL);
+ }
#ifdef YP
if (_use_yp)
warnx("NIS information unchanged");