aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vbackup
diff options
context:
space:
mode:
authorBrian L. Stuart <devnull@localhost>2008-07-20 04:50:09 -0400
committerBrian L. Stuart <devnull@localhost>2008-07-20 04:50:09 -0400
commitd63790eec8de5c9bf85f3c6daa1e6e756f0515c4 (patch)
treee08b57fa92af9b2843a6f01f9a57b5db27b69b3d /src/cmd/vbackup
parent94e1f2a4388f674331b2a2f988fb815133d2ab6b (diff)
downloadplan9port-d63790eec8de5c9bf85f3c6daa1e6e756f0515c4.tar.gz
plan9port-d63790eec8de5c9bf85f3c6daa1e6e756f0515c4.tar.bz2
plan9port-d63790eec8de5c9bf85f3c6daa1e6e756f0515c4.zip
vnfs: add -i flag to allow remote root
Diffstat (limited to 'src/cmd/vbackup')
-rw-r--r--src/cmd/vbackup/nfs3srv.c12
-rw-r--r--src/cmd/vbackup/nfs3srv.h2
-rw-r--r--src/cmd/vbackup/vnfs.c5
3 files changed, 14 insertions, 5 deletions
diff --git a/src/cmd/vbackup/nfs3srv.c b/src/cmd/vbackup/nfs3srv.c
index b2cdd9cf..c3fc780b 100644
--- a/src/cmd/vbackup/nfs3srv.c
+++ b/src/cmd/vbackup/nfs3srv.c
@@ -10,6 +10,8 @@
#include <nfs3.h>
#include "nfs3srv.h"
+int insecure = 0;
+
static SunStatus
authunixunpack(SunRpc *rpc, SunAuthUnix *au)
{
@@ -23,10 +25,12 @@ authunixunpack(SunRpc *rpc, SunAuthUnix *au)
ep = p+ai->ndata;
if(sunauthunixunpack(p, ep, &p, au) < 0)
return SunGarbageArgs;
- if(au->uid == 0)
- au->uid = -1;
- if(au->gid == 0)
- au->gid = -1;
+ if(!insecure){
+ if(au->uid == 0)
+ au->uid = -1;
+ if(au->gid == 0)
+ au->gid = -1;
+ }
return SunSuccess;
}
diff --git a/src/cmd/vbackup/nfs3srv.h b/src/cmd/vbackup/nfs3srv.h
index 79d4464e..f96be985 100644
--- a/src/cmd/vbackup/nfs3srv.h
+++ b/src/cmd/vbackup/nfs3srv.h
@@ -9,6 +9,8 @@ Nfs3Status fsreaddir(SunAuthUnix*, Nfs3Handle*, u32int, u64int, uchar**, u32int*
extern void nfs3proc(void*);
extern void mount3proc(void*);
+extern int insecure;
+
enum
{
MaxDataSize = 8192
diff --git a/src/cmd/vbackup/vnfs.c b/src/cmd/vbackup/vnfs.c
index 90f45a04..563cb270 100644
--- a/src/cmd/vbackup/vnfs.c
+++ b/src/cmd/vbackup/vnfs.c
@@ -74,7 +74,7 @@ u64int unittoull(char*);
void
usage(void)
{
- fprint(2, "usage: vnfs [-LLRVr] [-a addr] [-b blocksize] [-c cachesize] configfile\n");
+ fprint(2, "usage: vnfs [-LLRVir] [-a addr] [-b blocksize] [-c cachesize] configfile\n");
threadexitsall("usage");
}
@@ -128,6 +128,9 @@ threadmain(int argc, char **argv)
case 'c':
cachesize = unittoull(EARGF(usage()));
break;
+ case 'i':
+ insecure = 1;
+ break;
case 'r':
srv->alwaysreject++;
break;