Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
790 B

  1. #!/usr/local/bin/perl
  2. # Make a world-writeable directory for saving state.
  3. $ww = 'WORLD_WRITABLE';
  4. unless (-w $ww) {
  5. $u = umask 0;
  6. mkdir $ww, 0777;
  7. umask $u;
  8. }
  9. # Decode the sample image.
  10. for $uu (<*.uu>) {
  11. unless (open UU, "<$uu") { warn "Can't open $uu: $!\n"; next }
  12. while (<UU>) {
  13. chomp;
  14. if (/^begin\s+\d+\s+(.+)$/) {
  15. $bin = $1;
  16. last;
  17. }
  18. }
  19. unless (open BIN, "> $bin") { warn "Can't create $bin: $!\n"; next }
  20. binmode BIN;
  21. while (<UU>) {
  22. chomp;
  23. last if /^end/;
  24. print BIN unpack "u", $_;
  25. }
  26. close BIN;
  27. close UU;
  28. }
  29. # Create symlinks from *.txt to *.cgi for documentation purposes.
  30. foreach (<*.cgi>) {
  31. ($target = $_) =~ s/cgi$/txt/i;
  32. symlink $_, $target unless -e $target;
  33. }