FreeBSD Bugzilla – Attachment 11128 Details for
Bug 22033
[PATCH] to pw(8) to allow encrypted password to be entered via fd
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.43 KB, created by
Brook.Schofield
on 2000-10-17 00:00:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Brook.Schofield
Created:
2000-10-17 00:00:01 UTC
Size:
2.43 KB
patch
obsolete
>diff -ur pw_dir/pw.8 pw_dir2/pw.8 >--- pw_dir/pw.8 Fri Mar 3 01:53:37 2000 >+++ pw_dir2/pw.8 Tue Oct 17 00:09:23 2000 >@@ -604,6 +604,9 @@ > force a blank password > .It random > generate a random password >+.It crypt >+the supplied password is encrypted. Suitable only with >+.Ql Fl h > .El > .Pp > The >diff -ur pw_dir/pw_conf.c pw_dir2/pw_conf.c >--- pw_dir/pw_conf.c Sun Jul 16 11:48:12 2000 >+++ pw_dir2/pw_conf.c Tue Oct 17 00:14:48 2000 >@@ -187,6 +187,11 @@ > return -1; > if (strcmp(str, "none") == 0) > return -2; >+ /* >+ * Special case for encrypted password >+ */ >+ if (strcmp(str, "crypt") == 0) >+ return -3; > } > return dflt; > } >diff -ur pw_dir/pw_group.c pw_dir2/pw_group.c >--- pw_dir/pw_group.c Thu Jun 29 05:19:04 2000 >+++ pw_dir2/pw_group.c Tue Oct 17 09:52:20 2000 >@@ -196,7 +196,16 @@ > *p = '\0'; > if (!*line) > errx(EX_DATAERR, "empty password read on file descriptor %d", fd); >- grp->gr_passwd = pw_pwcrypt(line); >+ if (((arg = getarg(args, 'w')) != NULL) && >+ (boolean_val(arg->val, cnf->default_password) == -3)) { >+ int i; >+ for (i = 0; i < strlen(line); i++) { >+ if (line[i] == ':') >+ return EX_DATAERR; >+ } >+ grp->gr_passwd = line; >+ } else >+ grp->gr_passwd = pw_pwcrypt(line); > } > } > >diff -ur pw_dir/pw_user.c pw_dir2/pw_user.c >--- pw_dir/pw_user.c Wed Oct 11 14:57:59 2000 >+++ pw_dir2/pw_user.c Tue Oct 17 09:50:53 2000 >@@ -643,12 +643,24 @@ > *p = '\0'; > if (!*line) > errx(EX_DATAERR, "empty password read on file descriptor %d", fd); >- lc = login_getpwclass(pwd); >- if (lc == NULL || >- login_setcryptfmt(lc, "md5", NULL) == NULL) >- warn("setting crypt(3) format"); >- login_close(lc); >- pwd->pw_passwd = pw_pwcrypt(line); >+ /* check for encrypted/literal password in file descriptor */ >+ if (((arg = getarg(args, 'w')) != NULL) && >+ (boolean_val(arg->val, cnf->default_password) == -3)) { >+ int i; >+ /* password is encrypted - check for ':' in password */ >+ for (i = 0; i < strlen(line); i++) { >+ if (line[i] == ':') >+ return EX_DATAERR; >+ } >+ pwd->pw_passwd = line; >+ } else { >+ lc = login_getpwclass(pwd); >+ if (lc == NULL || >+ login_setcryptfmt(lc, "md5", NULL) == NULL) >+ warn("setting crypt(3) format"); >+ login_close(lc); >+ pwd->pw_passwd = pw_pwcrypt(line); >+ } > edited = 1; > } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 22033
: 11128