diff options
author | tron <tron@pkgsrc.org> | 1998-04-26 09:32:56 +0000 |
---|---|---|
committer | tron <tron@pkgsrc.org> | 1998-04-26 09:32:56 +0000 |
commit | 1bef3ce69a74d72867073def443a186e6ded87aa (patch) | |
tree | 0ed651971ff31ce41fb3b33eb172dcf4c6eb5764 /net | |
parent | 7595c3dcae852fe388b06f572342355b3de53eed (diff) | |
download | pkgsrc-1bef3ce69a74d72867073def443a186e6ded87aa.tar.gz |
Initial import of FreeBSD's "rumba" port.
Diffstat (limited to 'net')
-rw-r--r-- | net/rumba/Makefile | 38 | ||||
-rw-r--r-- | net/rumba/files/Makefile.unrumba | 4 | ||||
-rw-r--r-- | net/rumba/files/md5 | 1 | ||||
-rw-r--r-- | net/rumba/files/unrumba.c | 73 | ||||
-rw-r--r-- | net/rumba/patches/patch-aa | 22 | ||||
-rw-r--r-- | net/rumba/patches/patch-ab | 148 | ||||
-rw-r--r-- | net/rumba/patches/patch-ac | 177 | ||||
-rw-r--r-- | net/rumba/patches/patch-ad | 46 | ||||
-rw-r--r-- | net/rumba/patches/patch-ae | 66 | ||||
-rw-r--r-- | net/rumba/patches/patch-af | 71 | ||||
-rw-r--r-- | net/rumba/patches/patch-ag | 99 | ||||
-rw-r--r-- | net/rumba/patches/patch-ah | 34 | ||||
-rw-r--r-- | net/rumba/patches/patch-ai | 12 | ||||
-rw-r--r-- | net/rumba/patches/patch-aj | 29 | ||||
-rw-r--r-- | net/rumba/pkg/COMMENT | 1 | ||||
-rw-r--r-- | net/rumba/pkg/DESCR | 18 | ||||
-rw-r--r-- | net/rumba/pkg/PLIST | 4 |
17 files changed, 843 insertions, 0 deletions
diff --git a/net/rumba/Makefile b/net/rumba/Makefile new file mode 100644 index 00000000000..a1fffab4ce2 --- /dev/null +++ b/net/rumba/Makefile @@ -0,0 +1,38 @@ +# New ports collection makefile for: rumba +# Version required: 0.4 +# Date created: 14 June 1997 +# Whom: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru> +# +# $FreeBSD Id: Makefile,v 1.2 1997/07/21 19:28:46 max Exp +# + +DISTNAME= rumba.0.4.s +PKGNAME= rumba-0.4 +CATEGORIES= net +MASTER_SITES= ftp://hal.kph.tuwien.ac.at/pub/NeXT/tools/rumba/ \ + ftp://next-ftp.peak.org/pub/next/apps/utils/networks/ +EXTRACT_SUFX= .gnutar.gz + +MAINTAINER= dima@tejblum.dnttm.rssi.ru + +USE_GMAKE= yes +MAKE_ENV= PWD=${WRKSRC} +MAN8= smbmount.8 + +post-extract: + @${MKDIR} work/unrumba + @${CP} ${FILESDIR}/unrumba.c ${WRKDIR}/unrumba + @${CP} files/Makefile.unrumba ${WRKDIR}/unrumba/Makefile + +post-build: + cd ${WRKDIR}/unrumba && make + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/rumba ${PREFIX}/sbin + ${INSTALL_PROGRAM} ${WRKDIR}/unrumba/unrumba ${PREFIX}/sbin +.if !defined(NOPORTDOCS) + ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/README.rumba +.endif + ${INSTALL_MAN} ${WRKSRC}/smbmount.8 ${PREFIX}/man/man8 + +.include <bsd.port.mk> diff --git a/net/rumba/files/Makefile.unrumba b/net/rumba/files/Makefile.unrumba new file mode 100644 index 00000000000..d7830b93f2d --- /dev/null +++ b/net/rumba/files/Makefile.unrumba @@ -0,0 +1,4 @@ +PROG=unrumba +NOMAN=sorry + +.include <bsd.prog.mk> diff --git a/net/rumba/files/md5 b/net/rumba/files/md5 new file mode 100644 index 00000000000..f64f6faa789 --- /dev/null +++ b/net/rumba/files/md5 @@ -0,0 +1 @@ +MD5 (rumba.0.4.s.gnutar.gz) = 7a3fc82f8e108b8d05decb11d45c09c4 diff --git a/net/rumba/files/unrumba.c b/net/rumba/files/unrumba.c new file mode 100644 index 00000000000..8dd157c1179 --- /dev/null +++ b/net/rumba/files/unrumba.c @@ -0,0 +1,73 @@ +#include <sys/param.h> +#include <sys/mount.h> + +#include <err.h> +#include <sysexits.h> +#include <unistd.h> +#include <stdlib.h> +#include <signal.h> + +static void usage(void); + +int +main(int argc, char** argv) +{ + struct statfs* mntbuf; + int mntcount, i; + int aflag=0; + int ch; + + while ( (ch = getopt(argc, argv, "a")) != -1) { + switch (ch) { + case 'a': + aflag=1; + break; + case '?': + default: + usage(); + } + } + argc -= optind; + argv += optind; + if (aflag && argc != 0) + usage(); + if (!aflag && argc == 0) + usage(); + + for (; argc>0 || aflag; aflag?(void)(aflag=0):(void)(argc--, argv++)) { + char abspath[MAXPATHLEN]; + pid_t pid=0; + if (argc > 0) { + if (realpath(argv[0], abspath) == 0) { + warn(abspath); + continue; + } + } + mntcount=getmntinfo(&mntbuf, MNT_NOWAIT); + if (mntcount < 0) + err(EX_OSERR, "getmntinfo"); + for (i=0; i<mntcount; i++) { + char* s; + int error; + if (argc > 0 && strcmp(abspath, mntbuf[i].f_mntonname) != 0) continue; + if (mntbuf[i].f_type != MOUNT_NFS) continue; + if (strncmp(mntbuf[i].f_mntfromname, "rumba-", 6) != 0) continue; + pid=strtoul(mntbuf[i].f_mntfromname+6, &s, 10); + if (*s) continue; + error = unmount (mntbuf[i].f_mntonname, 0); + if (error == 0) { + kill (pid, SIGHUP); + } else { + warn(mntbuf[i].f_mntonname); + } + } + if (argc > 0 && !pid) + warnx("%s: not currently mounted", abspath); + } +} + +void +usage(void) +{ + errx(EX_USAGE, "Usage: unrumba [-a] [node]"); +} diff --git a/net/rumba/patches/patch-aa b/net/rumba/patches/patch-aa new file mode 100644 index 00000000000..f298c6ee686 --- /dev/null +++ b/net/rumba/patches/patch-aa @@ -0,0 +1,22 @@ +*** ../rumba.0.4.s/./my_include/asm/types.h Thu Jan 2 17:25:14 1997 +--- ./my_include/asm/types.h Sun Jun 15 02:46:57 1997 +*************** +*** 8,15 **** + + extern int printk(const char *format, ...); + +! +! typedef unsigned short mode_t; + + typedef signed char s8; + typedef signed char __s8; +--- 8,16 ---- + + extern int printk(const char *format, ...); + +! #if BYTE_ORDER==LITTLE_ENDIAN +! #define __LITTLE_ENDIAN__ +! #endif + + typedef signed char s8; + typedef signed char __s8; diff --git a/net/rumba/patches/patch-ab b/net/rumba/patches/patch-ab new file mode 100644 index 00000000000..d86d94dddc0 --- /dev/null +++ b/net/rumba/patches/patch-ab @@ -0,0 +1,148 @@ +*** nfs/syscalls.c.orig Thu Jan 16 20:55:59 1997 +--- nfs/syscalls.c Tue Jul 1 13:18:52 1997 +*************** +*** 21,27 **** + #ifdef NeXT + # include <nfs/nfs_mount.h> + int syscall_mount(char *dir, void *root_fh, int sock_fd, +! struct sockaddr_in *socket) + { + struct nfs_args nfs_args; + +--- 21,27 ---- + #ifdef NeXT + # include <nfs/nfs_mount.h> + int syscall_mount(char *dir, void *root_fh, int sock_fd, +! struct sockaddr_in *socket, char* mntfrom) + { + struct nfs_args nfs_args; + +*************** +*** 39,50 **** + nfs_args.netname = "net"; + return mount(MOUNT_NFS, dir, 0, (caddr_t)&nfs_args); + } + #endif + /* ------------------------------------------------------------------------- */ + #ifdef linux + # include <linux/nfs_mount.h> + int syscall_mount(char *dir, void *root_fh, int sock_fd, +! struct sockaddr_in *sockaddr) + { + struct nfs_mount_data nfs_args; + int ksock, kport; +--- 39,139 ---- + nfs_args.netname = "net"; + return mount(MOUNT_NFS, dir, 0, (caddr_t)&nfs_args); + } ++ ++ int syscall_unmount(char* dir) ++ { ++ unmount(dir); ++ } ++ #endif ++ /* ------------------------------------------------------------------------- */ ++ #ifdef BSD4_4 ++ #define NFSX_V2FH 32 ++ #ifdef BSD4_4_LITE2 ++ #include <nfs/rpcv2.h> ++ #include <nfs/nfs.h> ++ #endif ++ int syscall_mount(char *dir, void *root_fh, int sock_fd, ++ struct sockaddr_in *socket, char* mntfrom) ++ { ++ struct nfs_args nfs_args; ++ #ifdef __FreeBSD__ ++ #ifdef _NEW_VFSCONF ++ struct vfsconf vfc; ++ int error; ++ #else ++ struct vfsconf* vfc; ++ #endif ++ #endif ++ ++ bzero(&nfs_args, sizeof(nfs_args)); ++ #ifdef BSD4_4_LITE2 ++ nfs_args.version = NFS_ARGSVERSION; ++ #endif ++ nfs_args.wsize = 8192; ++ nfs_args.rsize = 8192; ++ nfs_args.retrans = 0; ++ nfs_args.timeo = 100; /* 10s timeout */ ++ nfs_args.addr = (struct sockaddr*)socket; ++ nfs_args.addrlen = sizeof(*socket); ++ nfs_args.sotype = SOCK_DGRAM; ++ nfs_args.flags = NFSMNT_SOFT | ++ NFSMNT_RETRANS | NFSMNT_TIMEO | ++ NFSMNT_WSIZE | NFSMNT_RSIZE; ++ nfs_args.fh = (char *)root_fh; ++ nfs_args.fhsize = NFSX_V2FH; ++ nfs_args.hostname = mntfrom; ++ #ifdef BSD4_4_LITE2 ++ #define NFSNAME "nfs" ++ #else ++ #define NFSNAME MOUNT_NFS ++ #endif ++ #ifdef __FreeBSD__ ++ #ifdef _NEW_VFSCONF ++ #define GETVFSBYNAME error = getvfsbyname("nfs", &vfc) ++ #define VFCERROR error ++ #define VFCNFSNAME vfc.vfc_name ++ #else ++ #define GETVFSBYNAME vfc = getvfsbyname("nfs") ++ #define VFCERROR !vfc ++ #define VFCNFSNAME vfc->vfc_index ++ #endif ++ GETVFSBYNAME; ++ if (VFCERROR && vfsisloadable("nfs")) { ++ if(vfsload("nfs")) ++ return -1; ++ endvfsent(); /* clear cache */ ++ GETVFSBYNAME; ++ } ++ if (VFCERROR) ++ return -1; ++ return mount(VFCNFSNAME, dir, 0, &nfs_args); ++ #else ++ return mount(NFSNAME, dir, 0, &nfs_args); ++ #endif ++ } ++ ++ int syscall_unmount(char* dir) ++ { ++ struct statfs* mntbuf; ++ int count, i; ++ ++ if ((count = getmntinfo(&mntbuf, MNT_NOWAIT)) < 0) ++ return -1; ++ for (i=0; i<count; i++) { ++ if (strcmp(mntbuf[i].f_mntonname, dir) == 0) { ++ return unmount(dir,0); ++ } ++ } ++ errno = ENOENT; ++ return -1; ++ } ++ + #endif + /* ------------------------------------------------------------------------- */ + #ifdef linux + # include <linux/nfs_mount.h> + int syscall_mount(char *dir, void *root_fh, int sock_fd, +! struct sockaddr_in *sockaddr, char* mntfrom) + { + struct nfs_mount_data nfs_args; + int ksock, kport; +*************** +*** 92,97 **** +--- 181,190 ---- + exit(1); + } + return mount("rumba:/", dir, "nfs", 0xc0ed0000, &nfs_args); ++ } ++ int syscall_unount(char* dir) ++ { ++ umount(dir); + } + #endif + /* ------------------------------------------------------------------------- */ diff --git a/net/rumba/patches/patch-ac b/net/rumba/patches/patch-ac new file mode 100644 index 00000000000..8f5fe534eee --- /dev/null +++ b/net/rumba/patches/patch-ac @@ -0,0 +1,177 @@ +*** ../rumba.0.4.s/./nfs/mount.c Thu Jan 16 20:31:24 1997 +--- ./nfs/mount.c Tue Jun 17 00:14:51 1997 +*************** +*** 14,20 **** +--- 14,22 ---- + #include "nfs_prot.h" + #include <netdb.h> + #include <arpa/inet.h> ++ #ifdef DEAL_WITH_MTAB + #include <mntent.h> ++ #endif + #include "my_defines.h" + + #define DPRINTF(arg) if(debug_mode & DEBUG_NFS) dprintf arg +*************** +*** 24,30 **** +--- 26,34 ---- + static int do_exit = 0; + static int do_nfsumount = 0; + ++ #ifdef DEAL_WITH_MTAB + #define MTAB_TMP (MOUNTED ".tmp") ++ #endif + + /* ------------------------------------------------------------------------- */ + +*************** +*** 37,47 **** + + static void nfs_unmount(void) + { + FILE *fpout, *fpin; + struct mntent *ent; + + dprintf("Going to unmount NFS...\n"); +! while(unmount(mntdir)){ + if(errno != ENOENT) + my_perror(mntdir); + if(errno != EBUSY){ +--- 41,53 ---- + + static void nfs_unmount(void) + { ++ #ifdef DEAL_WITH_MTAB + FILE *fpout, *fpin; + struct mntent *ent; ++ #endif + + dprintf("Going to unmount NFS...\n"); +! while(syscall_unmount(mntdir)){ + if(errno != ENOENT) + my_perror(mntdir); + if(errno != EBUSY){ +*************** +*** 49,54 **** +--- 55,61 ---- + } + sleep(1); + } ++ #ifdef DEAL_WITH_MTAB + /* update mtab */ + if((fpout = setmntent(MTAB_TMP, "w")) == NULL){ + my_perror(MTAB_TMP); +*************** +*** 68,73 **** +--- 75,81 ---- + unlink(MTAB_TMP); + } + } ++ #endif + dprintf("NFS unmounted.\n"); + } + +*************** +*** 130,136 **** + + void mount_and_dispatch(char *dir, void (*proc)(), void *root_fh, int bg) + { +! int sock, port, child_pid, parent_pid, other_pid; + struct sockaddr_in sain; + SVCXPRT *nfsxprt; + int bufsiz = 0xc000; /* room for a few biods */ +--- 138,144 ---- + + void mount_and_dispatch(char *dir, void (*proc)(), void *root_fh, int bg) + { +! int sock, child_pid, parent_pid, other_pid; + struct sockaddr_in sain; + SVCXPRT *nfsxprt; + int bufsiz = 0xc000; /* room for a few biods */ +*************** +*** 162,180 **** + if(setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&bufsiz,sizeof(bufsiz))) + my_perror("setsockopt"); + +- /* Bind it to a reserved port */ + sain.sin_family = AF_INET; +! sain.sin_addr.s_addr = inet_addr("127.0.0.1"); +! for(port = IPPORT_RESERVED-1; port > IPPORT_RESERVED/2; port--){ +! DPRINTF(("trying to use port %d\n", port)); +! sain.sin_port = htons(port); +! if(bind(sock, (struct sockaddr *) &sain, sizeof(sain)) >= 0) +! break; + } +! dprintf("Using port %d for NFS.\n", port); +! if(port <= IPPORT_RESERVED/2){ +! my_perror("bind to reserved port"); exit(1); +! } + if((nfsxprt = svcudp_create(sock)) == 0){ + my_perror("svcudp_create"); exit(1); + } +--- 170,186 ---- + if(setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&bufsiz,sizeof(bufsiz))) + my_perror("setsockopt"); + + sain.sin_family = AF_INET; +! sain.sin_addr.s_addr = htonl(INADDR_LOOPBACK); +! if (bind(sock, (struct sockaddr*) &sain, sizeof(sain)) >= 0) { +! int namelen=sizeof(sain); +! if (getsockname(sock, (struct sockaddr*) &sain, &namelen) <0) { +! my_perror("getsockname"); exit(1); +! } +! } else { +! my_perror("bind"); exit(1); + } +! dprintf("Using port %d for NFS.\n", ntohs(sain.sin_port)); + if((nfsxprt = svcudp_create(sock)) == 0){ + my_perror("svcudp_create"); exit(1); + } +*************** +*** 198,214 **** + if((child_pid == 0 && bg) || (child_pid != 0 && !bg)){ + dispatch_loop(); + }else{ + DPRINTF(("Going to mount...\n")); + other_pid = child_pid == 0 ? parent_pid : child_pid; +! if(syscall_mount(dir, root_fh, sock, &sain) < 0){ + eprintf("nfs mount %s: [%d] %s\n", dir, errno, strerror(errno)); + kill(other_pid, SIGKILL); + }else{ + FILE *fp; + struct mntent mnt; +- char fsname[256]; + +- sprintf(fsname, "rumba-%d", other_pid); + mnt.mnt_fsname = fsname; + mnt.mnt_dir = mntdir; + mnt.mnt_type = "nfs"; +--- 204,221 ---- + if((child_pid == 0 && bg) || (child_pid != 0 && !bg)){ + dispatch_loop(); + }else{ ++ char fsname[256]; + DPRINTF(("Going to mount...\n")); + other_pid = child_pid == 0 ? parent_pid : child_pid; +! sprintf(fsname, "rumba-%d", other_pid); +! if(syscall_mount(dir, root_fh, sock, &sain, fsname) < 0){ + eprintf("nfs mount %s: [%d] %s\n", dir, errno, strerror(errno)); + kill(other_pid, SIGKILL); + }else{ ++ #ifdef DEAL_WITH_MTAB + FILE *fp; + struct mntent mnt; + + mnt.mnt_fsname = fsname; + mnt.mnt_dir = mntdir; + mnt.mnt_type = "nfs"; +*************** +*** 219,224 **** +--- 226,232 ---- + else + my_perror(MOUNTED); + endmntent(fp); ++ #endif + } + exit(0); + } diff --git a/net/rumba/patches/patch-ad b/net/rumba/patches/patch-ad new file mode 100644 index 00000000000..b93d35c1c24 --- /dev/null +++ b/net/rumba/patches/patch-ad @@ -0,0 +1,46 @@ +--- Makefile.orig Mon Feb 10 13:30:00 1997 ++++ Makefile Tue Jul 15 15:54:21 1997 +@@ -17,16 +17,21 @@ + ############################################################################## + + # For NEXTSTEP/OPENSTEP: +-CFLAGS = -Wall -O2 -traditional-cpp -g +-INCLUDES = -I$(MYINCL) -I$(INCL) ++#CFLAGS = -Wall -O2 -traditional-cpp -g ++#INCLUDES = -I$(MYINCL) -I$(INCL) + # put your architecture here: +-ARCH = -arch i386 +-THE_CC = cc ++#ARCH = -arch i386 ++#THE_CC = cc + + # For Linux: + #CFLAGS = -Wall -O2 -g + #INCLUDES = -I$(INCL) + ++# For FreeBSD ++CFLAGS = -Wall -O2 ++INCLUDES = -I$(MYINCL) -I$(INCL) ++THE_CC = cc ++ + ############################################################################## + ######################## End of system specific part ######################### + ############################################################################## +@@ -38,7 +43,7 @@ + OFILES = proc.o sock.o rumba.o psinode.o kernel.o smb_abstraction.o fo_nfs.o + + .c.o: +- $(CC) $(CFLAGS) $(ARCH) -c -o $*.o $< ++ $(CC) $(CFLAGS) -c -o $*.o $< + + all: $(NAME) + +@@ -46,7 +51,7 @@ + $(MAKE) -C nfs + + $(NAME): $(OFILES) nfs_dir +- $(CC) $(ARCH) -o $(NAME) $(OFILES) nfs/nfs.o ++ $(CC) -o $(NAME) $(OFILES) nfs/nfs.o + + clean: + rm -f $(OFILES) diff --git a/net/rumba/patches/patch-ae b/net/rumba/patches/patch-ae new file mode 100644 index 00000000000..38e7e931a79 --- /dev/null +++ b/net/rumba/patches/patch-ae @@ -0,0 +1,66 @@ +*** ../rumba.0.4.s/./syshdr.h Fri Jan 3 19:24:59 1997 +--- ./syshdr.h Sun Jun 15 14:19:57 1997 +*************** +*** 19,26 **** +--- 19,43 ---- + #include <sys/errno.h> + #include <errno.h> + #include <sys/param.h> ++ ++ #ifdef __FreeBSD__ ++ #include <osreldate.h> ++ #if __FreeBSD_version >= 300000 ++ #define BSD4_4_LITE2 ++ #endif ++ #endif ++ #if defined(BSD4_4) && !defined(BSD4_4_LITE2) ++ #define BSD4_4_LITE ++ #endif ++ + #include <sys/stat.h> + #include <signal.h> ++ #ifdef BSD4_4 ++ #define NFS ++ #endif ++ #ifdef BSD4_4_LITE2 ++ #define _NEW_VFSCONF ++ #endif + #include <sys/mount.h> + #include <stdarg.h> + /* +*************** +*** 30,39 **** + /* ------------------------------------------------------------------------- */ + #ifdef NeXT + # include <libc.h> + #endif + /* ------------------------------------------------------------------------- */ + #ifdef linux +! # define unmount umount + #endif + /* ------------------------------------------------------------------------- */ + /* +--- 47,57 ---- + /* ------------------------------------------------------------------------- */ + #ifdef NeXT + # include <libc.h> ++ # define DEAL_WITH_MTAB + #endif + /* ------------------------------------------------------------------------- */ + #ifdef linux +! # define DEAL_WITH_MTAB + #endif + /* ------------------------------------------------------------------------- */ + /* +*************** +*** 41,44 **** + */ + struct sockaddr_in; /* possibly not defined in any header... */ + extern int syscall_mount(char *dir, void *root_fh, int sock_fd, +! struct sockaddr_in *socket); +--- 59,63 ---- + */ + struct sockaddr_in; /* possibly not defined in any header... */ + extern int syscall_mount(char *dir, void *root_fh, int sock_fd, +! struct sockaddr_in *socket, char* fsname); +! extern int syscall_unmount(char* dir); diff --git a/net/rumba/patches/patch-af b/net/rumba/patches/patch-af new file mode 100644 index 00000000000..cd0bf82e49d --- /dev/null +++ b/net/rumba/patches/patch-af @@ -0,0 +1,71 @@ +*** ../rumba.0.4.s/./rumba.c Mon Feb 10 15:08:50 1997 +--- ./rumba.c Sun Jun 15 14:17:02 1997 +*************** +*** 216,222 **** + struct passwd *pwd; + struct group *grp; + char mountpoint_abs[MAXPATHLEN + 1]; +- char hostname[MAXHOSTNAMELEN + 1]; + struct hostent *h; + int got_password, upcase_password; + int port = -1, max_xmit = -1; +--- 216,221 ---- +*************** +*** 231,237 **** + got_password = 0; + upcase_password = 1; + run_as_daemon = 1; +- memset(hostname, 0, sizeof(hostname)); + if(argc < 2 || (argc == 2 && strcmp(argv[1], "-h") == 0)){ + help(); + exit(0); +--- 230,235 ---- +*************** +*** 239,248 **** + if(argc == 2 && strcmp(argv[1], "-v") == 0){ + print_version(); + } +! gethostname(hostname, MAXHOSTNAMELEN); + if (geteuid() != 0) { + eprintf("%s must be installed suid root\n", progname); + } + mount_point = argv[2]; + if(extract_service(argv[1], &server, &share, &root, &user_dummy) != 0) { + usage(); +--- 237,247 ---- + if(argc == 2 && strcmp(argv[1], "-v") == 0){ + print_version(); + } +! #ifndef BSD4_4_LITE2 + if (geteuid() != 0) { + eprintf("%s must be installed suid root\n", progname); + } ++ #endif + mount_point = argv[2]; + if(extract_service(argv[1], &server, &share, &root, &user_dummy) != 0) { + usage(); +*************** +*** 393,398 **** +--- 392,403 ---- + password, max_xmit, port) != 0){ + exit(1); + } ++ #ifdef BSD4_4 ++ if (realpath(mount_point, mountpoint_abs) == NULL) { ++ perror(mount_point); ++ exit (1); ++ } ++ #else + if(*mount_point == '/'){ /* absolute path given? */ + strcpy(mountpoint_abs, mount_point); + }else{ +*************** +*** 403,408 **** +--- 408,414 ---- + } + strcat(mountpoint_abs, mount_point); + } ++ #endif + mount_and_dispatch(mountpoint_abs, nfs_dispatch, root_fh, run_as_daemon); + return 0; + } diff --git a/net/rumba/patches/patch-ag b/net/rumba/patches/patch-ag new file mode 100644 index 00000000000..18d76e47bd0 --- /dev/null +++ b/net/rumba/patches/patch-ag @@ -0,0 +1,99 @@ +*** smb_abstraction.c.orig Wed Feb 5 16:50:50 1997 +--- smb_abstraction.c Sat Jul 5 20:50:15 1997 +*************** +*** 118,123 **** +--- 118,128 ---- + memset(&data, 0, sizeof(struct smb_mount_data)); + memset(hostname, 0, sizeof(hostname)); + gethostname(hostname, MAXHOSTNAMELEN); ++ { ++ char* s=strchr(hostname, '.'); ++ if (s) ++ *s=0; ++ } + + if((h = gethostbyname(p->server_ipname)) == NULL){ + eprintf("%s: unknown host\n", p->server_ipname); +*************** +*** 133,147 **** +--- 138,159 ---- + } + data.version = SMB_MOUNT_VERSION; + strncpy(data.service, p->service, sizeof(data.service)); ++ data.service[sizeof(data.service)-1] = 0; ++ str_upper(data.service); + strncpy(data.root_path, p->root_path, sizeof(data.root_path)); ++ data.root_path[sizeof(data.root_path)-1] = 0; + strncpy(data.username, p->username, sizeof(data.username)); ++ data.username[sizeof(data.username)-1] = 0; + strncpy(data.password, p->password, sizeof(data.password)); ++ data.password[sizeof(data.password)-1] = 0; + if(p->max_xmit > 0) + data.max_xmit = p->max_xmit; + else + data.max_xmit = 4070; + strncpy(data.server_name, p->server_name, sizeof(data.server_name)); ++ data.server_name[sizeof(data.server_name)-1]=0; + strncpy(data.client_name, p->client_name, sizeof(data.client_name)); ++ data.client_name[sizeof(data.client_name)-1]=0; + + if(data.server_name[0] == 0){ + if(strlen(p->server_ipname) > 16){ +*************** +*** 150,157 **** + goto error_occured; + } + strcpy(data.server_name, p->server_ipname); +- str_upper(data.server_name); + } + if(data.client_name[0] == 0) { + if(strlen(hostname) > 16) { + eprintf("my hostname name too long for netbios: %s\n", hostname); +--- 162,169 ---- + goto error_occured; + } + strcpy(data.server_name, p->server_ipname); + } ++ str_upper(data.server_name); + if(data.client_name[0] == 0) { + if(strlen(hostname) > 16) { + eprintf("my hostname name too long for netbios: %s\n", hostname); +*************** +*** 446,451 **** +--- 458,464 ---- + + int smba_setattr(smba_file_t *f, smba_stat_t *data) + { ++ int error = 0; + if(data->atime != -1) + f->dirent.atime = data->atime; + if(data->ctime != -1) +*************** +*** 456,462 **** + if(data->is_wp) + f->dirent.attr |= aRONLY; + f->attr_dirty = 1; +! return write_attr(f); + } + + /* ------------------------------------------------------------------------- */ +--- 469,487 ---- + if(data->is_wp) + f->dirent.attr |= aRONLY; + f->attr_dirty = 1; +! error = write_attr(f); +! if (error) +! return error; +! if (data->size == -1) +! return error; +! if (data->size == f->dirent.size) +! return error; +! if ( (error = make_open(f, 1)) < 0) +! return error; +! if ( (error = smb_proc_trunc(&f->server->server, f->dirent.fileid, data->size)) < 0) +! return error; +! f->dirent.size = data->size; +! return error; + } + + /* ------------------------------------------------------------------------- */ diff --git a/net/rumba/patches/patch-ah b/net/rumba/patches/patch-ah new file mode 100644 index 00000000000..7e18f16ff18 --- /dev/null +++ b/net/rumba/patches/patch-ah @@ -0,0 +1,34 @@ +*** proc.c.orig Sat Jul 5 20:26:58 1997 +--- proc.c Sat Jul 5 20:48:56 1997 +*************** +*** 920,926 **** + + smb_lock_server(server); + +- retry: + p = smb_setup_header(server, SMBwrite, 5, 3); + WSET(buf, smb_vwv0, fid); + WSET(buf, smb_vwv1, 0); +--- 920,925 ---- +*************** +*** 928,938 **** + WSET(buf, smb_vwv4, 0); + smb_encode_ascii(p, "", 0); + +! if ((result = smb_request_ok(server, SMBwrite, 1, 0)) < 0) { +! if (smb_retry(server)) { +! goto retry; +! } +! } + smb_unlock_server(server); + return result; + } +--- 927,934 ---- + WSET(buf, smb_vwv4, 0); + smb_encode_ascii(p, "", 0); + +! result = smb_request_ok(server, SMBwrite, 1, 0); +! + smb_unlock_server(server); + return result; + } diff --git a/net/rumba/patches/patch-ai b/net/rumba/patches/patch-ai new file mode 100644 index 00000000000..3db0da5ee69 --- /dev/null +++ b/net/rumba/patches/patch-ai @@ -0,0 +1,12 @@ +*** fo_nfs.c.orig Wed Feb 5 16:50:46 1997 +--- fo_nfs.c Mon Jul 7 17:42:22 1997 +*************** +*** 142,147 **** +--- 142,148 ---- + smbattr->atime = attr->atime; + smbattr->mtime = attr->mtime; + smbattr->ctime = attr->ctime; ++ smbattr->size = attr->size; + } + + /* ------------------------------------------------------------------------- */ diff --git a/net/rumba/patches/patch-aj b/net/rumba/patches/patch-aj new file mode 100644 index 00000000000..f23a37ee07b --- /dev/null +++ b/net/rumba/patches/patch-aj @@ -0,0 +1,29 @@ +--- nfs/Makefile.orig Sat Dec 14 21:58:42 1996 ++++ nfs/Makefile Tue Jul 15 15:47:33 1997 +@@ -15,8 +15,8 @@ + + RPCGEN = rpcgen + +-CFLAGS = -g -I. -I.. +-LDFLAGS = -g ++CFLAGS += -I. -I.. ++LDFLAGS += + WARNFLAGS = -Wall + RPC_WARNFLAGS = -Wno-unused -Wno-switch -Wno-uninitialized + TRANSPORTFLAGS = -s udp -s tcp +@@ -26,13 +26,13 @@ + + all: nfs.o + +-COMPILE = $(CC) $(ARCH) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARNFLAGS) ++COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) $(CFLAGS) $(WARNFLAGS) + + .c.o: + $(COMPILE) $< + + nfs.o: $(OFILES) +- $(LD) $(ARCH) -r -o $@ $(OFILES) ++ $(LD) -r -o $@ $(OFILES) + + nfs_prot.h: nfs_prot.x + rm -f $@ diff --git a/net/rumba/pkg/COMMENT b/net/rumba/pkg/COMMENT new file mode 100644 index 00000000000..8963897906d --- /dev/null +++ b/net/rumba/pkg/COMMENT @@ -0,0 +1 @@ +An userland smbfs --- SMB to NFS protocols converter diff --git a/net/rumba/pkg/DESCR b/net/rumba/pkg/DESCR new file mode 100644 index 00000000000..22f194983ec --- /dev/null +++ b/net/rumba/pkg/DESCR @@ -0,0 +1,18 @@ +It is part of author's Announcment: + +This is the first public release of rumba. If you want a short +description of what rumba can do for you: you can mount volumes exported +by Windows or related operating systems on your Unix machine. For a more +detailed description I will quote from the README file: + + +What does rumba do? +=================== +If you know smbfs for Linux: rumba is roughly the same. It is derived +from smbfs, but runs as a user level program, not in the kernel. If you +know samba: rumba is roughly the opposite: a client for the Lanmanager +protocol. If you know neither of these: rumba lets you mount drives +exported by Windows (f.Workgroups/95/NT), Lan Manager, OS/2 etc. on +Unix machines. + + diff --git a/net/rumba/pkg/PLIST b/net/rumba/pkg/PLIST new file mode 100644 index 00000000000..7ef1c82eaaf --- /dev/null +++ b/net/rumba/pkg/PLIST @@ -0,0 +1,4 @@ +sbin/rumba +sbin/unrumba +man/man8/smbmount.8.gz +share/doc/README.rumba |