At 08:15 04/07/00 +0200, Bladt Norbert wrote:>> Darren Evans [SMTP:darren at horseplay.demon.co.uk] wrote:
>>
>> gcc -g -O2 -Wall -I/usr/local/ssl/include
-DETCDIR=\"/usr/local/etc\"
>-DSSH_PROGRAM=\"/usr/local/bin/ssh\" -
>> DSSH_ASKPASS_DEFAULT=\"/usr/local/libexec/ssh/ssh-askpass\"
>-DHAVE_CONFIG_H -c loginrec.c
>> loginrec.c: In function `construct_utmp':
>> loginrec.c:619: structure has no member named `ut_user'
>[...]
>Would it be possible for you to switch to FreeBSD 4.0-RELEASE ?
>AFAIK, this includes openssh support per installation, so no hassle
>with porting it.
>
>Just a hint,
Just a hint, but i'm probably speaking for thousands who go for stable
releases
on server's who need stable and secure solutions.
With PAM and the hack below it core says (sshd) illegal module type: sshd
then core dumps.
Add -lcrypt when compiling 'configure --without-pam' for sshd.
The patch get's it compiled but obviously only on this platform.
Anyone want to fix pam and some defines then for the masses ? :)
openssh works fine though without PAM and the "hotfix".
--- loginrec.c.orig Tue Jul 4 10:30:18 2000
+++ loginrec.c Tue Jul 4 10:31:18 2000
@@ -616,7 +616,7 @@
*/
/* Use strncpy because we don't necessarily want null termination */
- strncpy(ut->ut_user, li->username, MIN_SIZEOF(ut->ut_user,
li->username));
+ strncpy(ut->ut_name, li->username, MIN_SIZEOF(ut->ut_name,
li->username));
# ifdef HAVE_HOST_IN_UTMP
strncpy(ut->ut_host, li->hostname, MIN_SIZEOF(ut->ut_host,
li->hostname));
# endif
@@ -1006,8 +1006,8 @@
static int
wtmp_islogin(struct logininfo *li, struct utmp *ut)
{
- if (strncmp(li->username, ut->ut_user,
- MIN_SIZEOF(li->username, ut->ut_user)) == 0) {
+ if (strncmp(li->username, ut->ut_name,
+ MIN_SIZEOF(li->username, ut->ut_name)) == 0) {
# ifdef HAVE_TYPE_IN_UTMP
if (ut->ut_type & USER_PROCESS)
return 1;
@@ -1161,7 +1161,7 @@
static int
wtmpx_islogin(struct logininfo *li, struct utmpx *utx)
{
- if ( strncmp(li->username, utx->ut_user,
+ if ( strncmp(li->username, utx->ut_name,
MIN_SIZEOF(li->username, utx->ut_user)) == 0 ) {
# ifdef HAVE_TYPE_IN_UTMPX
if (utx->ut_type == USER_PROCESS)
And here's a startup script.
#!/bin/sh
# sshd startup script for FreeBSD 3.5-STABLE, should work elsewhere
# Name it /usr/local/etc/rc.d/sshd.sh
# Note without the .sh it won't execute from boot
# darren at horseplay.demon.co.uk
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin
bindir=/usr/local/sbin
pid_file=/var/run/sshd.pid
export PATH
mode=$1
case "$mode" in
'start')
# Start daemon
if test -x $bindir/sshd
then
$bindir/sshd
else
echo "Can't execute $bindir/sshd"
fi
;;
'stop')
# Stop daemon.
if test -f "$pid_file"
then
mysqld_pid=`cat $pid_file`
echo "Killing sshd with pid $mysqld_pid"
kill $mysqld_pid
# sshd should remove the pid_file when it exits, so wait for it.
sleep 1
while [ -s $pid_file -a "$flags" !=
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ]
do [ -z "$flags" ] && echo "Wait for sshd to
exit\c" || echo ".\c"
flags=a$flags
sleep 1
done
if [ -s $pid_file ]
then echo " gave up waiting!"
elif [ -n "$flags" ]
then echo " done"
fi
else
echo "No sshd pid file found. Looked for $pid_file."
fi
;;
*)
# usage
echo "usage: $0 start|stop"
exit 1
;;
esac
---