History

fiddle

Russ Cox committed 21 years ago

Commit 64b62a31 parent ad9a4044 files · +13 −23Browse files

Unified · Split

4 files
  1. cpu.c +10 −18
  2. drawterm.h +1 −1
  3. main.c +0 −2
  4. secstore.c +2 −2
cpu.c+10−18
@@ -99,7 +99,7 @@ mountfactotum(void) · 98 unmodified lines
99void99void
100cpumain(int argc, char **argv)100cpumain(int argc, char **argv)
101{101{
102 char dat[MaxStr], buf[MaxStr], cmd[MaxStr], *p, *err, *secstoreserver, *s;102 char dat[MaxStr], buf[MaxStr], cmd[MaxStr], *err, *secstoreserver, *s;
103 int fd, ms, data;103 int fd, ms, data;
104 104
105 /* see if we should use a larger message size */105 /* see if we should use a larger message size */
@@ -115,6 +115,12 @@ cpumain(int argc, char **argv) · 9 unmodified lines
115 if(user == nil)115 if(user == nil)
116 user = readcons("user", nil, 0);116 user = readcons("user", nil, 0);
117 secstoreserver = nil;117 secstoreserver = nil;
118 authserver = getenv("auth");
119 if(authserver == nil)
120 authserver = "auth";
121 system = getenv("cpu");
122 if(system == nil)
123 system = "cpu";
118 ARGBEGIN{124 ARGBEGIN{
119 case 'a':125 case 'a':
120 authserver = EARGF(usage());126 authserver = EARGF(usage());
@@ -154,6 +160,9 @@ cpumain(int argc, char **argv) · 33 unmodified lines
154 usage();160 usage();
155 }ARGEND;161 }ARGEND;
156 162
163 if(argc != 0)
164 usage();
165
157 if(mountfactotum() < 0){166 if(mountfactotum() < 0){
158 if(secstoreserver == nil)167 if(secstoreserver == nil)
159 secstoreserver = authserver;168 secstoreserver = authserver;
@@ -167,23 +176,6 @@ cpumain(int argc, char **argv) · 7 unmodified lines
167 }176 }
168 }177 }
169 178
170 if(argc != 0)
171 usage();
172
173 if(system == nil) {
174 p = getenv("cpu");
175 if(p == 0)
176 fatal(0, "set $cpu");
177 system = p;
178 }
179
180 if(authserver == nil) {
181 p = getenv("auth");
182 if(p == 0)
183 fatal(0, "set $auth");
184 authserver = p;
185 }
186
187 if((err = rexcall(&data, system, srvname)))179 if((err = rexcall(&data, system, srvname)))
188 fatal(1, "%s: %s", err, system);180 fatal(1, "%s: %s", err, system);
189 181
drawterm.h+1−1
@@ -2,7 +2,7 @@ extern int havesecstore(char *addr, char *owner); · 1 unmodified line
2extern char *secstore;2extern char *secstore;
3extern char secstorebuf[65536];3extern char secstorebuf[65536];
4extern char *secstorefetch(char *addr, char *owner, char *passwd);4extern char *secstorefetch(char *addr, char *owner, char *passwd);
5extern char *authaddr;5extern char *authserver;
6extern char *readcons(char *prompt, char *def, int secret);6extern char *readcons(char *prompt, char *def, int secret);
7extern int exportfs(int, int);7extern int exportfs(int, int);
8extern char *user;8extern char *user;
main.c+0−2
@@ -6,8 +6,6 @@ · 5 unmodified lines
6 6
7#include "drawterm.h"7#include "drawterm.h"
8 8
9char *authaddr = "auth";
10char *cpuaddr = "cpu";
11char *argv0;9char *argv0;
12char *user;10char *user;
13 11
secstore.c+2−2
@@ -41,9 +41,9 @@ secdial(char *secstore) · 40 unmodified lines
41 * like il!host or tcp!host or host.41 * like il!host or tcp!host or host.
42 */42 */
43 if(strcmp(p, "$auth")==0){43 if(strcmp(p, "$auth")==0){
44 if(authaddr == nil)44 if(authserver == nil)
45 return -1;45 return -1;
46 strecpy(buf, buf+sizeof buf, authaddr);46 strecpy(buf, buf+sizeof buf, authserver);
47 nf = getfields(buf, f, nelem(f), 0, "!");47 nf = getfields(buf, f, nelem(f), 0, "!");
48 switch(nf){48 switch(nf){
49 default:49 default:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t