[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Serious problem with Minixfs



Hi,

On Mon, Oct 18, 1999 at 08:43:18PM +0200, Martin "Nightowl" Byttebier wrote:
> Hello guys,
> 
> Today I ran into a serious problem on my Hades.
> For some reason Cab 2.7e crashed when I try to launch it (with MiNT-ovl) 
> and took down the whole system.
> Nothing serious I thought so I rebooted the Hades. As expected I got some 
> messages at boottime saying that my minixfs partitions weren't cleanly 
> unmounted but right after this when the system tried to run fsck on my 
> first minix the system halted for some time, then I got this horrible 
> message: minix-FS (L): root inode is not a directory?
> (Drive 'L' is were all the MiNT stuff is located)

Not a solution but a possible work-around:  There somehow wasn't a big
hello for an important feature added to the kernel by Frank, the new
Dchroot system call.  Add

	#define Dchroot(dir)	\
		trap_1_wl(0x14a, (long)(dir))

to your mintbind.h.  You can then easily write a C wrapper around CAB,
changing its root directory to something like /path/to/cab (but don't
forget to chdir before the exec).  The chroot will prevent CAB from
leaving its root directory and at least you can limit the possible damage.

This is the Dchroot(2) manual page:

NAME
	Dchroot - change root directory

SYNOPSYS
	#include <mintbind.h>

	short Dchroot (const char* path);

DESCRIPTION
	Dchroot changes the root directory to that specified in
	path.  This directory will be used for path names begin-
	ning with /.  The root directory is inherited by all chil-
	dren of the current process.

	Only the super-user may change the root directory.

	Note that this call does not change the current working
	directory, so that `.' can be outside the tree rooted at
	`/'.

	Also note that a call to Dchroot effectively disables
	the kernel's drive related calls like Dsetdrv(2) and
	the like.

RETURN VALUE
	On success, zero is returned. On error a negative error
	number.

ERRORS
	Depending on the file system, other errors can be
	returned.  The more general errors are listed below:

	EPERM	The effective UID is not zero.
	
	EFAULT	path points outside your accessible address space.

	ENAMETOOLONG
		path is too long.

	ENOENT	The file does not exist.

	ENOTDIR	Insufficient kernel memory was available.

	ENOTDIR	A component of path is not a directory.

	EACCES	Seach permission is denied on a component of the
		path prefix.

	ELOOP	Too many symbolic links were encountered in
		resolving path.

	EIO	An I/O error occured.

CONFORMING TO
	SVr4, SVID, 4.4BSD, X/OPEN.  This function is not part of
	POSIX.1.  SVr4 documents additional EINTR, ENOLINK and
	EMULTIHOP error conditions.  X/OPEN does not document EIO,
	ENOMEM or EFAULT error conditions.  This interface is
	marked as legacy by X/OPEN.

SEE ALSO
	Dchdir(2)

Well, in fact this is more or less the Linux manpage chroot(2)...

The next version of the GNU sh-utils will also include a working chdir(1)
command so that you could write such wrappers as shell scripts.

Ciao

Guido
-- 
http://stud.uni-sb.de/~gufl0000/ 
mailto:gufl0000@stud.uni-sb.de