Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
6b94bc7e
Commit
6b94bc7e
authored
25 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
use getpass() instead of mygetpass().
getpass() is implemented in -llutil (if needed).
parent
5b218b76
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
clients/ud/auth.c
+1
-1
1 addition, 1 deletion
clients/ud/auth.c
clients/ud/ud.h
+0
-1
0 additions, 1 deletion
clients/ud/ud.h
clients/ud/util.c
+0
-120
0 additions, 120 deletions
clients/ud/util.c
with
1 addition
and
122 deletions
clients/ud/auth.c
+
1
−
1
View file @
6b94bc7e
...
...
@@ -236,7 +236,7 @@ auth( char *who, int implicit )
authmethod
=
LDAP_AUTH_SIMPLE
;
sprintf
(
prompt
,
" Enter your LDAP password: "
);
do
{
passwd
=
my
getpass
(
prompt
);
passwd
=
getpass
(
prompt
);
}
while
(
passwd
!=
NULL
&&
*
passwd
==
'\0'
);
if
(
passwd
==
NULL
)
{
(
void
)
ldap_value_free
(
rdns
);
...
...
This diff is collapsed.
Click to expand it.
clients/ud/ud.h
+
0
−
1
View file @
6b94bc7e
...
...
@@ -278,7 +278,6 @@ void ka_StringToKey LDAP_P(( char *str, char *cell, des_cblock *key ));
#endif
/* in util.c: */
char
*
mygetpass
LDAP_P
((
char
*
prompt
));
void
printbase
LDAP_P
((
char
*
lead
,
char
*
s
));
void
fetch_buffer
LDAP_P
((
char
*
buffer
,
int
length
,
FILE
*
where
));
void
fatal
LDAP_P
((
char
*
s
));
...
...
This diff is collapsed.
Click to expand it.
clients/ud/util.c
+
0
−
120
View file @
6b94bc7e
...
...
@@ -24,132 +24,12 @@
#include
<ac/time.h>
#include
<ac/unistd.h>
#ifdef HAVE_FCNTL_H
#include
<fcntl.h>
#endif
#ifdef HAVE_CONIO_H
#include
<conio.h>
#endif
#include
<lber.h>
#include
<ldap.h>
#include
<ldapconfig.h>
#include
"ud.h"
char
*
mygetpass
(
char
*
prompt
)
{
#if !defined(HAVE_POSIX_TERMIOS) && !defined(HAVE_SGTTY_H)
static
char
buf
[
256
];
int
i
,
c
;
#ifdef DEBUG
if
(
debug
&
D_TRACE
)
printf
(
"->mygetpass(%s)
\n
"
,
prompt
);
#endif
printf
(
"%s"
,
prompt
);
i
=
0
;
while
(
(
c
=
getch
())
!=
EOF
&&
c
!=
'\n'
&&
c
!=
'\r'
)
buf
[
i
++
]
=
c
;
if
(
c
==
EOF
)
return
(
NULL
);
buf
[
i
]
=
'\0'
;
return
(
buf
);
#else
int
no_pass
=
0
;
char
i
,
j
,
k
;
TERMIO_TYPE
ttyb
;
TERMFLAG_TYPE
flags
;
static
char
pbuf
[
513
];
register
char
*
p
;
register
int
c
;
FILE
*
fi
;
RETSIGTYPE
(
*
sig
)(
int
sig
);
#ifdef DEBUG
if
(
debug
&
D_TRACE
)
printf
(
"->mygetpass(%s)
\n
"
,
prompt
);
#endif
/*
* Stolen from the getpass() routine. Can't use the plain
* getpass() for two reasons. One is that LDAP passwords
* can be really, really long - much longer than 8 chars.
* The second is that we like to make this client available
* out of inetd via a Merit asynch port, and we need to be
* able to do telnet control codes to turn on and off line
* blanking.
*/
if
((
fi
=
fdopen
(
open
(
"/dev/tty"
,
2
),
"r"
))
==
NULL
)
fi
=
stdin
;
else
setbuf
(
fi
,
(
char
*
)
NULL
);
sig
=
SIGNAL
(
SIGINT
,
SIG_IGN
);
if
(
fi
!=
stdin
)
{
if
(
GETATTR
(
fileno
(
fi
),
&
ttyb
)
<
0
)
perror
(
"GETATTR"
);
}
flags
=
GETFLAGS
(
ttyb
);
SETFLAGS
(
ttyb
,
flags
&
~
ECHO
);
if
(
fi
!=
stdin
)
{
if
(
SETATTR
(
fileno
(
fi
),
&
ttyb
)
<
0
)
perror
(
"SETATTR"
);
}
/* blank the line if through Merit */
if
(
fi
==
stdin
)
{
printf
(
"%c%c%c"
,
255
,
251
,
1
);
fflush
(
stdout
);
(
void
)
scanf
(
"%c%c%c"
,
&
i
,
&
j
,
&
k
);
fflush
(
stdin
);
}
/* fetch the password */
fprintf
(
stdout
,
"%s"
,
prompt
);
fflush
(
stdout
);
for
(
p
=
pbuf
;
(
c
=
getc
(
fi
))
!=
'\n'
&&
c
!=
EOF
;)
{
if
(
c
==
'\r'
)
break
;
if
(
p
<
&
pbuf
[
512
])
*
p
++
=
c
;
}
if
(
c
==
EOF
)
no_pass
=
1
;
else
{
*
p
=
'\0'
;
if
(
*
(
p
-
1
)
==
'\r'
)
*
(
p
-
1
)
=
'\0'
;
}
/* unblank the line if through Merit */
if
(
fi
==
stdin
)
{
printf
(
"%c%c%c"
,
255
,
252
,
1
);
fflush
(
stdout
);
(
void
)
scanf
(
"%c%c%c"
,
&
i
,
&
j
,
&
k
);
fflush
(
stdin
);
printf
(
"
\n
"
);
fflush
(
stdout
);
}
fprintf
(
stdout
,
"
\n
"
);
fflush
(
stdout
);
/* tidy up */
SETFLAGS
(
ttyb
,
flags
);
if
(
fi
!=
stdin
)
{
if
(
SETATTR
(
fileno
(
fi
),
&
ttyb
)
<
0
)
perror
(
"SETATTR"
);
}
(
void
)
SIGNAL
(
SIGINT
,
sig
);
if
(
fi
!=
stdin
)
(
void
)
fclose
(
fi
);
else
i
=
getchar
();
if
(
no_pass
)
return
(
NULL
);
return
(
pbuf
);
#endif
/* DOS */
}
void
printbase
(
char
*
lead
,
char
*
s
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment