summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rmt
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1995-04-09 09:20:47 +0000
committerjoerg <joerg@FreeBSD.org>1995-04-09 09:20:47 +0000
commit6c7aaa6b29e2e0f0854b6dee5edfe103a5e5a67d (patch)
treebbfa4dab03762f521f9f58226114804d2825501b /usr.sbin/rmt
parent11c4653bbc51d33ebe2ba9bdf4b4039bb33a10b9 (diff)
downloadFreeBSD-src-6c7aaa6b29e2e0f0854b6dee5edfe103a5e5a67d.zip
FreeBSD-src-6c7aaa6b29e2e0f0854b6dee5edfe103a5e5a67d.tar.gz
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.
Diffstat (limited to 'usr.sbin/rmt')
-rw-r--r--usr.sbin/rmt/rmt.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/rmt/rmt.c b/usr.sbin/rmt/rmt.c
index 098e502..79b4bbc 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;
OpenPOWER on IntegriCloud