mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-03 09:48:00 -04:00
42 lines
1.5 KiB
Plaintext
42 lines
1.5 KiB
Plaintext
$NetBSD: patch-am,v 1.6 2007/08/03 17:03:31 obache Exp $
|
|
|
|
--- src/osdep/unix/env_unix.c.orig 2007-05-29 20:29:52.000000000 +0000
|
|
+++ src/osdep/unix/env_unix.c
|
|
@@ -29,6 +29,9 @@
|
|
#include <grp.h>
|
|
#include <signal.h>
|
|
#include <sys/wait.h>
|
|
+#ifdef USE_WHOSON
|
|
+#include <whoson.h>
|
|
+#endif /* USE_WHOSON */
|
|
|
|
|
|
/* in case stat.h is ancient */
|
|
@@ -693,7 +696,15 @@ long server_login (char *user,char *pwd,
|
|
else if (disablePlaintext) err = "disabled";
|
|
else if (!(authuser && *authuser)) pw = valpwd (user,pwd,argc,argv);
|
|
else if (valpwd (authuser,pwd,argc,argv)) pw = pwuser (user);
|
|
- if (pw && pw_login (pw,authuser,pw->pw_name,NIL,argc,argv)) return T;
|
|
+ if (pw && pw_login (pw,authuser,pw->pw_name,NIL,argc,argv)) {
|
|
+#ifdef USE_WHOSON
|
|
+ struct sockaddr_in sin;
|
|
+ int sinlen = sizeof (struct sockaddr_in);
|
|
+ if (getpeername(0,(struct sockaddr *) &sin,&sinlen) == 0)
|
|
+ wso_login(inet_ntoa(sin.sin_addr),user,NULL,0);
|
|
+#endif
|
|
+ return T;
|
|
+ }
|
|
syslog (level|LOG_AUTH,"Login %s user=%.64s auth=%.64s host=%.80s",err,
|
|
user,(authuser && *authuser) ? authuser : user,tcp_clienthost ());
|
|
sleep (3); /* slow down possible cracker */
|
|
@@ -956,7 +967,8 @@ char *sysinbox ()
|
|
{
|
|
char tmp[MAILTMPLEN];
|
|
if (!sysInbox) { /* initialize if first time */
|
|
- sprintf (tmp,"%s/%s",MAILSPOOL,myusername ());
|
|
+ /* Substitute SPOOLDIR and MAILBOX appropriately for pkgsrc. */
|
|
+ sprintf (tmp,"%s/%s",@SPOOLDIR@,@MAILBOX@);
|
|
sysInbox = cpystr (tmp); /* system inbox is from mail spool */
|
|
}
|
|
return sysInbox;
|