summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rmt
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/rmt')
-rw-r--r--usr.sbin/rmt/Makefile7
-rw-r--r--usr.sbin/rmt/rmt.c9
2 files changed, 13 insertions, 3 deletions
diff --git a/usr.sbin/rmt/Makefile b/usr.sbin/rmt/Makefile
index c55ae71..166d458 100644
--- a/usr.sbin/rmt/Makefile
+++ b/usr.sbin/rmt/Makefile
@@ -1,6 +1,11 @@
# @(#)Makefile 8.1 (Berkeley) 6/6/93
PROG= rmt
-MAN8= rmt.0
+MAN8= rmt.8
+
+# called from /usr/src/etc/Makefile
+etc-rmt:
+ rm -f ${DESTDIR}/etc/rmt
+ ln -s ${BINDIR}/rmt ${DESTDIR}/etc/rmt
.include <bsd.prog.mk>
diff --git a/usr.sbin/rmt/rmt.c b/usr.sbin/rmt/rmt.c
index 098e502..9a60527 100644
--- a/usr.sbin/rmt/rmt.c
+++ b/usr.sbin/rmt/rmt.c
@@ -104,7 +104,12 @@ top:
getstring(device);
getstring(mode);
DEBUG2("rmtd: O %s %s\n", device, mode);
- tape = open(device, atoi(mode));
+ /*
+ * XXX the rmt protocol does not provide a means to
+ * specify the permission bits; allow rw for everyone,
+ * as modified by the users umask
+ */
+ tape = open(device, atoi(mode), 0666);
if (tape < 0)
goto ioerror;
goto respond;
@@ -239,6 +244,6 @@ error(num)
{
DEBUG2("rmtd: E %d (%s)\n", num, strerror(num));
- (void)sprintf(resp, "E%d\n%s\n", num, strerror(num));
+ (void)snprintf(resp, sizeof(resp), "E%d\n%s\n", num, strerror(num));
(void)write(1, resp, strlen(resp));
}
OpenPOWER on IntegriCloud