bug-hurd
[Top][All Lists]
Advanced

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

Hurd and UFS


From: Michael Teichgraeber
Subject: Hurd and UFS
Date: 02 Dec 2001 22:20:22 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Hello,


I am new to hurd and just tried to use `mkfs.ufs' to create an UFS on
a local partition. I am running a Hurd system from the Debian
hurd_20011105 package.

I expierienced that `mkfs.ufs' fails after printing the superblock
locations with a `Resource lost' error. After some investigation I
found that mkfs.ufs fails independent whether a hard disk partition or
a normal file is used and independent of the file's size.

It is interesting to me, that `mkfs.ufs' only fails when running it as
root. I was able to format `/dev/hd0s8' as user after setting the
appropriate permissions.

`mkfs.ufs' fails after calculating and printing the super block
locations when it first tries to access the file inside a lseek() call
in function hurd/ufs-utils/mkfs.c:rdfs().


This is what gdb told me:
,-------------------------------------------------------------------------
| Program received signal SIGLOST, Resource lost.
| 0x0109793c in evc_wait () from /lib/libc.so.0.2
| (gdb) backtrace 
| #0  0x0109793c in evc_wait () from /lib/libc.so.0.2
| #1  0x01097fe9 in mach_msg () from /lib/libc.so.0.2
| #2  0x011fb7bc in msg_sig_post () from /lib/libhurduser.so.0.0
| #3  0x010ac2d9 in _hurd_raise_signal () from /lib/libc.so.0.2
| #4  0x01163181 in lseek () from /lib/libc.so.0.2
| #5  0x0804c2dc in rdfs (bno=48, size=1024, bf=0x805fae0 "") at mkfs.c:1298
| #6  0x0804be2a in alloc (size=1024, mode=16877) at mkfs.c:1213
| #7  0x0804bd91 in fsinit (utime=1007213280) at mkfs.c:1172
| #8  0x0804b42f in mkfs (pp=0x0, fsys=0x1026043 "testfs", fi=5, fo=6)
`-------------------------------------------------------------------------

Do you have any idea, why lseek (with legal arguments) fails when
running `mkfs.ufs' as root?



A second point is, having created a UFS in a file as normal user, I
find the root directory inside it being owned by `root'. This means, I
am able to run the UFS translator with user rights on that file, but I
cannot write into the mounted directory.

Adding the lines 

        node.di_uid = (u_long) geteuid();
        node.di_gid = (u_long) getegid();

to ufs-utils/mkfs.c:fsinit() would make all initial directories inside
the new file system be owned by the user, who is creating the file
system (as it is the case when creating an ext2 file system).



Ciao,


Michael
-- 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]