Remove dead code.
This commit is contained in:
parent
b28518a59a
commit
5d75780525
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236963
@ -64,10 +64,6 @@ int yp_errno = YP_TRUE;
|
|||||||
extern int yp_passwd( char * );
|
extern int yp_passwd( char * );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef KERBEROS
|
|
||||||
#include "krb.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
|
|
||||||
static void usage(void);
|
static void usage(void);
|
||||||
@ -81,26 +77,12 @@ main(argc, argv)
|
|||||||
{
|
{
|
||||||
int ch;
|
int ch;
|
||||||
char *uname;
|
char *uname;
|
||||||
#ifdef KERBEROS
|
|
||||||
char *iflag = 0, *rflag = 0, *uflag = 0;
|
|
||||||
char *k;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef YP
|
#ifdef YP
|
||||||
#ifdef KERBEROS
|
|
||||||
char realm[REALM_SZ];
|
|
||||||
#define OPTIONS "d:h:lysfoi:r:u:"
|
|
||||||
#else
|
|
||||||
#define OPTIONS "d:h:lysfo"
|
#define OPTIONS "d:h:lysfo"
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
#ifdef KERBEROS
|
|
||||||
char realm[REALM_SZ];
|
|
||||||
#define OPTIONS "li:r:u:"
|
|
||||||
#else
|
#else
|
||||||
#define OPTIONS "l"
|
#define OPTIONS "l"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef YP
|
#ifdef YP
|
||||||
int res = 0;
|
int res = 0;
|
||||||
@ -113,17 +95,6 @@ main(argc, argv)
|
|||||||
case 'l': /* change local password file */
|
case 'l': /* change local password file */
|
||||||
use_local_passwd = 1;
|
use_local_passwd = 1;
|
||||||
break;
|
break;
|
||||||
#ifdef KERBEROS
|
|
||||||
case 'i':
|
|
||||||
iflag = optarg;
|
|
||||||
break;
|
|
||||||
case 'r':
|
|
||||||
rflag = optarg;
|
|
||||||
break;
|
|
||||||
case 'u':
|
|
||||||
uflag = optarg;
|
|
||||||
break;
|
|
||||||
#endif /* KERBEROS */
|
|
||||||
#ifdef YP
|
#ifdef YP
|
||||||
case 'y': /* Change NIS password */
|
case 'y': /* Change NIS password */
|
||||||
__use_yp = 1;
|
__use_yp = 1;
|
||||||
@ -182,9 +153,6 @@ main(argc, argv)
|
|||||||
/*
|
/*
|
||||||
* If NIS is turned on in the password database, use it, else punt.
|
* If NIS is turned on in the password database, use it, else punt.
|
||||||
*/
|
*/
|
||||||
#ifdef KERBEROS
|
|
||||||
if (__use_yp || (iflag == NULL && rflag == NULL && uflag == NULL)) {
|
|
||||||
#endif
|
|
||||||
res = use_yp(uname, 0, 0);
|
res = use_yp(uname, 0, 0);
|
||||||
if (res == USER_YP_ONLY) {
|
if (res == USER_YP_ONLY) {
|
||||||
if (!use_local_passwd) {
|
if (!use_local_passwd) {
|
||||||
@ -206,22 +174,8 @@ main(argc, argv)
|
|||||||
if (!use_local_passwd && (yp_in_pw_file || __use_yp))
|
if (!use_local_passwd && (yp_in_pw_file || __use_yp))
|
||||||
exit(yp_passwd(uname));
|
exit(yp_passwd(uname));
|
||||||
}
|
}
|
||||||
#ifdef KERBEROS
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!use_local_passwd) {
|
|
||||||
#ifdef KERBEROS
|
|
||||||
k = auth_getval("auth_list");
|
|
||||||
if (k && strstr(k, "kerberos"))
|
|
||||||
if(krb_get_lrealm(realm, 0) == KSUCCESS) {
|
|
||||||
setuid(getuid());
|
|
||||||
fprintf(stderr, "realm %s\n", realm);
|
|
||||||
exit(krb_passwd(argv[0], iflag, rflag, uflag));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
exit(local_passwd(uname));
|
exit(local_passwd(uname));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,21 +184,10 @@ usage()
|
|||||||
{
|
{
|
||||||
|
|
||||||
#ifdef YP
|
#ifdef YP
|
||||||
#ifdef KERBEROS
|
|
||||||
fprintf(stderr, "%s\n%s\n",
|
|
||||||
"usage: passwd [-l] [-i instance] [-r realm] [-u fullname]",
|
|
||||||
" passwd [-l] [-y] [-o] [-d domain [-h host]] [user]");
|
|
||||||
#else
|
|
||||||
(void)fprintf(stderr,
|
(void)fprintf(stderr,
|
||||||
"usage: passwd [-l] [-y] [-o] [-d domain [-h host]] [user]\n");
|
"usage: passwd [-l] [-y] [-o] [-d domain [-h host]] [user]\n");
|
||||||
#endif
|
|
||||||
#else
|
#else
|
||||||
#ifdef KERBEROS
|
(void)fprintf(stderr, "usage: passwd [-l] user\n");
|
||||||
fprintf(stderr,
|
|
||||||
"usage: passwd [-l] [-i instance] [-r realm] [-u fullname] [user]\n");
|
|
||||||
#else
|
|
||||||
(void)fprintf(stderr, "usage: passwd user\n");
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user