summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1996-07-30 19:23:31 +0000
committerThomas Bushnell <thomas@gnu.org>1996-07-30 19:23:31 +0000
commit02f22d5c684d29800ca6b69e3ebca094f3c17cb0 (patch)
tree6bafcfc70c7d6916bafa18ead2bc7632059ee99e /utils
parentd75bf60537850ac9edd04170d001ded4b41ac8bd (diff)
*** empty log message ***
Diffstat (limited to 'utils')
-rw-r--r--utils/login.c17
-rw-r--r--utils/su.c15
2 files changed, 19 insertions, 13 deletions
diff --git a/utils/login.c b/utils/login.c
index 10762bc8..726d7d16 100644
--- a/utils/login.c
+++ b/utils/login.c
@@ -359,6 +359,8 @@ dog (time_t timeout, pid_t pid, char **argv)
}
}
+asm (".weak crypt");
+
void
main(int argc, char *argv[])
{
@@ -531,13 +533,14 @@ main(int argc, char *argv[])
prompt = "Password:";
unencrypted = getpass (prompt);
-#ifdef government_not_broken
- encrypted = crypt (unencrypted, password);
- /* Paranoia may destroya. */
- memset (unencrypted, 0, strlen (unencrypted));
-#else
- encrypted = unencrypted;
-#endif
+ if (crypt)
+ {
+ encrypted = crypt (unencrypted, password);
+ /* Paranoia may destroya. */
+ memset (unencrypted, 0, strlen (unencrypted));
+ }
+ else
+ encrypted = unencrypted;
if (name)
free (prompt);
diff --git a/utils/su.c b/utils/su.c
index 6dfe2f59..32ae99a7 100644
--- a/utils/su.c
+++ b/utils/su.c
@@ -452,6 +452,8 @@ apply_auth_to_pgrp (struct auth *auth, pid_t pgrp)
run by uid 0 or if PASSWORD is an empty password, and always under -r.
Always prints a message before returning 0. */
+asm (".weak crypt");
+
int
check_password (const char *name, const char *password)
{
@@ -464,12 +466,13 @@ check_password (const char *name, const char *password)
asprintf (&prompt, "%s's Password:", name);
unencrypted = getpass (prompt);
-#ifdef government_not_broken
- encrypted = crypt (unencrypted, password);
- memset (unencrypted, 0, strlen (unencrypted)); /* Paranoia may destroya. */
-#else
- encrypted = unencrypted;
-#endif
+ if (crypt)
+ {
+ encrypted = crypt (unencrypted, password);
+ memset (unencrypted, 0, strlen (unencrypted)); /* Paranoia may destroya. */
+ }
+ else
+ encrypted = unencrypted;
if (!strcmp (encrypted, password))
return 1;