Commit 7335051a authored by Josué Ortega's avatar Josué Ortega

Refresh patches

parent c9cfd9b0
--- a/finger/finger.1 2000-07-31 09:56:57.000000000 +1000
+++ b/finger/finger.1 2009-06-10 20:08:45.000000000 +1000
@@ -169,16 +169,14 @@ started by
--- a/finger/finger.1
+++ b/finger/finger.1
@@ -169,16 +169,14 @@
must be able to see the
.Pa .nofinger
file. This generally means that the home directory containing the file
......@@ -19,9 +19,9 @@
.Pa .plan
file may be arbitrarily long.
.El
--- a/finger/finger.c 1999-12-19 03:41:51.000000000 +1100
+++ b/finger/finger.c 2009-06-10 20:08:45.000000000 +1000
@@ -77,7 +77,7 @@ char finger_rcsid[] = \
--- a/finger/finger.c
+++ b/finger/finger.c
@@ -77,7 +77,7 @@
#include "../version.h"
static void loginlist(void);
......@@ -30,7 +30,7 @@
int lflag, pplan;
static int sflag, mflag;
@@ -92,6 +92,7 @@ int entries; /* number of people */
@@ -92,6 +92,7 @@
int main(int argc, char *argv[]) {
int ch;
......@@ -38,7 +38,7 @@
struct sockaddr_in sin;
socklen_t slen = sizeof(sin);
@@ -159,7 +160,7 @@ int main(int argc, char *argv[]) {
@@ -159,7 +160,7 @@
}
}
else {
......@@ -47,7 +47,7 @@
/*
* Assign explicit "large" format if names given and -s not
* explicitly stated. Force the -l AFTER we get names so any
@@ -172,7 +173,7 @@ int main(int argc, char *argv[]) {
@@ -172,7 +173,7 @@
if (lflag) lflag_print();
else sflag_print();
}
......@@ -56,7 +56,7 @@
}
/* Returns 1 if .nofinger is found and enable_nofinger is set. */
@@ -181,10 +182,16 @@ int
@@ -181,10 +182,16 @@
check_nofinger(struct passwd *pw)
{
if (enable_nofinger) {
......@@ -76,7 +76,7 @@
return 1;
}
}
@@ -264,10 +271,11 @@ static void do_local(int argc, char *arg
@@ -264,10 +271,11 @@
}
......@@ -89,7 +89,7 @@
PERSON *pn;
PERSON *nethead, **nettail;
struct utmp *uptr;
@@ -297,13 +305,13 @@ userlist(int argc, char *argv[])
@@ -297,13 +305,13 @@
/* handle network requests */
for (pn = nethead; pn; pn = pn->next) {
......@@ -105,16 +105,16 @@
/*
* Scan thru the list of users currently logged in, saving
@@ -331,4 +339,6 @@ userlist(int argc, char *argv[])
@@ -331,4 +339,6 @@
enter_lastlog(pn);
}
endutent();
+
+ return err;
}
--- a/finger/finger.h 1999-09-14 20:51:11.000000000 +1000
+++ b/finger/finger.h 2009-06-10 20:08:45.000000000 +1000
@@ -92,7 +92,7 @@ void sflag_print(void);
--- a/finger/finger.h
+++ b/finger/finger.h
@@ -92,7 +92,7 @@
void enter_where(struct utmp *ut, PERSON *pn);
void enter_lastlog(PERSON *pn);
int match(struct passwd *pw, const char *user);
......@@ -123,9 +123,9 @@
const char *prphone(const char *num);
#ifndef DAYSPERNYEAR
--- a/finger/lprint.c 1999-09-14 20:51:11.000000000 +1000
+++ b/finger/lprint.c 2009-06-10 20:08:45.000000000 +1000
@@ -48,7 +48,7 @@ char lprint_rcsid[] =
--- a/finger/lprint.c
+++ b/finger/lprint.c
@@ -48,7 +48,7 @@
#include <sys/types.h>
#include <sys/file.h>
#include <sys/stat.h>
......@@ -134,7 +134,7 @@
#include "finger.h"
static void lprint(PERSON *pn);
@@ -100,7 +100,7 @@ lprint(PERSON *pn)
@@ -100,7 +100,7 @@
* office, office phone, home phone if available
*/
xprintf("Login: %-15s\t\t\tName: %s\nDirectory: %-25s",
......@@ -143,9 +143,9 @@
xprintf("\tShell: %-s\n", *pn->shell ? pn->shell : _PATH_BSHELL);
/*
--- a/finger/net.c 1999-09-14 20:51:11.000000000 +1000
+++ b/finger/net.c 2009-06-10 20:08:45.000000000 +1000
@@ -51,7 +51,7 @@ char net_rcsid[] = "$Id: net.c,v 1.9 199
--- a/finger/net.c
+++ b/finger/net.c
@@ -51,7 +51,7 @@
#include <ctype.h>
#include "finger.h"
......@@ -154,7 +154,7 @@
register FILE *fp;
struct in_addr defaddr;
register int c, sawret, ateol;
@@ -62,7 +62,7 @@ void netfinger(const char *name) {
@@ -62,7 +62,7 @@
char *alist[1], *host;
host = strrchr(name, '@');
......@@ -163,7 +163,7 @@
*host++ = '\0';
memset(&sn, 0, sizeof(sn));
@@ -70,7 +70,7 @@ void netfinger(const char *name) {
@@ -70,7 +70,7 @@
sp = getservbyname("finger", "tcp");
if (!sp) {
eprintf("finger: tcp/finger: unknown service\n");
......@@ -172,7 +172,7 @@
}
sn.sin_port = sp->s_port;
@@ -78,7 +78,7 @@ void netfinger(const char *name) {
@@ -78,7 +78,7 @@
if (!hp) {
if (!inet_aton(host, &defaddr)) {
eprintf("finger: unknown host: %s\n", host);
......@@ -181,7 +181,7 @@
}
def.h_name = host;
def.h_addr_list = alist;
@@ -96,7 +96,7 @@ void netfinger(const char *name) {
@@ -96,7 +96,7 @@
if ((s = socket(hp->h_addrtype, SOCK_STREAM, 0)) < 0) {
eprintf("finger: socket: %s\n", strerror(errno));
......@@ -190,7 +190,7 @@
}
/* print hostname before connecting, in case it takes a while */
@@ -104,7 +104,7 @@ void netfinger(const char *name) {
@@ -104,7 +104,7 @@
if (connect(s, (struct sockaddr *)&sn, sizeof(sn)) < 0) {
eprintf("finger: connect: %s\n", strerror(errno));
close(s);
......@@ -199,7 +199,7 @@
}
/* -l flag for remote fingerd */
@@ -128,7 +128,7 @@ void netfinger(const char *name) {
@@ -128,7 +128,7 @@
if (!fp) {
eprintf("finger: fdopen: %s\n", strerror(errno));
close(s);
......@@ -208,16 +208,16 @@
}
sawret = 0;
@@ -152,4 +152,6 @@ void netfinger(const char *name) {
@@ -152,4 +152,6 @@
}
if (!ateol) xputc('\n');
fclose(fp);
+
+ return 0;
}
--- a/finger/sprint.c 1999-12-13 05:59:33.000000000 +1100
+++ b/finger/sprint.c 2009-06-10 20:08:45.000000000 +1000
@@ -40,7 +40,7 @@ char sprint_rcsid[] = "$Id: sprint.c,v 1
--- a/finger/sprint.c
+++ b/finger/sprint.c
@@ -40,7 +40,7 @@
#endif /* not lint */
#include <sys/types.h>
......@@ -226,9 +226,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
--- a/finger/util.c 1999-09-29 08:53:58.000000000 +1000
+++ b/finger/util.c 2009-06-10 20:08:45.000000000 +1000
@@ -64,7 +64,7 @@ static void find_idle_and_ttywrite(regis
--- a/finger/util.c
+++ b/finger/util.c
@@ -64,7 +64,7 @@
struct stat sb;
/* No device for X console. Utmp entry by XDM login (":0"). */
......@@ -237,7 +237,7 @@
w->idletime = 0; /* would be nice to have it emit ??? */
w->writable = 0;
return;
@@ -109,9 +109,8 @@ static void userinfo(PERSON *pn, struct
@@ -109,9 +109,8 @@
* fields[3] -> homephone
*/
nfields = 0;
......@@ -249,7 +249,7 @@
}
while (nfields<4) fields[nfields++] = NULL;
@@ -150,6 +149,9 @@ static void userinfo(PERSON *pn, struct
@@ -150,6 +149,9 @@
pn->realname = rname;
}
......@@ -259,8 +259,8 @@
pn->office = fields[1] ? strdup(fields[1]) : NULL;
pn->officephone = fields[2] ? strdup(fields[2]) : NULL;
--- a/fingerd/fingerd.8 2000-07-31 09:56:57.000000000 +1000
+++ b/fingerd/fingerd.8 2009-06-10 20:08:45.000000000 +1000
--- a/fingerd/fingerd.8
+++ b/fingerd/fingerd.8
@@ -36,10 +36,10 @@
.Dt FINGERD 8
.Os "Linux NetKit (0.17)"
......@@ -274,7 +274,7 @@
.Op Fl wulf
.Op Fl pL Ar path
.Op Fl t Ar timeout
@@ -61,7 +61,7 @@ option is given, remote users will get a
@@ -61,7 +61,7 @@
banner
which also shows some informations (e.g. uptime, operating system name and
release) about the system the
......@@ -283,7 +283,7 @@
is running on. Some sites may consider this a security risk as it
gives out information that may be useful to crackers.
.Pp
@@ -85,7 +85,7 @@ resource reasons.
@@ -85,7 +85,7 @@
.Pp
The
.Fl p
......@@ -292,7 +292,7 @@
the
.Dq finger
program. The
@@ -97,7 +97,7 @@ The
@@ -97,7 +97,7 @@
option specifies the time to wait for a request before closing the
connection. A value of 0 waits forever. The default is 60 seconds.
.Pp
......@@ -301,7 +301,7 @@
.Pa /etc/inetd.conf .
.Pp
The finger protocol consists mostly of specifying command arguments.
@@ -105,12 +105,12 @@ The
@@ -105,12 +105,12 @@
.Xr inetd 8
.Dq super-server
runs
......@@ -316,9 +316,9 @@
reads a single command line
terminated by a
.Aq Tn CRLF
--- a/fingerd/fingerd.c 1999-12-13 05:46:28.000000000 +1100
+++ b/fingerd/fingerd.c 2009-06-10 20:08:45.000000000 +1000
@@ -55,6 +55,7 @@ char rcsid[] =
--- a/fingerd/fingerd.c
+++ b/fingerd/fingerd.c
@@ -55,6 +55,7 @@
#include <netinet/in.h>
#include <sys/utsname.h>
#include <sys/wait.h>
......
......@@ -38,61 +38,59 @@ Date: Fri Mar 6 22:30:00 2009 -0500
Signed-off-by: Timothy G Abbott <tabbott@mit.edu>
diff --git a/finger/finger.c b/finger/finger.c
index 7b96d3c..5737782 100644
--- a/finger/finger.c
+++ b/finger/finger.c
@@ -241,28 +241,35 @@ static void do_local(int argc, char *argv[], int *used) {
int i;
struct passwd *pw;
+ for (i = 0; i < argc; i++) {
+ if (used[i] >= 0 && (pw = getpwnam(argv[i]))) {
+ if (!check_nofinger(pw)) {
+ enter_person(pw);
+ used[i] = 1;
+ }
+ }
+ }
/*
- * traverse the list of possible login names and check the login name
- * and real name against the name specified by the user.
+ * Traverse the list of users and check the real name against
+ * the name specified by the user.
+ *
+ * Since we've already entered users whose usernames match,
+ * ignore them when doing real name matching.
*/
- if (mflag) {
- for (i = 0; i < argc; i++)
- if (used[i] >= 0 && (pw = getpwnam(argv[i]))) {
- if (!check_nofinger(pw)) {
- enter_person(pw);
- used[i] = 1;
- }
- }
- } else for (pw = getpwent(); pw; pw = getpwent())
- for (i = 0; i < argc; i++)
- if (used[i] >= 0 &&
- (!strcasecmp(pw->pw_name, argv[i]) ||
- match(pw, argv[i]))) {
- if (!check_nofinger(pw)) {
- enter_person(pw);
- used[i] = 1;
+ if (!mflag) {
+ for (pw = getpwent(); pw; pw = getpwent()) {
+ for (i = 0; i < argc; i++) {
+ if (used[i] >= 0 &&
+ strcasecmp(pw->pw_name, argv[i]) &&
+ match(pw, argv[i])) {
+ if (!check_nofinger(pw)) {
+ enter_person(pw);
+ used[i] = 1;
+ }
}
}
+ }
+ }
/* list errors */
for (i = 0; i < argc; i++)
--- a/finger/finger.c
+++ b/finger/finger.c
@@ -241,28 +241,35 @@
int i;
struct passwd *pw;
+ for (i = 0; i < argc; i++) {
+ if (used[i] >= 0 && (pw = getpwnam(argv[i]))) {
+ if (!check_nofinger(pw)) {
+ enter_person(pw);
+ used[i] = 1;
+ }
+ }
+ }
/*
- * traverse the list of possible login names and check the login name
- * and real name against the name specified by the user.
+ * Traverse the list of users and check the real name against
+ * the name specified by the user.
+ *
+ * Since we've already entered users whose usernames match,
+ * ignore them when doing real name matching.
*/
- if (mflag) {
- for (i = 0; i < argc; i++)
- if (used[i] >= 0 && (pw = getpwnam(argv[i]))) {
- if (!check_nofinger(pw)) {
- enter_person(pw);
- used[i] = 1;
- }
- }
- } else for (pw = getpwent(); pw; pw = getpwent())
- for (i = 0; i < argc; i++)
- if (used[i] >= 0 &&
- (!strcasecmp(pw->pw_name, argv[i]) ||
- match(pw, argv[i]))) {
- if (!check_nofinger(pw)) {
- enter_person(pw);
- used[i] = 1;
+ if (!mflag) {
+ for (pw = getpwent(); pw; pw = getpwent()) {
+ for (i = 0; i < argc; i++) {
+ if (used[i] >= 0 &&
+ strcasecmp(pw->pw_name, argv[i]) &&
+ match(pw, argv[i])) {
+ if (!check_nofinger(pw)) {
+ enter_person(pw);
+ used[i] = 1;
+ }
}
}
+ }
+ }
/* list errors */
for (i = 0; i < argc; i++)
......@@ -7,7 +7,7 @@ Last-Update: 2010-02-09
--- a/fingerd/fingerd.c
+++ b/fingerd/fingerd.c
@@ -112,7 +112,7 @@ main(int argc, char *argv[])
@@ -112,7 +112,7 @@
int k, nusers;
char *s, *t;
const char *fingerpath = NULL;
......@@ -16,7 +16,7 @@ Last-Update: 2010-02-09
socklen_t sval = sizeof(sn);
@@ -182,11 +182,13 @@ main(int argc, char *argv[])
@@ -182,11 +182,13 @@
}
if (welcome) {
......
......@@ -16,7 +16,7 @@ Last-Updated: 2010-02-09
socklen_t slen = sizeof(sin);
while ((ch = getopt(argc, argv, "lmps")) != EOF) {
@@ -137,6 +137,8 @@ int main(int argc, char *argv[]) {
@@ -137,6 +137,8 @@
* Also check stdin for nofinger processing, because of older
* fingerds that make stdout a pipe for CRLF handling.
*/
......@@ -45,7 +45,7 @@ Last-Updated: 2010-02-09
host = strrchr(name, '@');
if (!host) return 1;
@@ -72,38 +71,46 @@ int netfinger(const char *name) {
@@ -72,38 +71,46 @@
eprintf("finger: tcp/finger: unknown service\n");
return 1;
}
......@@ -62,19 +62,19 @@ Last-Updated: 2010-02-09
+ eprintf("getaddrinfo: %s\n", gai_strerror(status));
+ return 1;
+ }
- hp = gethostbyname(host);
- if (!hp) {
- if (!inet_aton(host, &defaddr)) {
- eprintf("finger: unknown host: %s\n", host);
- return 1;
+
+ for ( resptr = result; resptr; resptr = resptr->ai_next) {
+
+ if ((s = socket(resptr->ai_family, resptr->ai_socktype,
+ resptr->ai_protocol)) < 0)
+ continue;
+
+
- hp = gethostbyname(host);
- if (!hp) {
- if (!inet_aton(host, &defaddr)) {
- eprintf("finger: unknown host: %s\n", host);
- return 1;
+ /* print hostname before connecting, in case it takes a while */
+ /* This should probably be removed. */
+ /* xprintf("[%s]\n", result->ai_canonname); */
......
......@@ -14,9 +14,9 @@ nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
This patch sidesteps what finger considers a malformed passwd entry:
--- a/finger/util.c 1999-09-29 08:53:58.000000000 +1000
+++ b/finger/util.c 2010-02-12 16:08:50.000000000 +1100
@@ -178,6 +180,8 @@ match(struct passwd *pw, const char *use
--- a/finger/util.c
+++ b/finger/util.c
@@ -180,6 +180,8 @@
int i, j, ct, rv=0;
char *rname;
......
......@@ -11,5 +11,5 @@ Last-Update: 2019-05-11
-which also shows some informations (e.g. uptime, operating system name and
+which also shows some information (e.g. uptime, operating system name and
release) about the system the
.Nm fingerd
.Nm in.fingerd
is running on. Some sites may consider this a security risk as it
......@@ -6,4 +6,4 @@
06-572211-decrease-timeout.patch
use-cmake-as-buildsystem.patch
use-cmake-as-buildsystem-debian-extras.patch
fix-fingerd-man-typo.patch
\ No newline at end of file
fix-fingerd-man-typo.patch
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment