projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use hyphen, not plus (corresponding to previous RCx naming convention)
[mmh]
/
sbr
/
ruserpass.c
diff --git
a/sbr/ruserpass.c
b/sbr/ruserpass.c
index
68809df
..
36605be
100644
(file)
--- a/
sbr/ruserpass.c
+++ b/
sbr/ruserpass.c
@@
-1,4
+1,5
@@
/*
/*
+ * Portions of this code are
* Copyright (c) 1985 Regents of the University of California.
* All rights reserved.
*
* Copyright (c) 1985 Regents of the University of California.
* All rights reserved.
*
@@
-18,6
+19,7
@@
*/
#include <h/mh.h>
*/
#include <h/mh.h>
+#include <h/utils.h>
#include <pwd.h>
#include <errno.h>
#include <pwd.h>
#include <errno.h>
@@
-65,7
+67,6
@@
ruserpass(char *host, char **aname, char **apass)
char *hdir, buf[BUFSIZ];
int t, usedefault = 0;
struct stat stb;
char *hdir, buf[BUFSIZ];
int t, usedefault = 0;
struct stat stb;
- extern int errno;
hdir = getenv("HOME");
if (hdir == NULL)
hdir = getenv("HOME");
if (hdir == NULL)
@@
-91,7
+92,7
@@
ruserpass(char *host, char **aname, char **apass)
/*
* Allow match either for user's host name.
*/
/*
* Allow match either for user's host name.
*/
- if (strcasecmp(host, tokval) == 0)
+ if (mh_strcasecmp(host, tokval) == 0)
goto match;
continue;
}
goto match;
continue;
}
@@
-100,7
+101,7
@@
match:
switch(t) {
case LOGIN:
if (token() && *aname == 0) {
switch(t) {
case LOGIN:
if (token() && *aname == 0) {
- *aname = malloc((size_t) strlen(tokval) + 1);
+ *aname = mh_xmalloc((size_t) strlen(tokval) + 1);
strcpy(*aname, tokval);
}
break;
strcpy(*aname, tokval);
}
break;
@@
-112,7
+113,7
@@
match:
goto bad;
}
if (token() && *apass == 0) {
goto bad;
}
if (token() && *apass == 0) {
- *apass = malloc((size_t) strlen(tokval) + 1);
+ *apass = mh_xmalloc((size_t) strlen(tokval) + 1);
strcpy(*apass, tokval);
}
break;
strcpy(*apass, tokval);
}
break;
@@
-153,7
+154,7
@@
done:
myname = tmp;
}
myname = tmp;
}
- *aname = malloc((size_t) strlen(myname) + 1);
+ *aname = mh_xmalloc((size_t) strlen(myname) + 1);
strcpy (*aname, myname);
}
strcpy (*aname, myname);
}
@@
-162,13
+163,13
@@
done:
char *mypass;
snprintf(prompt, sizeof(prompt), "Password (%s:%s): ", host, *aname);
char *mypass;
snprintf(prompt, sizeof(prompt), "Password (%s:%s): ", host, *aname);
- mypass = getpass (prompt);
+ mypass = nmh_getpass(prompt);
if (*mypass == '\0') {
mypass = *aname;
}
if (*mypass == '\0') {
mypass = *aname;
}
- *apass = malloc((size_t) strlen(mypass) + 1);
+ *apass = mh_xmalloc((size_t) strlen(mypass) + 1);
strcpy (*apass, mypass);
}
strcpy (*apass, mypass);
}