Project.pm: new remove_user function
[girocco.git] / Girocco / Project.pm
blobeab598d86d6f0af333edc560b0adb041f84a3b20
1 package Girocco::Project;
3 use strict;
4 use warnings;
6 BEGIN {
7 use Girocco::CGI;
8 use Girocco::User;
9 use Girocco::Util;
10 use Girocco::ProjPerm;
11 use Girocco::Config;
12 use base ('Girocco::ProjPerm::'.$Girocco::Config::permission_control); # mwahaha
15 BEGIN {
16 eval {
17 require Digest::SHA;
18 Digest::SHA->import(
19 qw(sha1_hex)
20 );1} ||
21 eval {
22 require Digest::SHA1;
23 Digest::SHA1->import(
24 qw(sha1_hex)
25 );1} ||
26 eval {
27 require Digest::SHA::PurePerl;
28 Digest::SHA::PurePerl->import(
29 qw(sha1_hex)
30 );1} ||
31 die "One of Digest::SHA or Digest::SHA1 or Digest::SHA::PurePerl "
32 . "must be available\n";
35 our $metadata_fields = {
36 homepage => ['Homepage URL', 'hp', 'text'],
37 shortdesc => ['Short description', 'desc', 'text'],
38 README => ['README (HTML, lt 8kb)', 'README', 'textarea'],
39 notifymail => ['Commit notify - mail to', 'notifymail', 'text'],
40 notifyjson => ['Commit notify - <a href="http://help.github.com/post-receive-hooks/">POST JSON</a> at', 'notifyjson', 'text'],
41 notifycia => ['Commit notify - <a href="http://cia.vc/doc/">CIA project</a> name', 'notifycia', 'text'],
44 sub _mkdir_forkees {
45 my $self = shift;
46 my @pelems = split('/', $self->{name});
47 pop @pelems; # do not create dir for the project itself
48 my $path = $self->{base_path};
49 foreach my $pelem (@pelems) {
50 $path .= "/$pelem";
51 (-d "$path") or mkdir $path or die "mkdir $path: $!";
52 chmod 02775, $path; # ok if fails (dir may already exist and be owned by someone else)
56 our %propmap = (
57 url => ':baseurl',
58 email => ':owner',
59 desc => 'description',
60 README => 'README.html',
61 hp => ':homepage',
62 notifymail => '%hooks.mailinglist',
63 notifyjson => '%hooks.jsonurl',
64 notifycia => '%hooks.cianame',
67 sub _update_index {
68 system($Girocco::Config::basedir . '/gitweb/genindex.sh');
71 sub _property_path {
72 my $self = shift;
73 my ($name) = @_;
74 $self->{path}.'/'.$name;
77 sub _property_fget {
78 my $self = shift;
79 my ($name) = @_;
80 my $pname = $propmap{$name};
81 $pname or die "unknown property: $name";
82 if ($pname =~ s/^://) {
83 my $val = `git --git-dir="$self->{path}" config "gitweb.$pname"`;
84 chomp $val;
85 return $val;
86 } elsif ($pname =~ s/^%//) {
87 my $val = `git --git-dir="$self->{path}" config "$pname"`;
88 chomp $val;
89 return $val;
92 open P, $self->_property_path($pname) or return undef;
93 my @value = <P>;
94 close P;
95 my $value = join('', @value); chomp $value;
96 $value;
99 sub _property_fput {
100 my $self = shift;
101 my ($name, $value) = @_;
102 my $pname = $propmap{$name};
103 $pname or die "unknown property: $name";
104 $value ||= '';
105 if ($pname =~ s/^://) {
106 system('git', '--git-dir='.$self->{path}, 'config', "gitweb.$pname", $value);
107 return;
108 } elsif ($pname =~ s/^%//) {
109 system('git', '--git-dir='.$self->{path}, 'config', $pname, $value);
110 return;
113 my $P = lock_file($self->_property_path($pname));
114 $value ne '' and print $P "$value\n";
115 close $P;
116 unlock_file($self->_property_path($pname));
119 sub _properties_load {
120 my $self = shift;
121 foreach my $prop (keys %propmap) {
122 $self->{$prop} = $self->_property_fget($prop);
124 my $val = `git --git-dir="$self->{path}" config --bool "gitweb.statusupdates" 2>/dev/null`;
125 chomp $val;
126 $val = ($val eq 'false') ? 0 : 1;
127 $self->{statusupdates} = $val;
128 delete $self->{auth};
129 $val = `git --git-dir="$self->{path}" config "gitweb.delauth"`;
130 chomp $val;
131 if ($val =~ /^# DELAUTH ([0-9a-f]+) (\d+)/) {
132 my $expire = $2;
133 $self->{auth} = $1 unless (time >= $expire);
137 sub _properties_save {
138 my $self = shift;
139 foreach my $prop (keys %propmap) {
140 $self->_property_fput($prop, $self->{$prop});
142 $self->{statusupdates} = 1
143 unless defined($self->{statusupdates}) && $self->{statusupdates} =~ /^\d+$/;
144 system('git', '--git-dir='.$self->{path}, 'config', '--bool',
145 "gitweb.statusupdates", $self->{statusupdates});
148 sub _nofetch_path {
149 my $self = shift;
150 $self->_property_path('.nofetch');
153 sub _nofetch {
154 my $self = shift;
155 my ($nofetch) = @_;
156 my $np = $self->_nofetch_path;
157 if ($nofetch) {
158 open X, '>'.$np or die "nofetch failed: $!";
159 close X;
160 } else {
161 unlink $np or die "yesfetch failed: $!";
165 sub _clonelog_path {
166 my $self = shift;
167 $self->_property_path('.clonelog');
170 sub _clonefail_path {
171 my $self = shift;
172 $self->_property_path('.clone_failed');
175 sub _clonep_path {
176 my $self = shift;
177 $self->_property_path('.clone_in_progress');
180 sub _clonep {
181 my $self = shift;
182 my ($nofetch) = @_;
183 my $np = $self->_clonep_path;
184 if ($nofetch) {
185 open X, '>'.$np or die "clonep failed: $!";
186 close X;
187 } else {
188 unlink $np or die "clonef failed: $!";
191 sub _alternates_setup {
192 my $self = shift;
193 return unless $self->{name} =~ m#/#;
194 my $forkee_name = get_forkee_name($self->{name});
195 my $forkee_path = get_forkee_path($self->{name});
196 return unless -d $forkee_path;
197 mkdir $self->{path}.'/refs'; chmod 02775, $self->{path}.'/refs';
198 mkdir $self->{path}.'/objects'; chmod 02775, $self->{path}.'/objects';
199 mkdir $self->{path}.'/objects/info'; chmod 02775, $self->{path}.'/objects/info';
201 # We set up both alternates and http_alternates since we cannot use
202 # relative path in alternates - that doesn't work recursively.
204 my $filename = $self->{path}.'/objects/info/alternates';
205 open X, '>'.$filename or die "alternates failed: $!";
206 print X "$forkee_path/objects\n";
207 close X;
208 chmod 0664, $filename or warn "cannot chmod $filename: $!";
210 if ($Girocco::Config::httppullurl) {
211 $filename = $self->{path}.'/objects/info/http-alternates';
212 open X, '>'.$filename or die "http-alternates failed: $!";
213 my $upfork = $forkee_name;
214 do { print X "$Girocco::Config::httppullurl/$upfork.git/objects\n"; } while ($upfork =~ s#/?.+?$## and $upfork); #
215 close X;
216 chmod 0664, $filename or warn "cannot chmod $filename: $!";
219 # The symlink is problematic since git remote prune will traverse it.
220 #symlink "$forkee_path/refs", $self->{path}.'/refs/forkee';
222 # copy refs from parent project
223 # ownership information is changed by a root cronjob
224 system("cp -pR $forkee_path/refs $self->{path}/");
225 # initialize HEAD, hacky version
226 system("cp $forkee_path/HEAD $self->{path}/HEAD");
229 sub _ctags_setup {
230 my $self = shift;
231 mkdir $self->{path}.'/ctags'; chmod 01777, $self->{path}.'/ctags';
234 sub _group_add {
235 my $self = shift;
236 my ($xtra) = @_;
237 $xtra .= join(',', @{$self->{users}});
238 filedb_atomic_append(jailed_file('/etc/group'),
239 join(':', $self->{name}, $self->{crypt}, '\i', $xtra));
242 sub _group_update {
243 my $self = shift;
244 my $xtra = join(',', @{$self->{users}});
245 filedb_atomic_edit(jailed_file('/etc/group'),
246 sub {
247 $_ = $_[0];
248 chomp;
249 if ($self->{name} eq (split /:/)[0]) {
250 # preserve readonly flag
251 s/::([^:]*)$/:$1/ and $xtra = ":$xtra";
252 return join(':', $self->{name}, $self->{crypt}, $self->{gid}, $xtra)."\n";
253 } else {
254 return "$_\n";
260 sub _group_remove {
261 my $self = shift;
262 filedb_atomic_edit(jailed_file('/etc/group'),
263 sub {
264 $self->{name} ne (split /:/)[0] and return $_;
269 sub _hook_path {
270 my $self = shift;
271 my ($name) = @_;
272 $self->{path}.'/hooks/'.$name;
275 sub _hook_install {
276 my $self = shift;
277 my ($name) = @_;
278 open SRC, "$Girocco::Config::basedir/hooks/$name" or die "cannot open hook $name: $!";
279 open DST, '>'.$self->_hook_path($name) or die "cannot open hook $name for writing: $!";
280 while (<SRC>) { print DST $_; }
281 close DST;
282 close SRC;
283 chmod 0775, $self->_hook_path($name) or die "cannot chmod hook $name: $!";
286 sub _hooks_install {
287 my $self = shift;
288 foreach my $hook ('post-receive', 'update', 'post-update') {
289 $self->_hook_install($hook);
293 # private constructor, do not use
294 sub _new {
295 my $class = shift;
296 my ($name, $base_path, $path) = @_;
297 valid_name($name) or die "refusing to create project with invalid name ($name)!";
298 $path ||= "$base_path/$name.git";
299 my $proj = { name => $name, base_path => $base_path, path => $path };
301 bless $proj, $class;
304 # public constructor #0
305 # creates a virtual project not connected to disk image
306 # you can conjure() it later to disk
307 sub ghost {
308 my $class = shift;
309 my ($name, $mirror) = @_;
310 my $self = $class->_new($name, $Girocco::Config::reporoot);
311 $self->{users} = [];
312 $self->{mirror} = $mirror;
313 $self->{email} = $self->{orig_email} = '';
314 $self;
317 # public constructor #1
318 sub load {
319 my $class = shift;
320 my $name = shift || '';
322 open F, jailed_file("/etc/group") or die "project load failed: $!";
323 while (<F>) {
324 chomp;
325 @_ = split /:+/;
326 next unless (shift eq $name);
328 my $self = $class->_new($name, $Girocco::Config::reporoot);
329 (-d $self->{path}) or die "invalid path (".$self->{path}.") for project ".$self->{name};
331 my $ulist;
332 ($self->{crypt}, $self->{gid}, $ulist) = @_;
333 $ulist ||= '';
334 $self->{users} = [split /,/, $ulist];
335 $self->{HEAD} = $self->get_HEAD;
336 $self->{orig_HEAD} = $self->{HEAD};
337 $self->{orig_users} = [@{$self->{users}}];
338 $self->{mirror} = ! -e $self->_nofetch_path;
339 $self->{clone_in_progress} = -e $self->_clonep_path;
340 $self->{clone_logged} = -e $self->_clonelog_path;
341 $self->{clone_failed} = -e $self->_clonefail_path;
342 $self->{ccrypt} = $self->{crypt};
344 $self->_properties_load;
345 $self->{orig_email} = $self->{email};
346 return $self;
348 close F;
349 undef;
352 # $proj may not be in sane state if this returns false!
353 sub cgi_fill {
354 my $self = shift;
355 my ($gcgi) = @_;
356 my $cgi = $gcgi->cgi;
358 my ($pwd, $pwd2) = ($cgi->param('pwd'), $cgi->param('pwd2'));
359 $pwd ||= ''; $pwd2 ||= ''; # in case passwords are disabled
360 if ($pwd or not $self->{crypt}) {
361 $self->{crypt} = scrypt($pwd);
364 if ($pwd2 and $pwd ne $pwd2) {
365 $gcgi->err("Our high-paid security consultants have determined that the admin passwords you have entered do not match each other.");
368 $self->{cpwd} = $cgi->param('cpwd');
370 if ($Girocco::Config::project_owners eq 'email') {
371 $self->{email} = $gcgi->wparam('email');
372 valid_email($self->{email})
373 or $gcgi->err("Your email sure looks weird...?");
376 $self->{url} = $gcgi->wparam('url');
377 if ($self->{url}) {
378 valid_repo_url($self->{url})
379 or $gcgi->err("Invalid URL. Note that only HTTP and Git protocol is supported. If the URL contains funny characters, contact me.");
382 $self->{desc} = $gcgi->wparam('desc');
383 length($self->{desc}) <= 1024
384 or $gcgi->err("<b>Short</b> description length &gt; 1kb!");
386 $self->{README} = $gcgi->wparam('README');
387 length($self->{README}) <= 8192
388 or $gcgi->err("README length &gt; 8kb!");
390 $self->{hp} = $gcgi->wparam('hp');
391 if ($self->{hp}) {
392 valid_web_url($self->{hp})
393 or $gcgi->err("Invalid homepage URL. Note that only HTTP protocol is supported. If the URL contains funny characters, contact me.");
396 $self->{users} = [grep { Girocco::User::valid_name($_) && Girocco::User::does_exist($_) } $cgi->param('user')];
398 $self->{HEAD} = $cgi->param('HEAD') if $cgi->param('HEAD');
400 # schedule deletion of tags (will be committed by update() after auth)
401 $self->{tags_to_delete} = [$cgi->param('tags')];
403 $self->{notifymail} = $gcgi->wparam('notifymail');
404 if ($self->{notifymail}) {
405 (valid_email_multi($self->{notifymail}) and length($self->{notifymail}) <= 512)
406 or $gcgi->err("Invalid notify e-mail address. Use mail,mail to specify multiple addresses; total length must not exceed 512 characters, however.");
409 $self->{notifyjson} = $gcgi->wparam('notifyjson');
410 if ($self->{notifyjson}) {
411 valid_web_url($self->{notifyjson})
412 or $gcgi->err("Invalid JSON notify URL. Note that only HTTP protocol is supported. If the URL contains funny characters, contact me.");
415 $self->{notifycia} = $gcgi->wparam('notifycia');
416 if ($self->{notifycia}) {
417 $self->{notifycia} =~ /^[a-zA-Z0-9._-]+$/
418 or $gcgi->err("Overly suspicious CIA notify project name. If it is actually valid, contact me.");
421 if ($cgi->param('setstatusupdates')) {
422 my $val = $gcgi->wparam('statusupdates') || '0';
423 $self->{statusupdates} = $val ? 1 : 0;
426 not $gcgi->err_check;
429 sub form_defaults {
430 my $self = shift;
432 name => $self->{name},
433 email => $self->{email},
434 url => $self->{url},
435 desc => html_esc($self->{desc}),
436 README => html_esc($self->{README}),
437 hp => $self->{hp},
438 users => $self->{users},
439 notifymail => html_esc($self->{notifymail}),
440 notifyjson => html_esc($self->{notifyjson}),
441 notifycia => html_esc($self->{notifycia}),
445 sub authenticate {
446 my $self = shift;
447 my ($gcgi) = @_;
449 $self->{ccrypt} or die "Can't authenticate against a project with no password";
450 $self->{cpwd} ||= '';
451 unless ($self->{ccrypt} eq crypt($self->{cpwd}, $self->{ccrypt})) {
452 $gcgi->err("Your admin password does not match!");
453 return 0;
455 return 1;
458 sub _setup {
459 my $self = shift;
460 my ($pushers) = @_;
462 $self->_mkdir_forkees;
464 mkdir($self->{path}) or die "mkdir $self->{path} failed: $!";
465 if ($Girocco::Config::owning_group) {
466 my $gid = scalar(getgrnam($Girocco::Config::owning_group));
467 chown(-1, $gid, $self->{path}) or die "chgrp $gid $self->{path} failed: $!";
468 chmod(02775, $self->{path}) or die "chmod 2775 $self->{path} failed: $!";
469 } else {
470 chmod(02777, $self->{path}) or die "chmod 2777 $self->{path} failed: $!";
472 system($Girocco::Config::git_bin, '--git-dir='.$self->{path}, 'init', '--bare', '--shared='.$self->shared_mode()) == 0
473 or die "git init $self->{path} failed: $?";
474 system($Girocco::Config::git_bin, '--git-dir='.$self->{path}, 'config', 'receive.denyNonFastforwards', 'false') == 0
475 or die "disabling receive.denyNonFastforwards failed: $?";
476 system($Girocco::Config::git_bin, '--git-dir='.$self->{path}, 'config', 'gc.auto', '0') == 0
477 or die "disabling gc.auto failed: $?";
479 # /info must have right permissions,
480 # and git init didn't do it for some reason.
481 if ($Girocco::Config::owning_group) {
482 chmod(02775, $self->{path}."/info") or die "chmod 2775 $self->{path}/info failed: $!";
483 } else {
484 chmod(02777, $self->{path}."/info") or die "chmod 2777 $self->{path}/info failed: $!";
487 $self->_properties_save;
488 $self->_alternates_setup;
489 $self->_ctags_setup;
490 $self->_group_remove;
491 $self->_group_add($pushers);
492 $self->_hooks_install;
493 #$self->perm_initialize;
494 $self->_update_index;
497 sub premirror {
498 my $self = shift;
500 $self->_setup(':');
501 $self->_clonep(1);
502 $self->perm_initialize;
505 sub conjure {
506 my $self = shift;
508 $self->_setup;
509 $self->_nofetch(1);
510 $self->perm_initialize;
513 sub clone {
514 my $self = shift;
516 unlink ($self->_clonefail_path()); # Ignore EEXIST error
517 unlink ($self->_clonelog_path()); # Ignore EEXIST error
519 use IO::Socket;
520 my $sock = IO::Socket::UNIX->new($Girocco::Config::chroot.'/etc/taskd.socket') or die "cannot connect to taskd.socket: $!";
521 $sock->print("clone ".$self->{name}."\n");
522 # Just ignore reply, we are going to succeed anyway and the I/O
523 # would apparently get quite hairy.
524 $sock->flush();
525 sleep 2; # *cough*
526 $sock->close();
529 sub update {
530 my $self = shift;
532 $self->_properties_save;
533 $self->_group_update;
535 if (exists($self->{tags_to_delete})) {
536 $self->delete_ctag($_) foreach(@{$self->{tags_to_delete}});
539 $self->set_HEAD($self->{HEAD}) unless $self->{orig_HEAD} eq $self->{HEAD};
541 my @users_add = grep { $a = $_; not scalar grep { $a eq $_ } $self->{orig_users} } $self->{users};
542 my @users_del = grep { $a = $_; not scalar grep { $a eq $_ } $self->{users} } $self->{orig_users};
543 $self->perm_user_add($_, Girocco::User::resolve_uid($_)) foreach (@users_add);
544 $self->perm_user_del($_, Girocco::User::resolve_uid($_)) foreach (@users_del);
546 $self->_update_index if $self->{email} ne $self->{orig_email};
547 $self->{orig_email} = $self->{email};
552 sub update_password {
553 my $self = shift;
554 my ($pwd) = @_;
556 $self->{crypt} = scrypt($pwd);
557 $self->_group_update;
560 # You can explicitly do this just on a ghost() repository too.
561 sub delete {
562 my $self = shift;
564 if (-d $self->{path}) {
565 system('rm', '-rf', $self->{path}) == 0
566 or die "rm -rf $self->{path} failed: $?";
568 # attempt to clean up any empty fork directories by removing them
569 my @pelems = split('/', $self->{name});
570 while (@pelems > 1) {
571 pop @pelems;
572 # okay to fail
573 rmdir join('/', $Girocco::Config::reporoot, @pelems) or last;
575 $self->_group_remove;
576 $self->_update_index;
579 sub _contains_files {
580 my $dir = shift;
581 (-d $dir) or return 0;
582 opendir(my $dh, $dir) or die "opendir $dir failed: $!";
583 while (my $entry = readdir($dh)) {
584 next if $entry eq '' || $entry eq '.' || $entry eq '..';
585 closedir($dh), return 1
586 if -f "$dir/$entry" ||
587 -d "$dir/$entry" && _contains_files("$dir/$entry");
589 closedir($dh);
590 return 0;
593 sub has_forks {
594 my $self = shift;
596 return _contains_files($Girocco::Config::reporoot.'/'.$self->{name});
599 sub is_empty {
600 # A project is considered empty if the git repository does not
601 # have any refs. This means packed-refs does not exist or is
602 # empty or only has lines starting with '#' AND there are no
603 # files in the refs subdirectory hierarchy (no matter how deep).
605 my $self = shift;
607 (-d $self->{path}) or return 0;
608 if (-e $self->{path}.'/packed-refs') {
609 open(my $pr, '<', $self->{path}.'/packed-refs')
610 or die "open $self->{path}./packed-refs failed: $!";
611 my $foundref = 0;
612 while (my $ref = <$pr>) {
613 next if $ref =~ /^#/;
614 $foundref = 1;
615 last;
617 close($pr);
618 return 0 if $foundref;
620 (-d $self->{path}.'/refs') or return 1;
621 return !_contains_files($self->{path}.'/refs');
624 sub delete_ctag {
625 my $self = shift;
626 my ($ctag) = @_;
628 # sanity check, disallow filenames starting with . .. or /
629 unlink($self->{path}.'/ctags/'.$ctag) if($ctag !~ m|^(\.\.?)/|);
632 sub get_ctag_names {
633 my $self = shift;
634 my @ctags = ();
635 opendir(my $dh, $self->{path}.'/ctags')
636 or return @ctags;
637 @ctags = grep { -f "$self->{path}/ctags/$_" } readdir($dh);
638 closedir($dh);
639 return @ctags;
642 sub get_heads {
643 my $self = shift;
644 my $fh;
645 open($fh, '-|', "$Girocco::Config::git_bin --git-dir=$self->{path} show-ref --heads") or die "could not get list of heads";
646 my @res;
647 while (<$fh>) {
648 chomp;
649 next if !m#^[0-9a-f]{40}\s+refs/heads/(.+)$ #x;
650 push @res, $1;
652 close $fh;
653 @res;
656 sub get_HEAD {
657 my $self = shift;
658 my $HEAD = `$Girocco::Config::git_bin --git-dir=$self->{path} symbolic-ref HEAD`;
659 chomp $HEAD;
660 die "could not get HEAD" if ($HEAD !~ m{^refs/heads/(.+)$});
661 return $1;
664 sub set_HEAD {
665 my $self = shift;
666 my $newHEAD = shift;
667 # Cursory checks only -- if you want to break your HEAD, be my guest
668 if ($newHEAD =~ /^\/|['<>]|\.\.|\/$/) {
669 die "grossly invalid new HEAD: $newHEAD";
671 system($Girocco::Config::git_bin, "--git-dir=$self->{path}", 'symbolic-ref', 'HEAD', "refs/heads/$newHEAD");
672 die "could not set HEAD" if ($? >> 8);
675 sub gen_auth {
676 my $self = shift;
678 $self->{auth} = sha1_hex(time . $$ . rand() . join(':',%$self));
679 my $expire = time + 24 * 3600;
680 my $propval = "# DELAUTH $self->{auth} $expire";
681 system('git', '--git-dir='.$self->{path}, 'config', 'gitweb.delauth', $propval);
682 $self->{auth};
685 sub del_auth {
686 my $self = shift;
688 delete $self->{auth};
689 system('git', '--git-dir='.$self->{path}, 'config', '--unset', 'gitweb.delauth');
692 sub remove_user {
693 my $self = shift;
694 my ($username) = @_;
696 my $before_count = @{$self->{users}};
697 $self->{users} = [grep { $_ ne $username } @{$self->{users}}];
698 return @{$self->{users}} != $before_count;
701 ### static methods
703 sub get_forkee_name {
704 $_ = $_[0];
705 (m#^(.*)/.*?$#)[0]; #
707 sub get_forkee_path {
708 my $forkee = $Girocco::Config::reporoot.'/'.get_forkee_name($_[0]).'.git';
709 -d $forkee ? $forkee : '';
712 sub valid_name {
713 $_ = $_[0];
714 (not m#/# or -d get_forkee_path($_)) # will also catch ^/
715 and (not m#\./#)
716 and (not m#/$#)
717 and m#^[a-zA-Z0-9+./_-]+$#;
720 sub does_exist {
721 my ($name) = @_;
722 valid_name($name) or die "tried to query for project with invalid name $name!";
723 (-d $Girocco::Config::reporoot."/$name.git");
726 sub get_full_list {
727 my $class = shift;
728 my @projects;
730 open F, jailed_file("/etc/group") or die "getting project list failed: $!";
731 while (<F>) {
732 chomp;
733 @_ = split /:+/;
734 next if ($_[2] < 65536);
736 push @projects, $_[0];
738 close F;
739 @projects;