RSS

(root)/fsp/fsp : 127

hsn
2005-01-05 17:19:56
Revision ID: cvs-1:hsn-20050105171956-ty6v09wfmg0zfnim
repo sync

collapse all collapse all

added added

removed removed

15
    with older software versions.
15
    with older software versions.
16
- security: symlink to FILE can escape from FSP root directory, this will
16
- security: symlink to FILE can escape from FSP root directory, this will
17
be fixed as part of symlink support.
17
be fixed as part of symlink support.
18
- add FSP change password command (do we really need this ??)
 
 
19
Code fixups:
18
Code fixups:
20
- fix Sven's compiling problems on various unixes
19
- fix Sven's compiling problems on various unixes
21
- normalize return error codes of all clients
 
 
22
- fspd: add special defence against rapid/double fire clients (burst command in fspclient)
20
- fspd: add special defence against rapid/double fire clients (burst command in fspclient)
 
 
21
- add FSP change password command (do we really need this ??)
23
 
22
 
24
* for next point Stable version 2.8.3
23
* for next point Stable version 2.8.3
25
- hard coded access list, do not load it from filesystem
24
- hard coded access list, do not load it from filesystem
45
        FAQ: Added two section making FSP slower/faster, version bumped
45
        FAQ: Added two section making FSP slower/faster, version bumped
46
          to 0.2
46
          to 0.2
47
        do not use exit code -1 in fspscan
47
        do not use exit code -1 in fspscan
 
 
48
        LAMAH fspd: improve some error messages, run on port 80 by default
 
 
49
        Changed all exit() calls to use standard EX_* values. Some utilities
 
 
50
          still do not returns error exit when they should.
 
 
51
        fhostcmd: split host managing functions into fhost.c
 
 
52
        fhost.c: do not output partial results when dns resolving fails  
 
 
53
        fhost.c: fallback to other display method (host/ip name) on
 
 
54
          resolving failure
 
 
55
        common lib: When doing addr resolving turn port 0 into 21.
 
 
56
        fhostcmd: ignore servers without port number set
 
 
57
        new command fsetup: C rewrite of old Perl script. This command is
 
 
58
          like fhostcmd but uses standard fspsites file format
48
 
59
 
49
Version 2.8.1b22 - 20 Dec 2004
60
Version 2.8.1b22 - 20 Dec 2004
50
        fixed sf bug 1060594: fspd: owner can't rename files
61
        fixed sf bug 1060594: fspd: owner can't rename files
1
FSP SUITE TO DO LIST
1
FSP SUITE TO DO LIST
 
 
2
====================
 
 
3
 
2
/* maintained by hsn -at- netmag * cz */
4
/* maintained by hsn -at- netmag * cz */
3
 
5
 
4
Radim Kolar's personal wishlist from 1997
6
Radim Kolar's personal wishlist from 1997
5
*-high priority-*
7
*-high priority-*
6
 - show loosers online (finfo command) and server statz
8
 - show loosers online (finfo command) and server statz
7
* l o w *
 
 
8
 - password change command !?
 
 
9
 
9
 
10
TESTSUITE NEEDED:
10
TESTSUITE NEEDED:
11
Write a simple FSP protocol testing tool
11
Write a simple FSP protocol testing tool
38
 
38
 
39
CLIENTS 
39
CLIENTS 
40
:high: 
40
:high: 
41
normalize return error codes of all clients
41
some client commands should exit with nonzero rc on failure
42
write new clients for new commands - fpasswd finfo
 
 
43
 
42
 
44
:low:
43
:low:
45
add support for more sane fsplist file format (as used by warez
 
 
46
ppl) to fhostcmd
 
 
47
it looks like
 
 
48
#FSP Sites list
 
 
49
genie.lut.ac.uk        21   genie    / # small UK site
 
 
50
 
 
 
51
clients do not freeing memory allocated from glob()
44
clients do not freeing memory allocated from glob()
52
 
45
 
53
FUTURE FEATURES FOR SERVER:
46
FUTURE FEATURES FOR SERVER:
57
special defence against rapid/double fire clients (burst command in fspclient)
50
special defence against rapid/double fire clients (burst command in fspclient)
58
Native Supports for symbolic links (needed for mirroring Debian)
51
Native Supports for symbolic links (needed for mirroring Debian)
59
new LSTAT COMMAND, new MAKELINK command
52
new LSTAT COMMAND, new MAKELINK command
 
 
53
 
 
 
54
SERVER DIR LISTINGS
60
Server should save .FSP_CONTENT using 1k size directory blocks
55
Server should save .FSP_CONTENT using 1k size directory blocks
 
 
56
Server should support sending different sized directory blocks
61
 
57
 
62
:midle:may not be in 2.8.2
58
:midle:may not be in 2.8.2
63
write FSP_CHANGE_PASSWORD command
59
write FSP_CHANGE_PASSWORD command
79
 
75
 
80
PERFORMANCE:
76
PERFORMANCE:
81
do host hashtable shrinking/clearing sometimes
77
do host hashtable shrinking/clearing sometimes
82
stat cache pro FSP_STAT a other stat() calls
78
stat cache for FSP_STAT a other stat() calls
83
chage O(N) fifo cache to some more sane lru hashtable code.
79
chage O(N) fifo cache to some more sane lru hashtable code.
84
background time() alarm() caller 
80
background time() alarm() caller 
85
Current performance 1925648B/s
81
Current performance 1925648B/s
86
 
82
 
87
MAN:
83
MAN:
88
separate manpage for 7 fsp (protocol definition) == write FSP RFC
84
separate manpage for 7 fsp (protocol definition) == write FSP RFC
89
Register udp/21 for FSP in iana
85
Register udp/21 for FSP in iana. FSP RFC needed!
90
manual page for fmvcmd.1
86
manual page for fmvcmd.1
91
 
87
 
92
libraries and support for FSP protocol
88
libraries and support for FSP protocol
114
    return(new);
114
    return(new);
115
  }
115
  }
116
  perror("palloc");
116
  perror("palloc");
117
  exit(1);
117
  exit(EX_OSERR);
118
}
118
}
119
 
119
 
120
extern int isoutput;
120
extern int isoutput;
154
  if ( (!value && endchar == str) || (endchar[0] &&
154
  if ( (!value && endchar == str) || (endchar[0] &&
155
      (!endch || endchar[0] != *endch))) {
155
      (!endch || endchar[0] != *endch))) {
156
    fprintf(stderr,"%s: %s", option, "illegal numeric value");
156
    fprintf(stderr,"%s: %s", option, "illegal numeric value");
157
    exit(1);
157
    exit(EX_USAGE);
158
  }
158
  }
159
  if (endch)
159
  if (endch)
160
    *endch = endchar[0];
160
    *endch = endchar[0];
203
        if (!(*store = (char *)realloc(*store, len *= 2))) {
203
        if (!(*store = (char *)realloc(*store, len *= 2))) {
204
          perror("realloc");
204
          perror("realloc");
205
          client_done();
205
          client_done();
206
          exit(1);
206
          exit(EX_OSERR);
207
        }
207
        }
208
      bcopy(path, p, plen);
208
      bcopy(path, p, plen);
209
      p += plen;
209
      p += plen;
279
   {
279
   {
280
    case -1:
280
    case -1:
281
      perror ("fork");
281
      perror ("fork");
282
      exit(1);
282
      exit(EX_OSERR);
283
    case 0:
283
    case 0:
284
      execvp(plan->e_argv[0], plan->e_argv);
284
      execvp(plan->e_argv[0], plan->e_argv);
285
      perror ("execvp");
285
      perror ("execvp");
286
      exit(1);
286
      exit(EX_OSERR);
287
  }
287
  }
288
  pid = wait(&status);
288
  pid = wait(&status);
289
 
289
 
296
 
296
 
297
  if ( (p = (char *)malloc(len))) return((char *)p);
297
  if ( (p = (char *)malloc(len))) return((char *)p);
298
  perror("malloc");
298
  perror("malloc");
299
  exit(1);
299
  exit(EX_OSERR);
300
}
300
}
301
 
301
 
302
/*
302
/*
320
  for (ap = argv = *argvp;; ++ap) {
320
  for (ap = argv = *argvp;; ++ap) {
321
    if (!*ap) {
321
    if (!*ap) {
322
      fprintf(stderr,"%s: no terminating", isok ? "-ok" : "-exec");
322
      fprintf(stderr,"%s: no terminating", isok ? "-ok" : "-exec");
323
      exit(1);
323
      exit(EX_USAGE);
324
    }
324
    }
325
    if (**ap == ';') break;
325
    if (**ap == ';') break;
326
  }
326
  }
445
 
445
 
446
  if (stat(filename, &sb)) {
446
  if (stat(filename, &sb)) {
447
    perror("stat");
447
    perror("stat");
448
    exit(1);
448
    exit(EX_NOINPUT);
449
  }
449
  }
450
  new = palloc(N_NEWER, find_newer);
450
  new = palloc(N_NEWER, find_newer);
451
  new->t_data = sb.st_mtime;
451
  new->t_data = sb.st_mtime;
541
      break;
541
      break;
542
    default:
542
    default:
543
      fprintf(stderr,"-type: unknown type");
543
      fprintf(stderr,"-type: unknown type");
544
      exit(1);
544
      exit(EX_USAGE);
545
  }
545
  }
546
 
546
 
547
  new = palloc(N_TYPE, find_type);
547
  new = palloc(N_TYPE, find_type);
118
 
118
 
119
  if (ep == (char *)0) {
119
  if (ep == (char *)0) {
120
    perror("Out of memory 1");
120
    perror("Out of memory 1");
121
    exit(1);
121
    exit(EX_OSERR);
122
  }
122
  }
123
  (void) strcpy(ep, cp);
123
  (void) strcpy(ep, cp);
124
  (void) strcat(ep, dp);
124
  (void) strcat(ep, dp);
405
  nv = (char **)malloc((unsigned)((blklen(v) + 1) * sizeof(char **)));
405
  nv = (char **)malloc((unsigned)((blklen(v) + 1) * sizeof(char **)));
406
  if (nv == (char **)0) {
406
  if (nv == (char **)0) {
407
    perror("Out of memory 2");
407
    perror("Out of memory 2");
408
    exit(2);
408
    exit(EX_OSERR);
409
  }
409
  }
410
  return (blkcpy(nv, v));
410
  return (blkcpy(nv, v));
411
}
411
}
93
      if (next->type == N_CLOSEPAREN) {
93
      if (next->type == N_CLOSEPAREN) {
94
        if (subplan == NULL) {
94
        if (subplan == NULL) {
95
          fprintf(stderr,"(): empty inner expression");
95
          fprintf(stderr,"(): empty inner expression");
96
          exit(1);
96
          exit(EX_USAGE);
97
        }
97
        }
98
        node->p_data[0] = subplan;
98
        node->p_data[0] = subplan;
99
        node->type = N_EXPR;
99
        node->type = N_EXPR;
134
     */
134
     */
135
    if (expr->type == N_CLOSEPAREN) {
135
    if (expr->type == N_CLOSEPAREN) {
136
      fprintf(stderr,"): no beginning '('");
136
      fprintf(stderr,"): no beginning '('");
137
      exit(1);
137
      exit(EX_USAGE);
138
    }
138
    }
139
 
139
 
140
    /* add the expression to our result plan */
140
    /* add the expression to our result plan */
183
      }
183
      }
184
      if (node == NULL) {
184
      if (node == NULL) {
185
        fprintf(stderr,"!: no following expression");
185
        fprintf(stderr,"!: no following expression");
186
        exit(1);
186
        exit(EX_USAGE);
187
      }
187
      }
188
      if (node->type == N_OR) {
188
      if (node->type == N_OR) {
189
        fprintf(stderr,"!: nothing between ! and -o");
189
        fprintf(stderr,"!: nothing between ! and -o");
190
        exit(1);
190
        exit(EX_USAGE);
191
      }
191
      }
192
      if (notlevel % 2 != 1) next = node;
192
      if (notlevel % 2 != 1) next = node;
193
      else next->p_data[0] = node;
193
      else next->p_data[0] = node;
234
    if (next->type == N_OR) {
234
    if (next->type == N_OR) {
235
      if (result == NULL) {
235
      if (result == NULL) {
236
        fprintf(stderr,"-o: no expression before -o");
236
        fprintf(stderr,"-o: no expression before -o");
237
        exit(1);
237
        exit(EX_USAGE);
238
      }
238
      }
239
      next->p_data[0] = result;
239
      next->p_data[0] = result;
240
      next->p_data[1] = or_squish(plan);
240
      next->p_data[1] = or_squish(plan);
241
      if (next->p_data[1] == NULL) {
241
      if (next->p_data[1] == NULL) {
242
        fprintf(stderr,"-o: no expression after -o");
242
        fprintf(stderr,"-o: no expression after -o");
243
        exit(1);
243
        exit(EX_USAGE);
244
      }
244
      }
245
      return(next);
245
      return(next);
246
    }
246
    }
85
 
85
 
86
  if ((p = option(*argv)) == NULL) {
86
  if ((p = option(*argv)) == NULL) {
87
    (void)fprintf(stderr, "find: unknown option %s.\n", *argv);
87
    (void)fprintf(stderr, "find: unknown option %s.\n", *argv);
88
    exit(1);
88
    exit(EX_USAGE);
89
  }
89
  }
90
  ++argv;
90
  ++argv;
91
  if (p->flags & (O_ARGV|O_ARGVP) && !*argv) {
91
  if (p->flags & (O_ARGV|O_ARGVP) && !*argv) {
92
    (void)fprintf(stderr, "find: %s requires additional arguments.\n",
92
    (void)fprintf(stderr, "find: %s requires additional arguments.\n",
93
                  *--argv);
93
                  *--argv);
94
    exit(1);
94
    exit(EX_USAGE);
95
  }
95
  }
96
 
96
 
97
  switch(p->flags) {
97
  switch(p->flags) {
104
#ifdef CLIENT_TIMEOUT
104
#ifdef CLIENT_TIMEOUT
105
        if (total_delay/1000 >= env_timeout ) {
105
        if (total_delay/1000 >= env_timeout ) {
106
          fprintf(stderr, "\rRemote server not responding.\n");
106
          fprintf(stderr, "\rRemote server not responding.\n");
107
          exit(1);
107
          exit(EX_UNAVAILABLE);
108
        }
108
        }
109
#endif
109
#endif
110
        idle_delay = idle_delay * 4 / 3;
110
        idle_delay = idle_delay * 4 / 3;
128
               continue;
128
               continue;
129
          default:     
129
          default:     
130
               perror("sendto");
130
               perror("sendto");
131
               exit(1);
131
               exit(EX_IOERR);
132
      }
132
      }
133
    }
133
    }
134
    /* Check if w_delay is within limits */
134
    /* Check if w_delay is within limits */
204
 
204
 
205
        if(client_intr_state == 2) {
205
        if(client_intr_state == 2) {
206
          if(!key_persists) client_done();
206
          if(!key_persists) client_done();
207
          exit(1);
207
          exit(EX_TEMPFAIL);
208
        }
208
        }
209
 
209
 
210
#ifdef DEBUG
210
#ifdef DEBUG
221
static RETSIGTYPE client_intr (int signum)
221
static RETSIGTYPE client_intr (int signum)
222
{
222
{
223
  switch(client_intr_state) {
223
  switch(client_intr_state) {
224
    case 0: exit(2);
224
    case 0: exit(EX_TEMPFAIL);
225
    case 1: client_intr_state = 2; break;
225
    case 1: client_intr_state = 2; break;
226
    case 2: exit(3);
226
    case 2: exit(EX_TEMPFAIL);
227
  }
227
  }
228
#ifndef RELIABLE_SIGNALS
228
#ifndef RELIABLE_SIGNALS
229
  signal(SIGINT,client_intr);
229
  signal(SIGINT,client_intr);
241
 
241
 
242
  if((myfd = _x_udp(env_listen_on,&myport)) == -1) {
242
  if((myfd = _x_udp(env_listen_on,&myport)) == -1) {
243
    perror("socket open");
243
    perror("socket open");
244
    exit(1);
244
    exit(EX_OSERR);
245
  }
245
  }
246
 
246
 
247
  if(_x_adr(host,port,&server_addr) == -1) {
247
  if(_x_adr(host,port,&server_addr) == -1) {
248
    perror("server addr");
248
    perror("server addr");
249
    exit(1);
249
    exit(EX_OSERR);
250
  }
250
  }
251
 
251
 
252
  client_init_key(server_addr.sin_addr.s_addr,port,getpid());
252
  client_init_key(server_addr.sin_addr.s_addr,port,getpid());
62
{
62
{
63
  if(flock(lock_fd,LOCK_EX) == -1) {
63
  if(flock(lock_fd,LOCK_EX) == -1) {
64
    perror("flock");
64
    perror("flock");
65
    exit(1);
65
    exit(EX_OSERR);
66
  }
66
  }
67
  if(read(lock_fd,&okey,sizeof(okey)) == -1) {
67
  if(read(lock_fd,&okey,sizeof(okey)) == -1) {
68
    perror("read"); exit(1);
68
    perror("read"); exit(EX_OSERR);
69
  }
69
  }
70
  if(lseek(lock_fd,0L,0) == -1) {
70
  if(lseek(lock_fd,0L,0) == -1) {
71
    perror("seek");
71
    perror("seek");
72
    exit(1);
72
    exit(EX_OSERR);
73
  }
73
  }
74
  return(okey);
74
  return(okey);
75
}
75
}
80
  key=nkey;  
80
  key=nkey;  
81
  if(write(lock_fd,&key,sizeof(key)) == -1) {
81
  if(write(lock_fd,&key,sizeof(key)) == -1) {
82
    perror("write");
82
    perror("write");
83
    exit(1);
83
    exit(EX_OSERR);
84
  }
84
  }
85
  if(lseek(lock_fd,0L,0) == -1) {
85
  if(lseek(lock_fd,0L,0) == -1) {
86
    perror("seek");
86
    perror("seek");
87
    exit(1);
87
    exit(EX_OSERR);
88
  }
88
  }
89
  if(flock(lock_fd,LOCK_UN) == -1) {
89
  if(flock(lock_fd,LOCK_UN) == -1) {
90
    perror("unflock");
90
    perror("unflock");
91
    exit(1);
91
    exit(EX_OSERR);
92
  }
92
  }
93
}
93
}
94
 
94
 
129
{
129
{
130
  if(lockf(lock_fd,F_LOCK,sizeof(okey)) == -1) {
130
  if(lockf(lock_fd,F_LOCK,sizeof(okey)) == -1) {
131
    perror("lockf");
131
    perror("lockf");
132
    exit(1);
132
    exit(EX_OSERR);
133
  }
133
  }
134
  if(read(lock_fd,&okey,sizeof(okey)) == -1) {
134
  if(read(lock_fd,&okey,sizeof(okey)) == -1) {
135
    perror("read");
135
    perror("read");
136
    exit(1);
136
    exit(EX_OSERR);
137
  }
137
  }
138
  if(lseek(lock_fd,0L,0) == -1) {
138
  if(lseek(lock_fd,0L,0) == -1) {
139
    perror("seek");
139
    perror("seek");
140
    exit(1);
140
    exit(EX_OSERR);
141
  }
141
  }
142
  return(okey);
142
  return(okey);
143
}
143
}
148
  key=nkey;  
148
  key=nkey;  
149
  if(write(lock_fd,&key,sizeof(key)) == -1) {
149
  if(write(lock_fd,&key,sizeof(key)) == -1) {
150
    perror("write");
150
    perror("write");
151
    exit(1);
151
    exit(EX_OSERR);
152
  }
152
  }
153
  if(lseek(lock_fd,0L,0) == -1) {
153
  if(lseek(lock_fd,0L,0) == -1) {
154
    perror("seek");
154
    perror("seek");
155
    exit(1);
155
    exit(EX_OSERR);
156
  }
156
  }
157
  if(lockf(lock_fd,F_ULOCK,sizeof(key)) == -1) {
157
  if(lockf(lock_fd,F_ULOCK,sizeof(key)) == -1) {
158
    perror("unlockf");
158
    perror("unlockf");
159
    exit(1);
159
    exit(EX_OSERR);
160
  }
160
  }
161
}
161
}
162
 
162
 
199
{
199
{
200
  if(lockf(lock_fd,F_LOCK,2) == -1) {
200
  if(lockf(lock_fd,F_LOCK,2) == -1) {
201
    perror("lockf");
201
    perror("lockf");
202
    exit(1);
202
    exit(EX_OSERR);
203
  }
203
  }
204
  return(*share_key);
204
  return(*share_key);
205
}
205
}
209
  *share_key = key;
209
  *share_key = key;
210
  if(lockf(lock_fd,F_ULOCK,2) == -1) {
210
  if(lockf(lock_fd,F_ULOCK,2) == -1) {
211
    perror("unlockf");
211
    perror("unlockf");
212
    exit(1);
212
    exit(EX_OSERR);
213
  }
213
  }
214
}
214
}
215
 
215
 
228
 
228
 
229
  if((lock_key = ftok(key_string,238)) == -1) {
229
  if((lock_key = ftok(key_string,238)) == -1) {
230
    perror("ftok");
230
    perror("ftok");
231
    exit(1);
231
    exit(EX_OSERR);
232
  }
232
  }
233
  if((lock_shm = shmget(lock_key,2*sizeof(unsigned int),IPC_CREAT|0666)) == -1) {
233
  if((lock_shm = shmget(lock_key,2*sizeof(unsigned int),IPC_CREAT|0666)) == -1) {
234
    perror("shmget");
234
    perror("shmget");
235
    exit(1);
235
    exit(EX_OSERR);
236
  }
236
  }
237
  if(!(share_key = (unsigned int *) shmat(lock_shm,(char*)0,0))) {
237
  if(!(share_key = (unsigned int *) shmat(lock_shm,(char*)0,0))) {
238
    perror("shmat");
238
    perror("shmat");
239
    exit(1);
239
    exit(EX_OSERR);
240
  }
240
  }
241
}
241
}
242
 
242
 
317
  if(semop(lock_sem,&sem,1) == -1 )
317
  if(semop(lock_sem,&sem,1) == -1 )
318
  {
318
  {
319
      perror("semop");
319
      perror("semop");
320
      exit(1);
320
      exit(EX_OSERR);
321
  }
321
  }
322
  return(*share_key);
322
  return(*share_key);
323
}
323
}
333
  *share_key = key;
333
  *share_key = key;
334
  if(semop(lock_sem,&sem,1) == -1) {
334
  if(semop(lock_sem,&sem,1) == -1) {
335
    perror("semop");
335
    perror("semop");
336
    exit(1);
336
    exit(EX_OSERR);
337
  }
337
  }
338
}
338
}
339
 
339
 
356
 
356
 
357
  if((lock_key = ftok(key_string,238)) == -1) {
357
  if((lock_key = ftok(key_string,238)) == -1) {
358
    perror("ftok");
358
    perror("ftok");
359
    exit(1);
359
    exit(EX_OSERR);
360
  }
360
  }
361
  if((lock_shm = shmget(lock_key,2*sizeof(unsigned int),IPC_CREAT|0666)) == -1) {
361
  if((lock_shm = shmget(lock_key,2*sizeof(unsigned int),IPC_CREAT|0666)) == -1) {
362
    perror("shmget");
362
    perror("shmget");
363
    exit(1);
363
    exit(EX_OSERR);
364
  }
364
  }
365
  if(!(share_key = (unsigned int *) shmat(lock_shm,(char*)0,0))) {
365
  if(!(share_key = (unsigned int *) shmat(lock_shm,(char*)0,0))) {
366
    perror("shmat");
366
    perror("shmat");
367
    exit(1);
367
    exit(EX_OSERR);
368
  }
368
  }
369
 
369
 
370
  if((lock_sem = semget(lock_key,0,0)) == -1) {
370
  if((lock_sem = semget(lock_key,0,0)) == -1) {
377
      if(semctl(lock_sem,0,SETVAL,sun) == -1)
377
      if(semctl(lock_sem,0,SETVAL,sun) == -1)
378
      {
378
      {
379
          perror("semctl setval");
379
          perror("semctl setval");
380
          exit(1);
380
          exit(EX_OSERR);
381
      }
381
      }
382
      *share_key = key;
382
      *share_key = key;
383
  }
383
  }
389
 
389
 
390
  if(semop(lock_sem,&sem,1) == -1) {
390
  if(semop(lock_sem,&sem,1) == -1) {
391
      perror("semop");
391
      perror("semop");
392
      exit(1);
392
      exit(EX_OSERR);
393
  }
393
  }
394
}
394
}
395
 
395
 
400
    if (shmdt((char *)share_key) < 0)
400
    if (shmdt((char *)share_key) < 0)
401
    {
401
    {
402
        perror("shmdt");
402
        perror("shmdt");
403
        exit(1);
403
        exit(EX_OSERR);
404
    }
404
    }
405
    /* check if we are only one process holding lock */
405
    /* check if we are only one process holding lock */
406
    rc = semctl(lock_sem,1,GETVAL);
406
    rc = semctl(lock_sem,1,GETVAL);
407
    if (rc == -1)
407
    if (rc == -1)
408
    {
408
    {
409
        perror("semctl");
409
        perror("semctl");
410
        exit(1);
410
        exit(EX_OSERR);
411
    }
411
    }
412
    if (rc == 1)
412
    if (rc == 1)
413
    {
413
    {
460
 
460
 
461
  if(!(env_host = getenv("FSP_HOST"))) {
461
  if(!(env_host = getenv("FSP_HOST"))) {
462
    fputs("No FSP_HOST specified.\n",stderr);
462
    fputs("No FSP_HOST specified.\n",stderr);
463
    exit(1);
463
    exit(EX_CONFIG);
464
  }
464
  }
465
  if(!(env_port = getenv("FSP_PORT"))) {
465
  if(!(env_port = getenv("FSP_PORT"))) {
466
    fputs("No FSP_PORT specified.\n",stderr);
466
    fputs("No FSP_PORT specified.\n",stderr);
467
    exit(1);
467
    exit(EX_CONFIG);
468
  }
468
  }
469
  if(!(env_dir  = getenv("FSP_DIR"))) {
469
  if(!(env_dir  = getenv("FSP_DIR"))) {
470
    env_dir = "/";
470
    env_dir = "/";
19
fver
19
fver
20
.deps
20
.deps
21
fspprof.c
21
fspprof.c
 
 
22
fspsites.c
22
fmvcmd
23
fmvcmd
23
fbye
24
fbye
 
 
25
fsetupcmd
2
 
2
 
3
bin_PROGRAMS=fcatcmd fcdcmd fducmd ffindcmd fgetcmd fgrabcmd fhostcmd \
3
bin_PROGRAMS=fcatcmd fcdcmd fducmd ffindcmd fgetcmd fgrabcmd fhostcmd \
4
             flscmd fmkdir fprocmd fput frmcmd frmdircmd fver fspmerge \
4
             flscmd fmkdir fprocmd fput frmcmd frmdircmd fver fspmerge \
5
             fstatcmd fmvcmd fbye
5
             fstatcmd fmvcmd fbye fsetupcmd
6
 
6
 
7
LDADD=-L../common -L../bsd_src -L../client -lclient -lcommon -lbsdfsp $(EX_LIBS)
7
LDADD=-L../common -L../bsd_src -L../client -lclient -lcommon -lbsdfsp $(EX_LIBS)
8
 
8
 
10
fcdcmd_SOURCES=fcdcmd.c printpro.c
10
fcdcmd_SOURCES=fcdcmd.c printpro.c
11
fprocmd_SOURCES=printpro.c fprocmd.c
11
fprocmd_SOURCES=printpro.c fprocmd.c
12
noinst_HEADERS=printpro.h fhost.h merge.h
12
noinst_HEADERS=printpro.h fhost.h merge.h
13
fhostcmd_SOURCES=fhostcmd.c fspprof.l
13
fhostcmd_SOURCES=fhostcmd.c fspprof.l fhost.c
14
fhostcmd_LDADD=$(LDADD)
14
fhostcmd_LDADD=$(LDADD)
 
 
15
fsetupcmd_SOURCES=fsetupcmd.c fspsites.l fhost.c
 
 
16
fsetupcmd_LDADD=$(LDADD)
15
 
17
 
16
fspmerge_LDADD=fcatcmd_m.o fcdcmd_m.o fducmd_m.o ffindcmd_m.o fgetcmd_m.o \
18
fspmerge_LDADD=fcatcmd_m.o fcdcmd_m.o fducmd_m.o ffindcmd_m.o fgetcmd_m.o \
17
    fgrabcmd_m.o fhostcmd_m.o flscmd_m.o fmkdir_m.o fprocmd_m.o \
19
    fgrabcmd_m.o fhostcmd_m.o flscmd_m.o fmkdir_m.o fprocmd_m.o \
18
    fput_m.o frmcmd_m.o frmdircmd_m.o fver_m.o fmvcmd_m.o \
20
    fput_m.o frmcmd_m.o frmdircmd_m.o fver_m.o fmvcmd_m.o \
19
    fstatcmd_m.o fbye_m.o $(LDADD)
21
    fstatcmd_m.o fbye_m.o fhost.o $(LDADD)
20
 
22
 
21
fgetcmd_CFLAGS:=-DCOMMAND_GET
23
fgetcmd_CFLAGS:=-DCOMMAND_GET
22
 
24
 
51
 
51
 
52
  client_done();
52
  client_done();
53
 
53
 
54
  exit(0);
54
  exit(EX_OK);
55
}
55
}
65
    }
65
    }
66
  }
66
  }
67
  client_done();
67
  client_done();
68
  exit(0);
68
  exit(EX_OK);
69
}
69
}
87
        break;
87
        break;
88
      default:
88
      default:
89
        fprintf(stderr,"Usage: du [-r|a|s] directory name.\n");
89
        fprintf(stderr,"Usage: du [-r|a|s] directory name.\n");
90
        exit(0);
90
        exit(EX_USAGE);
91
    }
91
    }
92
 
92
 
93
  /* special case `du' without file arguments -- becomes `du .' */
93
  /* special case `du' without file arguments -- becomes `du .' */
48
  char filename[20];
48
  char filename[20];
49
  sprintf(filename,".fsp.%d",getpid());
49
  sprintf(filename,".fsp.%d",getpid());
50
  unlink(filename);
50
  unlink(filename);
51
  exit(1);
51
  exit(EX_TEMPFAIL);
52
}
52
}
53
 
53
 
54
static void
54
static void
231
  env_client();
231
  env_client();
232
  if (strcmp(env_local_dir,".") && chdir(env_local_dir)) {
232
  if (strcmp(env_local_dir,".") && chdir(env_local_dir)) {
233
    perror("chdir");
233
    perror("chdir");
234
    exit(1);
234
    exit(EX_NOINPUT);
235
  }
235
  }
236
 
236
 
237
  while ((optletter=getopt(argc, argv,"ofutnacrph?")) != EOF)
237
  while ((optletter=getopt(argc, argv,"ofutnacrph?")) != EOF)
262
      case 'h':
262
      case 'h':
263
      case '?':
263
      case '?':
264
        usage();
264
        usage();
265
        exit(0);
265
        exit(EX_OK);
266
    }
266
    }
267
 
267
 
268
  if(argc > optind) {
268
  if(argc > optind) {
324
 
324
 
325
  client_done();
325
  client_done();
326
 
326
 
327
  exit(0);
327
  exit(EX_OK);
328
}
328
}
12
    char *password;
12
    char *password;
13
};
13
};
14
 
14
 
 
 
15
#define NUMBER 1
 
 
16
#define NAME 2
15
struct fsp_host * init_host(void);
17
struct fsp_host * init_host(void);
16
void add_host(struct fsp_host *h);
18
void add_host(struct fsp_host *h);
17
void add_host_alias(struct fsp_host *h, const char *name);
19
void add_host_alias(struct fsp_host *h, const char *name);
18
 
20
struct fsp_host *find_host(const char *name);
19
/* lex parser */
21
void list_prof_file (void); /* list resource file */
20
extern FILE *yyin;
22
int print_host_setup(struct fsp_host *setup,int csh,int lhost);
21
int yylex(void);
 
 
22
int yywrap(void);
 
 
30
 
30
 
31
#define FSP_STAT stat
31
#define FSP_STAT stat
32
 
32
 
33
#define NUMBER 1
 
 
34
#define NAME 2
 
 
35
 
33
 
36
#include "fhost.h"
34
#include "fhost.h"
37
 
35
 
38
static const char *home="/";
36
static const char *home="/";
39
 
 
 
40
static struct fsp_host *host;
 
 
41
static int hostsize=0;
 
 
42
static int tryfile=0;
37
static int tryfile=0;
43
 
38
 
44
/* allocate and init fsp_host structure */
39
 
45
struct fsp_host * init_host(void)
40
/* generated lex parser */
46
{
41
extern FILE *yyin;
47
    struct fsp_host *h;
42
int yylex(void);
48
 
43
int yywrap(void);
49
    h=malloc(sizeof(struct fsp_host));
 
 
50
    if(h==NULL)
 
 
51
    {
 
 
52
        perror("init_host");
 
 
53
        exit(2);
 
 
54
    }
 
 
55
        
 
 
56
    h->hostname=NULL;
 
 
57
    h->hostaddr=NULL;
 
 
58
    h->alias=calloc(1,sizeof(char *));
 
 
59
    h->port=-1;
 
 
60
    h->dir=NULL;
 
 
61
    h->delay=-1;
 
 
62
    h->local_port=-1;
 
 
63
    h->timeout=-1;
 
 
64
    h->trace=-1;
 
 
65
    h->local_dir=NULL;
 
 
66
    h->password=NULL;
 
 
67
 
 
 
68
    return h;
 
 
69
}
 
 
70
 
 
 
71
void add_host_alias(struct fsp_host *h, const char *name)
 
 
72
{
 
 
73
    int i=0;
 
 
74
    while(h->alias[i])
 
 
75
        i++;
 
 
76
    h->alias=realloc(h->alias,sizeof(char *)*(i+2));
 
 
77
    h->alias[i]=strdup(name);
 
 
78
    h->alias[i+1]=NULL;
 
 
79
}
 
 
80
 
 
 
81
void add_host(struct fsp_host *h)
 
 
82
{
 
 
83
    if (hostsize==0)
 
 
84
        host=NULL;
 
 
85
    if(h==NULL) return;
 
 
86
    host=realloc(host,sizeof(struct  fsp_host)*(hostsize+1));
 
 
87
    if(host==NULL)
 
 
88
    {
 
 
89
        perror("host realloc");
 
 
90
        exit(2);
 
 
91
    }
 
 
92
    memcpy(host+hostsize,h,sizeof(struct fsp_host));
 
 
93
    hostsize++;
 
 
94
    return;
 
 
95
}
 
 
96
 
 
 
97
static struct fsp_host *find_host(const char *name)
 
 
98
{
 
 
99
    int i,j;
 
 
100
 
 
 
101
    if(name==NULL || hostsize==0 ) return NULL;
 
 
102
    for(i=0;i<hostsize;i++)
 
 
103
    {
 
 
104
        if(host[i].hostname)
 
 
105
            if(!strcmp(host[i].hostname,name)) return &host[i];
 
 
106
        if(host[i].hostaddr)
 
 
107
            if(!strcmp(host[i].hostaddr,name)) return &host[i];
 
 
108
        j=0;
 
 
109
        while(host[i].alias[j])
 
 
110
        {
 
 
111
            if(!strcmp(host[i].alias[j],name)) return &host[i];
 
 
112
            j++;
 
 
113
        }
 
 
114
    }
 
 
115
    return NULL;
 
 
116
}
 
 
117
 
44
 
118
static void host_usage (void) /* print usage message */
45
static void host_usage (void) /* print usage message */
119
{
46
{
121
  fprintf(stderr,"             [-o timeout] [-t trace] [-w password]\n");
48
  fprintf(stderr,"             [-o timeout] [-t trace] [-w password]\n");
122
  fprintf(stderr,"             [-f filename] [-h [number|name]] [-c | -b]\n");
49
  fprintf(stderr,"             [-f filename] [-h [number|name]] [-c | -b]\n");
123
  fprintf(stderr,"             [host port [directory] | abbreviation]\n");
50
  fprintf(stderr,"             [host port [directory] | abbreviation]\n");
124
  exit(0);
51
  exit(EX_OK);
125
}
52
}
126
 
53
 
127
/* get data out of resource file */
54
/* get data out of resource file */
150
      fclose(input);
77
      fclose(input);
151
}
78
}
152
 
79
 
153
static void list_prof_file (void) /* list resource file */
 
 
154
{
 
 
155
  int i;
 
 
156
  for(i=0;i<hostsize;i++)
 
 
157
  {
 
 
158
      printf("host: %s port: %d\n",(host[i].hostname?host[i].hostname  :  host[i].hostaddr),(host[i].port<=0? 21 : host[i].port));
 
 
159
  }
 
 
160
 
 
 
161
  return;
 
 
162
}
 
 
163
 
 
 
164
int main (int argc, char ** argv)
80
int main (int argc, char ** argv)
165
{
81
{
166
  int optletter,csh,lhost=0;
82
  int optletter,csh,lhost=0;
168
  const char *filename=NULL;
84
  const char *filename=NULL;
169
  char *log;
85
  char *log;
170
  struct passwd *pw=0L;
86
  struct passwd *pw=0L;
171
  struct hostent *hp;
 
 
172
  long addr;
 
 
173
  struct fsp_host *setup=NULL;
87
  struct fsp_host *setup=NULL;
174
 
88
 
175
  log = (char *)getlogin();
89
  log = (char *)getlogin();
249
    if (filename || argc==1) {  /* list only */
163
    if (filename || argc==1) {  /* list only */
250
      parse_prof_file_new(filename);
164
      parse_prof_file_new(filename);
251
      list_prof_file();
165
      list_prof_file();
252
      exit(0);
166
      exit(EX_OK);
253
    }
167
    }
254
  }
168
  }
255
  if (setup->delay>=0) {
169
  if(setup->hostname==NULL && setup->hostaddr==NULL)
256
    if (csh) printf("setenv FSP_DELAY %d;\n",setup->delay);
170
  {
257
    else printf("FSP_DELAY=%d;\nexport FSP_DELAY;\n",setup->delay);
171
        fprintf(stderr,"fhost: No host given!\n");
258
  }
172
        exit(EX_USAGE);
259
  if (setup->local_port>=0) {
173
  }
260
    if (csh) printf("setenv FSP_LOCALPORT %d;\n",setup->local_port);
174
  print_host_setup(setup,csh,lhost);
261
    else printf("FSP_LOCALPORT=%d;\nexport FSP_LOCALPORT;\n",setup->local_port);
175
  exit(EX_OK);
262
  }
 
 
263
  if (setup->trace>=0) {
 
 
264
    if (csh) {
 
 
265
      if (setup->trace) printf("setenv FSP_TRACE;\n");
 
 
266
      else printf("unsetenv FSP_TRACE;\n");
 
 
267
    } else {
 
 
268
      if (setup->trace) printf("FSP_TRACE;\nexport FSP_TRACE;\n");
 
 
269
      else printf("unset FSP_TRACE;\n");
 
 
270
    }
 
 
271
  }
 
 
272
  if (setup->timeout>=0) {
 
 
273
    if (csh) printf("setenv FSP_TIMEOUT %d;\n",setup->timeout);
 
 
274
    else printf("FSP_TIMEOUT=%d;\nexport FSP_TIMEOUT;\n",setup->timeout);
 
 
275
  }
 
 
276
  if (setup->port>=0) {
 
 
277
    if (csh) printf("setenv FSP_PORT %d;\n",setup->port);
 
 
278
    else printf("FSP_PORT=%d;\nexport FSP_PORT;\n",setup->port);
 
 
279
  }
 
 
280
  if (setup->local_dir) {
 
 
281
    if (csh) printf("setenv FSP_LOCAL_DIR ");
 
 
282
    else printf("FSP_LOCAL_DIR=");
 
 
283
    for (p=setup->local_dir;*p && *p!='\n' && *p!=' ';p++) printf("%c",*p);
 
 
284
    if (csh) printf(";\n");
 
 
285
    else printf(";\nexport FSP_LOCAL_DIR;\n");
 
 
286
  }
 
 
287
  if (setup->password) {
 
 
288
    if (csh) printf("setenv FSP_PASSWORD ");
 
 
289
    else printf("FSP_PASSWORD=");
 
 
290
    for (p=setup->password;*p && *p!='\n' && *p!=' ';p++) printf("%c",*p);
 
 
291
    if (csh) printf(";\n");
 
 
292
    else printf(";\nexport FSP_PASSWORD;\n");
 
 
293
  }
 
 
294
  if (setup->hostname || setup->hostaddr) {
 
 
295
    if (csh) printf("setenv FSP_HOST ");
 
 
296
    else printf("FSP_HOST=");
 
 
297
    if(setup->hostname) {
 
 
298
      for(p = setup->hostname; *p && *p!='\n' && *p!= ' '; p++);
 
 
299
      *p = 0;
 
 
300
    }
 
 
301
    if(setup->hostaddr) {
 
 
302
      for(p=setup->hostaddr;*p && *p !='\n' && *p!=' ';p++);
 
 
303
      *p = 0;
 
 
304
    }
 
 
305
    if(lhost==NAME && !setup->hostname) {
 
 
306
#if HOST_LOOKUP
 
 
307
      addr=inet_addr(setup->hostaddr);
 
 
308
      if ( (hp=gethostbyaddr((char *) &addr, sizeof(addr), AF_INET)))
 
 
309
        setup->hostname= (char *)hp->h_name;
 
 
310
#endif
 
 
311
      if (!setup->hostname) lhost=NUMBER;
 
 
312
    }
 
 
313
    if (lhost==NUMBER && !setup->hostaddr) { /* look for number */
 
 
314
#if HOST_LOOKUP
 
 
315
      if ( (hp=gethostbyname(setup->hostname)))
 
 
316
        setup->hostaddr=(char *)inet_ntoa(*(struct in_addr *) * hp->h_addr_list);
 
 
317
#endif
 
 
318
      if (!setup->hostaddr) lhost=NAME;
 
 
319
    }
 
 
320
    if (!lhost) {
 
 
321
      if (setup->hostaddr) lhost=NUMBER;
 
 
322
      else if (setup->hostname) lhost=NAME;
 
 
323
      else {
 
 
324
        fprintf(stderr,"fhost: No host given!");
 
 
325
        exit(1);
 
 
326
      }
 
 
327
    }
 
 
328
    printf("%s", (lhost==NAME)? setup->hostname : setup->hostaddr);
 
 
329
    if (csh) printf(";\n");
 
 
330
    else printf(";\nexport FSP_HOST;\n");
 
 
331
    if (!setup->dir) setup->dir="/"; /* if host is set we need this */
 
 
332
  }
 
 
333
  if (setup->dir) {
 
 
334
    if (csh) printf("setenv FSP_DIR ");
 
 
335
    else printf("FSP_DIR=");
 
 
336
    for (p=setup->dir;*p && *p!='\n' && *p!=' ';p++) printf("%c",*p);
 
 
337
    if (csh) printf(";\n");
 
 
338
    else printf(";\nexport FSP_DIR;\n");
 
 
339
  }
 
 
340
 
 
 
341
  if (csh) printf("setenv FSP_NAME \"");
 
 
342
  else printf("FSP_NAME=\"");
 
 
343
  if (setup->hostname)
 
 
344
    for (p=setup->hostname;*p && *p!='\n' && *p!=' ';p++) printf("%c",*p);
 
 
345
  if (csh) printf("\";\n");
 
 
346
  else printf("\";\nexport FSP_NAME;\n");
 
 
347
  exit(0);
 
 
348
}
176
}
349
 
177
 
350
/*
178
/*
34
 
34
 
35
  client_done();
35
  client_done();
36
 
36
 
37
  exit(0);
37
  exit(EX_OK);
38
}
38
}
47
  while(*++argv) make_dir(*argv);
47
  while(*++argv) make_dir(*argv);
48
  client_done();
48
  client_done();
49
 
49
 
50
  exit(0);
50
  exit(EX_OK);
51
}
51
}
95
  else
95
  else
96
    {
96
    {
97
      fprintf(stderr,"%s source target\n", argv[0]);
97
      fprintf(stderr,"%s source target\n", argv[0]);
98
      exit(1);
98
      exit(EX_USAGE);
99
    }
99
    }
100
 
100
 
101
  client_done();
101
  client_done();
102
 
102
 
103
  exit(0);
103
  exit(EX_OK);
104
}
104
}
94
 
94
 
95
  client_done();
95
  client_done();
96
 
96
 
97
  exit(0);
97
  exit(EX_OK);
98
}
98
}
65
  if(ub->cmd==CC_UP_LOAD)
65
  if(ub->cmd==CC_UP_LOAD)
66
     ub=client_interact(CC_INSTALL,0L, 1, "", 0, (unsigned char *)NULLP);
66
     ub=client_interact(CC_INSTALL,0L, 1, "", 0, (unsigned char *)NULLP);
67
  client_done();
67
  client_done();
68
  exit(1);
68
  exit(EX_TEMPFAIL);
69
}
69
}
70
 
70
 
71
int main (int argc, char ** argv)
71
int main (int argc, char ** argv)
76
  env_client();
76
  env_client();
77
  if (strcmp(env_local_dir,".") && chdir(env_local_dir)) {
77
  if (strcmp(env_local_dir,".") && chdir(env_local_dir)) {
78
    perror("chdir");
78
    perror("chdir");
79
    exit(1);
79
    exit(EX_NOINPUT);
80
  }
80
  }
81
 
81
 
82
  signal(SIGHUP,SIG_IGN);
82
  signal(SIGHUP,SIG_IGN);
100
      case 'h':
100
      case 'h':
101
      case '?':
101
      case '?':
102
               usage();
102
               usage();
103
               exit(0);
103
               exit(EX_OK);
104
      case 'p':
104
      case 'p':
105
               timestamps=1;
105
               timestamps=1;
106
    }
106
    }
125
 
125
 
126
  client_done();
126
  client_done();
127
 
127
 
128
  exit(0);
128
  exit(EX_OK);
129
}
129
}
54
 
54
 
55
  client_done();
55
  client_done();
56
 
56
 
57
  exit(0);
57
  exit(EX_OK);
58
}
58
}
55
 
55
 
56
  client_done();
56
  client_done();
57
 
57
 
58
  exit(0);
58
  exit(EX_OK);
59
}
59
}
1
%option nounput
1
%option nounput
2
%option noyyget_lineno
 
 
3
%option noyyset_lineno
 
 
4
%option noyyget_debug
 
 
5
%option noyyset_debug
 
 
6
%option noyyget_in
 
 
7
%option noyyget_out
 
 
8
%option noyyget_leng
 
 
9
%option noyyget_text
 
 
10
%option noyyset_in
 
 
11
%option noyyset_out
 
 
12
%option case-insensitive
2
%option case-insensitive
13
%option never-interactive
3
%option never-interactive
 
 
4
%option noyylineno
14
 
5
 
15
%{
6
%{
16
#include <string.h>
7
#include <string.h>
94
 
94
 
95
  client_done();
95
  client_done();
96
 
96
 
97
  exit(0);
97
  exit(EX_OK);
98
}
98
}
134
    printf("no\n");
134
    printf("no\n");
135
#endif
135
#endif
136
  }
136
  }
137
  exit(0);
137
  exit(EX_OK);
138
}
138
}
42
  else if(!strcmp(q,"fmvcmd")) fmvcmd_main(argc,argv);
42
  else if(!strcmp(q,"fmvcmd")) fmvcmd_main(argc,argv);
43
  else {
43
  else {
44
    fprintf(stderr,"Unknown FSP client command: %s\n",q);
44
    fprintf(stderr,"Unknown FSP client command: %s\n",q);
45
    exit(1);
45
    exit(EX_USAGE);
46
  }
46
  }
47
  exit(0);
47
  exit(EX_OK);
48
}
48
}
15
 
15
 
16
  if (nstr == (char*)0) {
16
  if (nstr == (char*)0) {
17
    fprintf(stderr, "strdup(): not enough memory to duplicate `%s'\n", str);
17
    fprintf(stderr, "strdup(): not enough memory to duplicate `%s'\n", str);
18
    exit(1);
18
    exit(EX_OSERR);
19
  }
19
  }
20
 
20
 
21
  strcpy(nstr, str);
21
  strcpy(nstr, str);
71
          host=myhost;
71
          host=myhost;
72
  }
72
  }
73
 
73
 
 
 
74
  if(port <= 0)
 
 
75
      port=21;
 
 
76
 
74
  /* if((his->sin_addr.s_addr = inet_addr(host)) != -1) */
77
  /* if((his->sin_addr.s_addr = inet_addr(host)) != -1) */
75
  if(inet_aton(host,&his->sin_addr)) {
78
  if(inet_aton(host,&his->sin_addr)) {
76
    his->sin_family = AF_INET;
79
    his->sin_family = AF_INET;
237
elif test "x$ac_cv_func_shmget" = "xyes" -a "x$ac_cv_func_lockf" = "xyes"; then
237
elif test "x$ac_cv_func_shmget" = "xyes" -a "x$ac_cv_func_lockf" = "xyes"; then
238
     AC_DEFINE(FSP_USE_SHAREMEM_AND_LOCKF,1)
238
     AC_DEFINE(FSP_USE_SHAREMEM_AND_LOCKF,1)
239
elif test "x$ac_cv_func_lockf" = "xyes"; then AC_DEFINE(FSP_USE_LOCKF,1)
239
elif test "x$ac_cv_func_lockf" = "xyes"; then AC_DEFINE(FSP_USE_LOCKF,1)
240
elif "x$ac_cv_func_flock" = "xyes"; then AC_DEFINE(FSP_USE_FLOCK,1)    
240
elif test "x$ac_cv_func_flock" = "xyes"; then AC_DEFINE(FSP_USE_FLOCK,1)    
241
else
241
else
242
AC_DEFINE(FSP_NOLOCKING,1)
242
AC_DEFINE(FSP_NOLOCKING,1)
243
AC_MSG_NOTICE([no suitable locking method detected])
243
AC_MSG_NOTICE([no suitable locking method detected])
8
 * It is only checked if neither ./.fsp_prof nor ~/.fsp_prof exist          *
8
 * It is only checked if neither ./.fsp_prof nor ~/.fsp_prof exist          *
9
 ****************************************************************************/
9
 ****************************************************************************/
10
#define FSPRC SYSCONFDIR"/fsp_prof"
10
#define FSPRC SYSCONFDIR"/fsp_prof"
 
 
11
#define FSPSITESRC SYSCONFDIR"/fspsites" 
11
 
12
 
12
/****************************************************************************
13
/****************************************************************************
13
 * The basename of the local startup file                                   *
14
 * The basename of the local startup file                                   *
14
 ****************************************************************************/
15
 ****************************************************************************/
15
#define FSPPROF ".fsp_prof"
16
#define FSPPROF ".fsp_prof"
 
 
17
#define FSPSITES ".fspsites"
16
 
18
 
17
/****************************************************************************
19
/****************************************************************************
18
 * Define the CLIENT_TIMEOUT if you want the client programs to time out
20
 * Define the CLIENT_TIMEOUT if you want the client programs to time out
33
#endif
33
#endif
34
#else
34
#else
35
          "FSP server "PACKAGE_VERSION"\n"
35
          "FSP server "PACKAGE_VERSION"\n"
36
          "For lamerZ by Elite!\n"        
36
          "Antiscan protection actived!\n"
37
#endif    
37
          "For lamah by FSP Gods!\n"
 
 
38
#endif
38
            );
39
            );
39
}
40
}
40
 
41
 
58
  daemonize = 0;
59
  daemonize = 0;
59
  dbug = 0;
60
  dbug = 0;
60
  dir_cache_limit = 500;
61
  dir_cache_limit = 500;
 
 
62
  udp_port = 80;
61
#endif    
63
#endif    
62
 
64
 
63
  if(!inetd_mode && udp_port==0) {
65
  if(!inetd_mode && udp_port==0) {
64
#ifdef LAMERPACK
66
#ifdef LAMERPACK
65
    udp_port = 53;
 
 
66
#else            
67
#else            
67
    fprintf(stderr, "Error: No port set. (Use 65535 for random port)\n");
68
    fprintf(stderr, "Error: No port set. (Use 65535 for random port)\n");
68
    exit(1);
69
    exit(1);
86
  if(!home_dir) {
87
  if(!home_dir) {
87
#ifdef LAMERPACK
88
#ifdef LAMERPACK
88
    home_dir = strdup("/");
89
    home_dir = strdup("/");
 
 
90
    fprintf(stderr, "Info: Sharing all files available on this computer.\n");
89
#else            
91
#else            
90
    fprintf(stderr, "Error: No home directory set.\n");
92
    fprintf(stderr, "Error: No home directory set.\n");
91
    exit(1);
93
    exit(1);
118
#ifndef LAMERPACK
120
#ifndef LAMERPACK
119
      if(!inetd_mode)
121
      if(!inetd_mode)
120
          fprintf(stderr,"Warning: no tmpdir set, switching to readonly mode.\n");
122
          fprintf(stderr,"Warning: no tmpdir set, switching to readonly mode.\n");
 
 
123
#else
 
 
124
 
 
 
125
          fprintf(stderr,"Info: Writes disabled because tmpdir not set.\n");
121
#endif
126
#endif
122
      read_only = 1;
127
      read_only = 1;
123
  }
128
  }

Loggerhead is a web-based interface for Bazaar branches