I'm very pleased to announce the release of our new website and documentation using the new toolchain with Hugo and AsciiDoctor. To get more information about the new toolchain please read the FreeBSD Documentation Project Primer[1], Hugo docs[2] and AsciiDoctor docs[3]. Acknowledgment: Benedict Reuschling <bcr@> Glen Barber <gjb@> Hiroki Sato <hrs@> Li-Wen Hsu <lwhsu@> Sean Chittenden <seanc@> The FreeBSD Foundation [1] https://docs.FreeBSD.org/en/books/fdp-primer/ [2] https://gohugo.io/documentation/ [3] https://docs.asciidoctor.org/home/ Approved by: doceng, core
22 lines
564 B
Diff
22 lines
564 B
Diff
--- contrib/opie/opiepasswd.c
|
|
+++ contrib/opie/opiepasswd.c
|
|
@@ -118,11 +118,18 @@
|
|
struct opie opie;
|
|
int rval, n = 499, i, mode = MODE_DEFAULT, force = 0;
|
|
char seed[OPIE_SEED_MAX+1];
|
|
+ char *username;
|
|
+ uid_t ruid;
|
|
struct passwd *pp;
|
|
|
|
memset(seed, 0, sizeof(seed));
|
|
|
|
- if (!(pp = getpwnam(getlogin()))) {
|
|
+ ruid = getuid();
|
|
+ username = getlogin();
|
|
+ pp = getpwnam(username);
|
|
+ if (username == NULL || pp == NULL || pp->pw_uid != ruid)
|
|
+ pp = getpwuid(ruid);
|
|
+ if (pp == NULL) {
|
|
fprintf(stderr, "Who are you?");
|
|
return 1;
|
|
}
|