aboutsummaryrefslogtreecommitdiff
path: root/security/slush/files/patch-ac
diff options
context:
space:
mode:
authorSteve Price <steve@FreeBSD.org>1999-05-09 17:50:07 +0000
committerSteve Price <steve@FreeBSD.org>1999-05-09 17:50:07 +0000
commit754ea881597bf8ee78f2777812190c09b28c6fdc (patch)
tree5ad716d93c2f653b8c1b5841f4fe7c1cbb340d86 /security/slush/files/patch-ac
parent7acd813c7ac469d074c0bf76ae7d54b8acebb330 (diff)
downloadports-754ea881597bf8ee78f2777812190c09b28c6fdc.tar.gz
ports-754ea881597bf8ee78f2777812190c09b28c6fdc.zip
Notes
Diffstat (limited to 'security/slush/files/patch-ac')
-rw-r--r--security/slush/files/patch-ac120
1 files changed, 120 insertions, 0 deletions
diff --git a/security/slush/files/patch-ac b/security/slush/files/patch-ac
new file mode 100644
index 000000000000..8ee3c7fe9268
--- /dev/null
+++ b/security/slush/files/patch-ac
@@ -0,0 +1,120 @@
+*** slushd.c.orig Tue Apr 6 05:14:04 1999
+--- slushd.c Sat May 8 23:53:40 1999
+***************
+*** 40,46 ****
+ #include <ctype.h>
+ #include <stdlib.h>
+ #include <netdb.h>
+! #include <getopt.h>
+ #include <pwd.h>
+ #include <grp.h>
+ #include <fcntl.h>
+--- 40,46 ----
+ #include <ctype.h>
+ #include <stdlib.h>
+ #include <netdb.h>
+! #include <libutil.h>
+ #include <pwd.h>
+ #include <grp.h>
+ #include <fcntl.h>
+***************
+*** 51,56 ****
+--- 51,57 ----
+ #include <sys/stat.h>
+ #include <sys/ioctl.h>
+ #include <sys/file.h>
++
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h> /* fork, execvp, exit */
+ #endif
+***************
+*** 654,711 ****
+ void log_uwtmp(struct passwd *pw, struct in_addr *i, char *tty, int is_logout)
+ {
+ struct utmp ut;
+- int wtmp;
+- int lock;
+
+ tty = strrchr(tty, '/');
+ if (tty == NULL)
+ {
+ syslog(LOG_ERR, "Can't determine basename of tty");
+! exit(3);
+ }
+ tty++;
+
+- utmpname(_PATH_UTMP);
+- setutent();
+- memset(&ut, 0, sizeof(ut));
+
+! if (ut.ut_id[0] == 0)
+! strncpy(ut.ut_id, tty + 3, sizeof(ut.ut_id));
+
+- if (!is_logout)
+- strncpy(ut.ut_user, pw->pw_name, sizeof(ut.ut_user));
+-
+ strncpy(ut.ut_line, tty, sizeof(ut.ut_line) - 1);
+! ut.ut_line[sizeof(ut.ut_line) - 1] = 0;
+!
+! ut.ut_time = time(NULL);
+! ut.ut_type = is_logout?DEAD_PROCESS:USER_PROCESS;
+! ut.ut_pid = getpid();
+
+- strncpy(ut.ut_host, hostname, sizeof(ut.ut_host) - 1);
+- ut.ut_host[sizeof(ut.ut_host) - 1] = 0;
+
+! memcpy(&ut.ut_addr, i, sizeof(ut.ut_addr));
+!
+! pututline(&ut);
+! endutent();
+!
+! lock = open(_PATH_WTMPLOCK, O_CREAT|O_WRONLY, 0660);
+! if (lock == -1)
+! ioerror("open");
+!
+! if (flock(lock, LOCK_EX) == -1)
+! ioerror("flock");
+!
+! wtmp = open(_PATH_WTMP, O_APPEND|O_WRONLY);
+! if (wtmp == -1)
+! ioerror("open");
+!
+! write(wtmp, (char *)&ut, sizeof(ut));
+! close(wtmp);
+!
+! flock(lock, LOCK_UN);
+! close(lock);
+ }
+
+ /* Retrieve client X509 certificate and test authentication */
+--- 655,684 ----
+ void log_uwtmp(struct passwd *pw, struct in_addr *i, char *tty, int is_logout)
+ {
+ struct utmp ut;
+
+ tty = strrchr(tty, '/');
+ if (tty == NULL)
+ {
+ syslog(LOG_ERR, "Can't determine basename of tty");
+! return;
+ }
+ tty++;
++
+
+
+! if(is_logout) {
+! logout(tty);
+! return;
+! }
+
+ strncpy(ut.ut_line, tty, sizeof(ut.ut_line) - 1);
+! strncpy(ut.ut_name, pw->pw_name, sizeof(ut.ut_name)-1);
+! strncpy(ut.ut_host, inet_ntoa(*i), sizeof(ut.ut_host) - 1);
+! ut.ut_time = time(0);
+! login(&ut);
+
+
+! return;
+ }
+
+ /* Retrieve client X509 certificate and test authentication */