On Tue, Aug 09, 2005 at 12:50:53AM +0200, [EMAIL PROTECTED] wrote: > this diff supersedes my previous posts. it updates the in-tree > samba port to version 3.0.14a, adds utmp support and actually > acitvates it. > > please discard the previous diffs. > > > diff -urN -x CVS net/samba/Makefile /usr/myports/net/samba/Makefile > --- net/samba/Makefile Fri Jun 3 19:13:46 2005 > +++ /usr/myports/net/samba/Makefile Tue Aug 9 00:21:41 2005 > @@ -1,11 +1,10 @@ > -# $OpenBSD: Makefile,v 1.53 2005/05/27 04:54:40 sturm Exp $ > +# $OpenBSD: Makefile,v 1.52 2005/05/03 04:33:24 sturm Exp $ > > COMMENT= "SMB and CIFS client and server for UNIX" > COMMENT-docs= "documentation and examples for samba" > > -DISTNAME= samba-3.0.13 > -PKGNAME= ${DISTNAME}p0 > -FULLPKGNAME-docs= ${DISTNAME:S/-/-docs-/}p0 > +DISTNAME= samba-3.0.14a > +FULLPKGNAME-docs= ${DISTNAME:S/-/-docs-/} > > CATEGORIES= net > > @@ -48,7 +47,7 @@ > --with-privatedir="${CONFDIR}" \ > --with-libsmbclient \ > --with-swatdir="${PREFIX}/share/swat" \ > - --with-ssl \ > + --with-ssl --with-utmp \
wrap around to a new line.. > --with-sslinc="/usr/include/ssl" \ > --with-ssllib="/usr/lib" > > diff -urN -x CVS net/samba/patches/patch-lib_smbrun_c > /usr/myports/net/samba/patches/patch-lib_smbrun_c > --- net/samba/patches/patch-lib_smbrun_c Fri May 27 06:54:40 2005 > +++ /usr/myports/net/samba/patches/patch-lib_smbrun_c Thu Jan 1 01:00:00 > 1970 > @@ -1,21 +0,0 @@ > -$OpenBSD: patch-lib_smbrun_c,v 1.1 2005/05/27 04:54:40 sturm Exp $ > ---- lib/smbrun.c.orig Thu May 26 14:43:30 2005 > -+++ lib/smbrun.c Thu May 26 14:43:54 2005 > -@@ -172,7 +172,7 @@ int smbrun(char *cmd, int *outfd) > - } > - #endif > - > -- execl("/bin/sh","sh","-c",cmd,NULL); > -+ execl("/bin/sh","sh","-c",cmd,(void *)NULL); > - > - /* not reached */ > - exit(82); > -@@ -293,7 +293,7 @@ int smbrunsecret(char *cmd, char *secret > - } > - #endif > - > -- execl("/bin/sh", "sh", "-c", cmd, NULL); > -+ execl("/bin/sh", "sh", "-c", cmd, (void *)NULL); > - > - /* not reached */ > - exit(82); removal of this patch is wrong. > diff -urN -x CVS net/samba/patches/patch-smbd_chgpasswd_c > /usr/myports/net/samba/patches/patch-smbd_chgpasswd_c > --- net/samba/patches/patch-smbd_chgpasswd_c Fri May 27 06:54:40 2005 > +++ /usr/myports/net/samba/patches/patch-smbd_chgpasswd_c Thu Jan 1 > 01:00:00 1970 > @@ -1,12 +0,0 @@ > -$OpenBSD: patch-smbd_chgpasswd_c,v 1.1 2005/05/27 04:54:40 sturm Exp $ > ---- smbd/chgpasswd.c.orig Thu May 26 14:42:51 2005 > -+++ smbd/chgpasswd.c Thu May 26 14:43:09 2005 > -@@ -218,7 +218,7 @@ static int dochild(int master, const cha > - passwordprogram)); > - > - /* execl() password-change application */ > -- if (execl("/bin/sh", "sh", "-c", passwordprogram, NULL) < 0) > -+ if (execl("/bin/sh", "sh", "-c", passwordprogram, (void *)NULL) < 0) > - { > - DEBUG(3, ("Bad status returned from %s\n", passwordprogram)); > - return (False); wrong. > diff -urN -x CVS net/samba/patches/patch-smbd_utmp_c > /usr/myports/net/samba/patches/patch-smbd_utmp_c > --- net/samba/patches/patch-smbd_utmp_c Thu Jan 1 01:00:00 1970 > +++ /usr/myports/net/samba/patches/patch-smbd_utmp_c Wed Jun 15 19:36:40 > 2005 > @@ -0,0 +1,64 @@ > +$OpenBSD$ > +--- smbd/utmp.c.orig Fri Feb 25 18:59:26 2005 > ++++ smbd/utmp.c Wed Jun 15 19:36:32 2005 > +@@ -245,6 +245,7 @@ static void uw_pathname(pstring fname, c > + } > + > + #ifndef HAVE_PUTUTLINE > ++#include <ttyent.h> > + > + > /**************************************************************************** > + Update utmp file directly. No subroutine interface: probably a BSD > system. > +@@ -252,8 +253,50 @@ static void uw_pathname(pstring fname, c > + > + static void pututline_my(pstring uname, struct utmp *u, BOOL claim) > + { > +- DEBUG(1,("pututline_my: not yet implemented\n")); > +- /* BSD implementor: may want to consider (or not) adjusting > "lastlog" */ > ++ int fd, topslot; > ++ struct utmp ubuf; > ++ > ++ if ((fd = open(uname, O_RDWR, 0)) < 0) > ++ return; > ++ > ++ if (!setttyent()) > ++ return; > ++ > ++ for (topslot = 0; getttyent() != (struct ttyent *)NULL; ) > ++ topslot++; > ++ > ++ if (!endttyent()) > ++ return; > ++ > ++ (void) lseek(fd, (off_t)(topslot * sizeof(struct utmp)), SEEK_SET); > ++ > ++ DEBUG(1,("pututline(%s, %s, %d); topslot=%d\n", > ++ u->ut_line, u->ut_name, claim, topslot)); > ++ > ++ while (1) { > ++ if (read(fd, &ubuf, sizeof(ubuf)) == sizeof(ubuf)) { > ++ if ((claim && !ubuf.ut_name[0]) || > ++ (!claim && ubuf.ut_name[0] && > ++ !strncmp(ubuf.ut_line, u->ut_line, > UT_LINESIZE))) { > ++ (void) lseek(fd, -(off_t)sizeof(struct utmp), > ++ SEEK_CUR); > ++ break; > ++ } > ++ topslot++; > ++ } else { > ++ (void) lseek(fd, (off_t)(topslot * > ++ sizeof(struct utmp)), SEEK_SET); > ++ break; > ++ } > ++ } > ++ > ++ if (!claim) { > ++ memset((char *)&u->ut_name, '\0', sizeof(u->ut_name)); > ++ memset((char *)&u->ut_host, '\0', sizeof(u->ut_host)); > ++ } > ++ (void) write(fd, u, sizeof(struct utmp)); > ++ > ++ (void) close(fd); > + } > + #endif /* HAVE_PUTUTLINE */ > + > diff -urN -x CVS net/samba/patches/patch-web_startstop_c > /usr/myports/net/samba/patches/patch-web_startstop_c > --- net/samba/patches/patch-web_startstop_c Fri May 27 06:54:40 2005 > +++ /usr/myports/net/samba/patches/patch-web_startstop_c Thu Jan 1 > 01:00:00 1970 > @@ -1,30 +0,0 @@ > -$OpenBSD: patch-web_startstop_c,v 1.1 2005/05/27 04:54:40 sturm Exp $ > ---- web/startstop.c.orig Thu May 26 14:44:50 2005 > -+++ web/startstop.c Thu May 26 14:46:16 2005 > -@@ -38,7 +38,7 @@ void start_smbd(void) > - > - become_daemon(True); > - > -- execl(binfile, binfile, "-D", NULL); > -+ execl(binfile, binfile, "-D", (void *)NULL); > - > - exit(0); > - } > -@@ -58,7 +58,7 @@ void start_nmbd(void) > - > - become_daemon(True); > - > -- execl(binfile, binfile, "-D", NULL); > -+ execl(binfile, binfile, "-D", (void *)NULL); > - > - exit(0); > - } > -@@ -78,7 +78,7 @@ void start_winbindd(void) > - > - become_daemon(True); > - > -- execl(binfile, binfile, NULL); > -+ execl(binfile, binfile, (void *)NULL); > - > - exit(0); > - } wrong. > diff -urN -x CVS net/samba/pkg/PLIST /usr/myports/net/samba/pkg/PLIST > --- net/samba/pkg/PLIST Fri Jun 3 19:13:47 2005 > +++ /usr/myports/net/samba/pkg/PLIST Fri May 27 08:20:06 2005 > @@ -1,4 +1,4 @@ > [EMAIL PROTECTED] $OpenBSD: PLIST,v 1.20 2005/05/27 04:54:40 sturm Exp $ > [EMAIL PROTECTED] $OpenBSD: PLIST,v 1.19 2005/04/03 11:20:38 mbalmer Exp $ > bin/findsmb > bin/mksmbpasswd > bin/net drop this useless part of the diff.