aboutsummaryrefslogtreecommitdiff
path: root/src/cmd
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-02-11 20:32:41 +0000
committerrsc <devnull@localhost>2005-02-11 20:32:41 +0000
commit6c0209f6f0eb41151397e4784730d2b6bca8d7ea (patch)
tree12a915fa08bf4f333bbad34f03347d4444729c07 /src/cmd
parent7d59ed711467b2b2c8ac25f86724225c8be7524c (diff)
downloadplan9port-6c0209f6f0eb41151397e4784730d2b6bca8d7ea.tar.gz
plan9port-6c0209f6f0eb41151397e4784730d2b6bca8d7ea.tar.bz2
plan9port-6c0209f6f0eb41151397e4784730d2b6bca8d7ea.zip
build changes
Diffstat (limited to 'src/cmd')
-rw-r--r--src/cmd/factotum/attr.c2
-rw-r--r--src/cmd/factotum/plan9.c65
-rw-r--r--src/cmd/tar.C2
-rw-r--r--src/cmd/vac/vac.c2
4 files changed, 6 insertions, 65 deletions
diff --git a/src/cmd/factotum/attr.c b/src/cmd/factotum/attr.c
index 98ffb2c9..b92e96a0 100644
--- a/src/cmd/factotum/attr.c
+++ b/src/cmd/factotum/attr.c
@@ -130,6 +130,7 @@ attrnamefmt(Fmt *fmt)
return fmtstrcpy(fmt, buf+1);
}
+/*
static int
hasqueries(Attr *a)
{
@@ -138,6 +139,7 @@ hasqueries(Attr *a)
return 1;
return 0;
}
+*/
char *ignored[] = {
"role",
diff --git a/src/cmd/factotum/plan9.c b/src/cmd/factotum/plan9.c
index 36082c3b..0b6bb601 100644
--- a/src/cmd/factotum/plan9.c
+++ b/src/cmd/factotum/plan9.c
@@ -12,73 +12,10 @@ memrandom(void *p, int n)
return 0;
}
-/*
- * create a change uid capability
- */
-static int caphashfd = -1;
-
-static char*
-mkcap(char *from, char *to)
-{
- uchar rand[20];
- char *cap;
- char *key;
- int nfrom, nto;
- uchar hash[SHA1dlen];
-
- if(caphashfd < 0)
- return nil;
-
- /* create the capability */
- nto = strlen(to);
- nfrom = strlen(from);
- cap = emalloc(nfrom+1+nto+1+sizeof(rand)*3+1);
- sprint(cap, "%s@%s", from, to);
- memrandom(rand, sizeof(rand));
- key = cap+nfrom+1+nto+1;
- enc64(key, sizeof(rand)*3, rand, sizeof(rand));
-
- /* hash the capability */
- hmac_sha1((uchar*)cap, strlen(cap), (uchar*)key, strlen(key), hash, nil);
-
- /* give the kernel the hash */
- key[-1] = '@';
- if(write(caphashfd, hash, SHA1dlen) < 0){
- free(cap);
- return nil;
- }
-
- return cap;
-}
-
Attr*
addcap(Attr *a, char *from, Ticket *t)
{
- char *cap;
-
- cap = mkcap(from, t->suid);
- return addattr(a, "cuid=%q suid=%q cap=%q", t->cuid, t->suid, cap);
-}
-
-/* bind in the default network and cs */
-static int
-bindnetcs(void)
-{
- int srvfd;
-
- if(access("/net/tcp", AEXIST) < 0)
- bind("#I", "/net", MBEFORE);
-
- if(access("/net/cs", AEXIST) < 0){
- if((srvfd = open("#s/cs", ORDWR)) >= 0){
- /* mount closes srvfd on success */
- if(mount(srvfd, -1, "/net", MBEFORE, "") >= 0)
- return 0;
- close(srvfd);
- }
- return -1;
- }
- return 0;
+ return addattr(a, "cuid=%q suid=%q cap=''", t->cuid, t->suid);
}
int
diff --git a/src/cmd/tar.C b/src/cmd/tar.C
index ae6ac61a..2b283aec 100644
--- a/src/cmd/tar.C
+++ b/src/cmd/tar.C
@@ -90,7 +90,7 @@ typedef union {
};
} Hdr;
-static int debug;
+int debug;
static int verb;
static int posix = 1;
static int creat;
diff --git a/src/cmd/vac/vac.c b/src/cmd/vac/vac.c
index f2595fff..93add14d 100644
--- a/src/cmd/vac/vac.c
+++ b/src/cmd/vac/vac.c
@@ -400,6 +400,8 @@ vacfile(DirSink *dsink, char *lname, char *sname, VacFile *vf)
if((dir = dirstat(sname)) == nil){
warn("could not stat file %s: %r", lname);
+ return;
+ }
if(dir->mode&(DMSYMLINK|DMDEVICE|DMNAMEDPIPE|DMSOCKET)){
free(dir);
return;