>Removing leading slashes in the url_encode() function is bad, because
>they might be part of a password, but somebody else had apparently made
>url_encode() do that. Here's a patch that stops url_encode() from
>removing leading slashes, changes the encode_leading_slash code to
>fit in with that policy, adds some comments that should dissuade folk
>from removing leading slashes in the future, and fixes a bug where the
>encode_leading_slash code was not decrementing len.
Shouldn't bother doing DNS lookups or wait a really long time,
should display verbose output and quit after the host has been
successfully pinged even once. count bumped up to 5 to give boards
which take a while to do media autoselection time to do their thing.
makes some things harder, for instance... Deal correctly with the case
where the user-supplied hostname is already fully qualified with the
domain name they supplied. Addresses PR#6955.
installation would try to continue even if no networking interfaces found,
and, and, when that was fixed, instead of dropping back to the
pick-distribution-medium menu they'd drop all the way back to the opening
menu.
screen as XXX. Where they were not followed by wclear(stdscr), add
wclear(stdscr). Somebody was let out without adult supervision. If i
were more adventurous, i'd remove the bits that output 'CL', but i'm not
gonna go there right now.
pseudo-devices. This is done by explicitly listing the driver names
(e.g. "lo") to ignore in an array in this file. Right now, "eon", "gre",
"ipip", "lo", "nsip", "ppp", "sl", "strip", and "tun" are ignored.
start of the URL so that the request will start from / (rather than
relative to the login directory; makes things work better for
non-anonymous FTP). To make it clearer what's going on, make the
default path (used to get distribution bits) relative. (according
to the 1.4 LAST_MINUTE file, this is OK.)
* Also, %-encode passwords in FTP URLs (doesn't help actual security, but
makes it slightly harder to figure out a password by reading over
somebody's shoulder).
cleanups before extracting a set. Should'nt do anything for an install,
as the filesystem shouldn't contain files that need to be removed.
cleanup_dist() is called before extract_file() for each set (the set name
is passed as parameter). It will open a file /dist/<set name>_obsolete
if it exists. This file should contain a list of files (absolutes
pathnames) that needs to be removed. cleanup_dist() will lstat() each file
to determine if it's there and if it's a directory or not.
It will then unlink() entries that are not directories and then rmdir()
directories. If a directory is not empty (it should now if the list of files
is correct) it will be renamed to <directory.old> and the user will be warned.
Other changes:
- move prototype of target_prefix() in defs.h, don't maintain a copy
of it in each file.
- in install.c, after MSG_disksetupdone, do a wclear(stdscr) (display was
clobbered after it).
- kill MSG_openmsgbuf, it's not used anywhere
- after MSG_disksetupdone in upgrade, don't call MENU_ok, do it the
same way as in install.
- add wclear(stdscr);/wrefresh(stdscr); before calling MENU_distset (another
display problem ...)
- While I'm there, move ask_verbose_dist() before MENU_distmedium. This way,
if all go well the user can go away one ftp starts and come back once
sets are extracted.
- in run_prog(), do an explicit wclear(stdscr); wrefresh(stdscr);
before launching subwindows. This seems to solve all the display
problems associated with run_prog().
enter partitions offet and size. The user can chose unit independantly of
the unit used for display ('M'/'c'/'s'). These functions do the proper
bound checks and alignement/roudups. Used in the edfspart menu and
i386 md_make_bsd_partitions() (other ports should do the change as
well).
- now that getpartsize() does the rigth thing, kill the swapadj hack (which was
buggy anyway).
- in i386 md_make_bsd_partitions(), don't propose defaults that don't fit on
the disk. If the disk is too small, fallback to custom instead.
- fix a bug in mbr.c, where the partition flags would not have always been
reset. sysinst created me a MBR with 2 active partition. The boot code
doesn't like it :)
- added a message for eventual mount failures.
- killed donewfs and extracting messages, as we run the commands in a
subwindow these messages just flashed on the screen.
- Changes a few exit(1) to return(1), to give the user a second chance.
- added msg_clear() or wclear(stdscr) in a place or two, to make
display a bit nicer.
- in run_cmd(), if the command succeeded, don't wait for the user to
press enter.
- Make all the functions called from do_install() return an error code,
so that we can abort install if something went wrong.
- Add a 'errstr' argument to run_prog(), which if not NULL is displayed
with msg_printf() and followed by process_menu(MENU_ok) if the command fail.
Used to warn the user that the current action is aborted.
- in a few places use msg_display() or msg_printf() rather than printf.
It seems that stdout/stderr are not always pointing to the active curses
window.
- garbage-collecd unused messages, add a few new one (error handling).
XXX only tested on i386. Other md parts should be tested as well.
encoded. This means certain passwords, usernames, etc., will not work
with "ftp ftp://...."
This code, submitted by Alan Barrett <apb@iafrica.com>, fixes this by
hex encoding unsafe strings in a clean fashion. This should close a
couple of outstanding PRs. Thanks Alan!
commandlines for all tar operations. (work supplied by Matt Green)
2) Update arch/*/md.c to deal with new sysinst/run.c. Special case
anything that needs to do a redirect or a pipe.
3) #if 0 some unused code in target.c. This code will need to be updated,
or special cased with do_system.
Big thank you to Matt for all his work on this.
Scripting and logging functionality for sysinst.
Child programs are run in a "display window" so you can actually see what
they did before the screen flashes back and you loose it all.
Lots of curses fixups. Removed nasty endwins that mangled the tty upon
rentry.
Change the yes/no box to accept Y or N, and not require cursor motion to
decide one or the other.
Perform curses redraws when doing things that could cause the kernel to
spew printfs onto your screen.
non-soft-settable media. Treat that as if there was no media output.
Use a supplied media-string of "<null>" or "<default>" or synonyms to
avoid passing explicit media flags onto ifconfig.
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
same for floppies (from Christoph Badura)
* allow user to run 'Configure network' multiple times, to correct errors
for example.
* deal with network interfaces that need explicit media type selection
(i.e. ask for it when it is needed, also store it in the generated
/etc/ifconfig.blah file on the destination disk)
(like upgrade but without trying to save etc.
* Add option to setls0urce menu to look in an already-mounted (local)
directory. Change `local fs' option to say umounted local fs.
* Change extract_file() to check that a tarball actually exists
and give an explicit non-curses warning if it doesn't. (see above.)
* GNU tar returns a successful status if its gunzip child dies.
Add short sleep() after tar commands in case of undetected errors.
* Change set-source selection code (except FTP, floppy) to check
that the mandatory set files (base.tgz, etc.tgz) exist
in the selected directory. If they don't, warn the user and
prompt the user to change the selected directory.
Give the user the option to explicitly continue even if
base.tgz or etc.tgz not found, just in case.
* Change extract_file() to keep count of set unpacks that succeeded
or failed. (Unreliable, given the broken return status of gnu tar.)
Warn the user if there are errors and abort the installation/upgrade
if we find any. Does at least catch Ctrl-C interrupts of unpacking.
* Make unwind_mounts() signal-safe.
* Sense of target_verify_* is broken. Replace with predicates that
return 1 iff the file or directory exists.
* Fix upgrade tests for existing etc.old (see above) before saving
target /etc as /etc.old.
* Other detail fixes.
all pathname-on-server related definitions to MI code, since they are now
defined to be consistent across all platforms. Also, nuke the "rels" global,
since release numbers are now always specified in "long form", i.e. 1.3A
vs. 13A.
ext_dir that is absolute directory name of where files are located to
extract. All setup routines must set that directory name correctly.
Make target.c compile if DEBUG is set.
* Change find_disks: after mouting target root, check for
/etc/fstab in target, and abort upgrade if not found.
* Change upgrade to check if the target root has /etc.old
before renaming the target /etc -> /etc.old. If found, abort.
(may indicates a failed upgrade.)
* Add save_etc(). saves target /etc as /etc.old, then copies back
config files we might want during upgrade, in case target is current root.
* Fix logic that fscks and mounts disks. Use subroutines to
fsck with a warning message and ok() on continue. Same for doing mounts.
* Fix bug in extract_dist(). Do NOT do target prefixing on the dist_dir,
since we didn't do target prefixing when mounting it.
(At least, NFS does't.)
* Add function to sanity-check target root.
Call after upgrade/install is done.
* Change MSG_realdir to print the strerror() of any errors.
Change target_chdir() to check if chdir() returns -1 and return errno.
* Make sure /dev exists before cd'ing there and running MAKEDEV.
* Use target_fopen() and fprintf() to write network state to disk,
to avoid inadvertent shell escapes.
* Fix silly typo in append_to_target_file. (maybe add shell quotes?)
Add more #ifdef DEBUG to target-prefixing.
* Fix niggle in creating a new resolv.conf: ctime()'s result ends in '\n',
so don't include one after the %s for the timestamp.
* Change upgrade: add the same ``disk stuff done'' message used in install,
so the user knows what's going to happen.
(is a more tailored message useful?)
* renames of files from one pathname within the target to another
(e.g., mv_within_target_or_die("/etc", "/etc.old");
* check to see if a partition name like "sd0a" is the current root
* Duplicate a file from the current root into the target root
(for copying /netbsd from RAMdisk into the target).
A no-op if the root is the install target).
Start using these where appropriate.
Change net.c to avoid losing any information when updating network
config files: where possible, do appends to files that might have more
info than we got from the user (e.g., /etc/hosts.)
Where possible, add comment saying file was created/modified by sysinst.
Add target.c to Makefiles.
* Minor fixes:
* Fix buglet in disks.c: make sure the target /etc exists before
touching the target's /etc/fstab. (Could be even cleaner.)
* If the target root is on /, don't copy our temporary /etc/resolv.conf
to the target /etc/resolv.conf. (Could be even cleaner.)
* Don't write the DNS hostname into /etc/defaultdomain.
DNS search paths are often not the same as YP group names.