From a3e026396cdbc43139d0f40a0382575c22b09812 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Sun, 9 Apr 1995 09:20:47 +0000 Subject: [PATCH] The rmt protocol didn't allow to pass a file creation mode (permission bits) along, and rmt did the wrong thing in calling open(2) with random garbage as third parameter. Make it create new files with 0666 (modified by the umask of the remote shell anyway). This removed the last show-stopper from tar not working with remote archives. --- usr.sbin/rmt/rmt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr.sbin/rmt/rmt.c b/usr.sbin/rmt/rmt.c index 098e5025bfc..79b4bbc8346 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;