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
9999 void
100100 cpumain(int argc, char **argv)
101101 {
102− char dat[MaxStr], buf[MaxStr], cmd[MaxStr], *p, *err, *secstoreserver, *s;
102+ char dat[MaxStr], buf[MaxStr], cmd[MaxStr], *err, *secstoreserver, *s;
103103 int fd, ms, data;
104104
105105 /* see if we should use a larger message size */
@@ -115,6 +115,12 @@ cpumain(int argc, char **argv) · 9 unmodified lines
115115 if(user == nil)
116116 user = readcons("user", nil, 0);
117117 secstoreserver = nil;
118+ authserver = getenv("auth");
119+ if(authserver == nil)
120+ authserver = "auth";
121+ system = getenv("cpu");
122+ if(system == nil)
123+ system = "cpu";
118124 ARGBEGIN{
119125 case 'a':
120126 authserver = EARGF(usage());
@@ -154,6 +160,9 @@ cpumain(int argc, char **argv) · 33 unmodified lines
154160 usage();
155161 }ARGEND;
156162
163+ if(argc != 0)
164+ usage();
165+
157166 if(mountfactotum() < 0){
158167 if(secstoreserver == nil)
159168 secstoreserver = authserver;
@@ -167,23 +176,6 @@ cpumain(int argc, char **argv) · 7 unmodified lines
167176 }
168177 }
169178
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−
187179 if((err = rexcall(&data, system, srvname)))
188180 fatal(1, "%s: %s", err, system);
189181
drawterm.h+1−1
@@ -2,7 +2,7 @@ extern int havesecstore(char *addr, char *owner); · 1 unmodified line
22 extern char *secstore;
33 extern char secstorebuf[65536];
44 extern char *secstorefetch(char *addr, char *owner, char *passwd);
5−extern char *authaddr;
5+extern char *authserver;
66 extern char *readcons(char *prompt, char *def, int secret);
77 extern int exportfs(int, int);
88 extern char *user;
main.c+0−2
@@ -6,8 +6,6 @@ · 5 unmodified lines
66
77 #include "drawterm.h"
88
9−char *authaddr = "auth";
10−char *cpuaddr = "cpu";
119 char *argv0;
1210 char *user;
1311
secstore.c+2−2
@@ -41,9 +41,9 @@ secdial(char *secstore) · 40 unmodified lines
4141 * like il!host or tcp!host or host.
4242 */
4343 if(strcmp(p, "$auth")==0){
44− if(authaddr == nil)
44+ if(authserver == nil)
4545 return -1;
46− strecpy(buf, buf+sizeof buf, authaddr);
46+ strecpy(buf, buf+sizeof buf, authserver);
4747 nf = getfields(buf, f, nelem(f), 0, "!");
4848 switch(nf){
4949 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