Re: RFC: Adding a ``user'' mount option
Joe Marcus Clarke wrote: What I'd like to achieve is a simple out-of-the-box way of mounting media such as CDs, and floppy disks without users necessarily needing to know about sysctl. While I can't speak for KDE, I know GNOME already has the ability to detect user-mountable media, and gives the users icons on the desktop to mount said volumes. I don't know what exactly you mean with 'detect user-mountable media', but a KDE user may have desktop icons for every device/fs listed in /etc/fstab. I assume GNOME works in a similar way. And clicking on the icon of course will mount the media with the 'mount' command. KDE also monitor changes to the fstab file and can open a dialog window when a new media appears, but since the fstab file is not automatically updated on FreeBSD (I don't know how it works exactly on Linux) this feature is quite useless. -- Alex Dupre ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: RFC: Adding a ``user'' mount option
On Tue, 2006-04-04 at 08:30 +0200, Alex Dupre wrote: Joe Marcus Clarke wrote: What I'd like to achieve is a simple out-of-the-box way of mounting media such as CDs, and floppy disks without users necessarily needing to know about sysctl. While I can't speak for KDE, I know GNOME already has the ability to detect user-mountable media, and gives the users icons on the desktop to mount said volumes. I don't know what exactly you mean with 'detect user-mountable media', but a KDE user may have desktop icons for every device/fs listed in /etc/fstab. I assume GNOME works in a similar way. And clicking on the icon of course will mount the media with the 'mount' command. KDE also monitor changes to the fstab file and can open a dialog window when a new media appears, but since the fstab file is not automatically updated on FreeBSD (I don't know how it works exactly on Linux) this feature is quite useless. GNOME works in a similar fashion. Currently if vfs.usermount=1, FreeBSD scans the fstab list, and if the mount point is owned by the current user, it adds an icon for it. For dynamic updates, Linux has mtab. For FreeBSD (in GNOME, that is), we just periodically check for changes in the list of available file systems. Joe -- Alex Dupre -- Joe Marcus Clarke FreeBSD GNOME Team :: [EMAIL PROTECTED] FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome signature.asc Description: This is a digitally signed message part
Re: RFC: Adding a ``user'' mount option
On Mon, 2006-04-03 at 23:30 +0100, Robert Watson wrote: On Mon, 3 Apr 2006, Joe Marcus Clarke wrote: I would suggest that an extremely careful security audit of the userspace and kernel mount and unmount code is due -- especially things like the per-filesystem mount code (mount_nfs, etc). I'm not against the principle of this though. Agreed. I was hoping to make this solution secure, flexible, and easy to use. Sure. And if you don't commit bug fixes to mount, we'll know you haven't tried looking very hard, because it seems very likely to me it has problems :-). Also, I'm not 100% sure we should make the getuid() check return a hard error in user space. Let's continue to let the kernel code make the access control decision here. I did the check in user space so that I could read the fstab file, and know that the volume was allowed to be user-[un]mounted. I suppose, though, that I could set the flags in user space, then pass that to the kernel for the actual access control decision as you say. I'm not entirely clear on what ideal is, but one possibility is to allow the user mount bit to determine whether the mount system call is invoked with privilege. Thanks for the feedback. I'll try and release an updated diff this weekend that incorporates your suggestions, and I'll attempt the wildcard suggestion made by silby. Joe Robert N M Watson -- Joe Marcus Clarke FreeBSD GNOME Team :: [EMAIL PROTECTED] FreeNode / #freebsd-gnome http://www.FreeBSD.org/gnome signature.asc Description: This is a digitally signed message part
Function calling
Hello. I'm writing a function tracer on freebsd to know which function the process passes inside. ex: nico cat toto.c int foo4() { } int foo3() { } int foo2() { foo3(); } int foo1() { foo2(); } int main() { foo1(); foo4(); } nico will print: 0x80484a8 (foo1) 0x804849c (foo2) 0x8048494 (foo3) ret @ 0x8048498 ret @ 0x80484a5 ret @ 0x80484b1 0x804848c (foo4) ret @ 0x8048490 I use PTRACE to run the process in single-stepping mode. For each step I look on the next instruction (read at %eip) and I seek the following sequence: call [backup eip in addr and wait a step] pushl %ebp movl%esp, %ebp [print addr and the sym associed] OR (plt call) call jmp * pushl $ jmp . [print eip and the sym associed] OR leave ret [print ret @ eip] But when the program uses the libc I have more RET than call ... What's the good way to find function calls and return ? Thanks in advance for your help and sorry for my poor english. -- Nico ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
RE: cloning a FreeBSD HDD
Hi guys, Why does everyone talk about dump+restore as a pair? I thought it was possible just to dump a filesystem to a different hard disk i.e. dump -0a -f /dev/ad2 / Also, how can I find out which /boot/boot# file a freebsd system is using by default? Kind Regards Khaled -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of M. Warner Losh Sent: 29 March 2006 05:04 To: [EMAIL PROTECTED] Cc: freebsd-hackers@freebsd.org Subject: Re: cloning a FreeBSD HDD In message: [EMAIL PROTECTED] Patrick Tracanelli [EMAIL PROTECTED] writes: : : I heard its faster if you use two dd's; i.e: : : # dd if=/dev/ad0 bs=64k | dd of=/dev/ad1 bs=64k : : allowing read and write to proceed in parallel. : : : that's what ddd and 'team' are for. : I don't know if ddd is in the ports as it may clash inname with teh : debugger ddd : They internally fork and use several processes synchronised in some manner. : : Isn't dump+restore and a couple of fdisk+bsdlabel trick to copy the : source partitioning a better choice to clone this HDD? Yes. That's what I *ALWAYS* do, because hard drives are never the exact same size. fdisk -I makes the fdisk part easy. bsdlabel -R makes the disklabel cloning relatively painless. dump + restore is slow but reliabe. Warner ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: Function calling
Hi, But when the program uses the libc I have more RET than call ... What's the good way to find function calls and return ? I'm doing something similar at the moment, utilizing the Branch Single Stepping feature available in most x86 CPUs and came across that same problem. While debugging the issue, I found out that the dynamic linker calls requested functions by returning to them. I believe this is done because this is a (the only) generic way to call a variable addresses without destroying register contents. Any further info or a confirmation of that guess would be much appreciated. --- the code in /usr/src/libexec/rtld-elf/i386/rtld_start.S: /* * Binder entry point. Control is transferred to here by code in the PLT. * On entry, there are two arguments on the stack. In ascending address * order, they are (1) obj, a pointer to the calling object's Obj_Entry, * and (2) reloff, the byte offset of the appropriate relocation entry * in the PLT relocation table. * * We are careful to preserve all registers, even the the caller-save * registers. That is because this code may be invoked by low-level * assembly-language code that is not ABI-compliant. */ .align 4 .globl _rtld_bind_start .type _rtld_bind_start,@function _rtld_bind_start: pushf # Save eflags pushl %eax# Save %eax pushl %edx# Save %edx pushl %ecx# Save %ecx pushl 20(%esp)# Copy reloff argument pushl 20(%esp)# Copy obj argument call[EMAIL PROTECTED] # Transfer control to the binder /* Now %eax contains the entry point of the function being called. */ addl$8,%esp # Discard binder arguments movl%eax,20(%esp) # Store target over obj argument popl%ecx# Restore %ecx popl%edx# Restore %edx popl%eax# Restore %eax popf# Restore eflags leal4(%esp),%esp# Discard reloff, do not change eflags ret # Return to target address --- Lutz pgpG4UHnqgsZm.pgp Description: PGP signature
Re: cloning a FreeBSD HDD
On Tue, 2006-Apr-04 11:12:03 +0100, Khaled Hussain wrote: Why does everyone talk about dump+restore as a pair? I thought it was possible just to dump a filesystem to a different hard disk i.e. dump -0a -f /dev/ad2 / It is. But /dev/ad2 will have a dumpfile on it, not a filesystem. The only thing that can then read /dev/ad2 is restore. Also, how can I find out which /boot/boot# file a freebsd system is using by default? None of the ones in the filesystem - these files are embedded into the beginning of the hard disk. One of boot0, boot0sio or mbr is located in absolute sector 0 of the disk. boot1 is located in sector 0 of the bootable slice boot2 is located in the (I think) sectors 1-15 of partition a. -- Peter Jeremy ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
RE: cloning a FreeBSD HDD
Hi Jeremy, Thanks for the clarification...at the moment I am trying to set a boot manager on my disk but am unsure which slice to set as the default boot selection when using the boot0cfg command. boot0cfg -Bv -s? ad2 disklabel -r ad0 (on a different bsd system) gives: 8 partitions: #size offsetfstype [fsize bsize bps/cpg] a: 20480004.2BSD0 0 0 # (Cyl.0 - 12*) b: 2104640 204800 swap# (Cyl. 12*- 143*) c: 1172583720unused0 0# (Cyl.0 - 7298*) e:40960 23094404.2BSD0 0 0 # (Cyl. 143*- 146*) f: 114907972 23504004.2BSD0 0 0 # (Cyl. 146*- 7298*) Am I correct in assuming that a: is slice 1, b: is slice 2, etc? If so then the slice to make bootable would be slice 3 in the following setup (which is my disk): 8 partitions: #size offsetfstype [fsize bsize bps/cpg] b: 2048642 310528000 swap # (Cyl. 19329*- 19456*) c: 3125766420unused0 0# (Cyl.0 - 19456*) e: 31052800004.2BSD0 0 0 # (Cyl.0 - 19329*) Kind Regards Khaled -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Peter Jeremy Sent: 04 April 2006 11:41 To: Khaled Hussain Cc: FreeBSD Hackers Subject: Re: cloning a FreeBSD HDD On Tue, 2006-Apr-04 11:12:03 +0100, Khaled Hussain wrote: Why does everyone talk about dump+restore as a pair? I thought it was possible just to dump a filesystem to a different hard disk i.e. dump -0a -f /dev/ad2 / It is. But /dev/ad2 will have a dumpfile on it, not a filesystem. The only thing that can then read /dev/ad2 is restore. Also, how can I find out which /boot/boot# file a freebsd system is using by default? None of the ones in the filesystem - these files are embedded into the beginning of the hard disk. One of boot0, boot0sio or mbr is located in absolute sector 0 of the disk. boot1 is located in sector 0 of the bootable slice boot2 is located in the (I think) sectors 1-15 of partition a. -- Peter Jeremy ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED] __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: RFC: Adding a ``user'' mount option
On Tue, Apr 04, 2006 at 02:47:18AM -0400, Joe Marcus Clarke wrote: On Tue, 2006-04-04 at 08:30 +0200, Alex Dupre wrote: Joe Marcus Clarke wrote: What I'd like to achieve is a simple out-of-the-box way of mounting media such as CDs, and floppy disks without users necessarily needing to know about sysctl. While I can't speak for KDE, I know GNOME already has the ability to detect user-mountable media, and gives the users icons on the desktop to mount said volumes. I don't know what exactly you mean with 'detect user-mountable media', but a KDE user may have desktop icons for every device/fs listed in /etc/fstab. I assume GNOME works in a similar way. And clicking on the icon of course will mount the media with the 'mount' command. KDE also monitor changes to the fstab file and can open a dialog window when a new media appears, but since the fstab file is not automatically updated on FreeBSD (I don't know how it works exactly on Linux) this feature is quite useless. GNOME works in a similar fashion. Currently if vfs.usermount=1, FreeBSD scans the fstab list, and if the mount point is owned by the current user, it adds an icon for it. Why do GNOME/KDE rely on /etc/fstab on FreeBSD? What are admins supposed to do on systems with more than, say, a hundred users. Having to add a line to /etc/fstab for every user is of course scriptable, but that does not make it less insane. As far as I got it, the current design boils down to the user creating a mount point, and then mounting the media manually, e.g. mount /dev/cd0 ~/cdrom. Granted the admin has set vfs.usermount to 1, of course. I don't really think that user mount has been designed with /etc/fstab in mind. So why not have GNOME/KDE create mount points for the user if vfs.usermount is 1? Since FreeBSD uses devfs, every device in /dev that usually represents a device with removable media can assumed to be present in hardware. GNOME/KDE could be patched to create mount points somewhere in the user's home directory, and issue a 'mount device mount_point' instead of 'mount mount_point' if the user clicks the device icon. This still requires novice home desktop users to set vfs.usermount to 1 though, so it's not a perfect solution. But it prevents having another suid binary just for convinience, and is suitable for large multi user installations. For dynamic updates, Linux has mtab. For FreeBSD (in GNOME, that is), we just periodically check for changes in the list of available file systems. Where? In /etc/fstab or /dev ? -- stefan http://stsp.in-berlin.de PGP Key: 0xF59D25F0 ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: cloning a FreeBSD HDD
In message: [EMAIL PROTECTED] Khaled Hussain [EMAIL PROTECTED] writes: : Why does everyone talk about dump+restore as a pair? I thought it was : possible just to dump a filesystem to a different hard disk i.e. : dump -0a -f /dev/ad2 / because that will create a dump file on ad2, not a filesystem that can be read by the kernel. : Also, how can I find out which /boot/boot# file a freebsd system is using by : default? I don't understand that question. Warner : Kind Regards : : Khaled : : -Original Message- : From: [EMAIL PROTECTED] : [mailto:[EMAIL PROTECTED] Behalf Of M. Warner Losh : Sent: 29 March 2006 05:04 : To: [EMAIL PROTECTED] : Cc: freebsd-hackers@freebsd.org : Subject: Re: cloning a FreeBSD HDD : : : In message: [EMAIL PROTECTED] : Patrick Tracanelli [EMAIL PROTECTED] writes: : : : : I heard its faster if you use two dd's; i.e: : : : : # dd if=/dev/ad0 bs=64k | dd of=/dev/ad1 bs=64k : : : : allowing read and write to proceed in parallel. : : : : : : that's what ddd and 'team' are for. : : I don't know if ddd is in the ports as it may clash inname with teh : : debugger ddd : : They internally fork and use several processes synchronised : in some manner. : : : : Isn't dump+restore and a couple of fdisk+bsdlabel trick to copy the : : source partitioning a better choice to clone this HDD? : : Yes. That's what I *ALWAYS* do, because hard drives are never the : exact same size. : : fdisk -I makes the fdisk part easy. bsdlabel -R makes the disklabel : cloning relatively painless. : : dump + restore is slow but reliabe. : : Warner : ___ : freebsd-hackers@freebsd.org mailing list : http://lists.freebsd.org/mailman/listinfo/freebsd-hackers : To unsubscribe, send any mail to [EMAIL PROTECTED] : : __ : This email has been scanned by the MessageLabs Email Security System. : For more information please visit http://www.messagelabs.com/email : __ : : : ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: cloning a FreeBSD HDD
Khaled Hussain wrote: Thanks for the clarification...at the moment I am trying to set a boot manager on my disk but am unsure which slice to set as the default boot selection when using the boot0cfg command. boot0cfg -Bv -s? ad2 disklabel -r ad0 (on a different bsd system) gives: 8 partitions: #size offsetfstype [fsize bsize bps/cpg] a: 20480004.2BSD0 0 0 # (Cyl.0 - 12*) b: 2104640 204800 swap# (Cyl. 12*- 143*) c: 1172583720unused0 0# (Cyl.0 - 7298*) e:40960 23094404.2BSD0 0 0 # (Cyl. 143*- 146*) f: 114907972 23504004.2BSD0 0 0 # (Cyl. 146*- 7298*) Am I correct in assuming that a: is slice 1, b: is slice 2, etc? No. The above is the label inside a single slice. a: is the first partition within that slice. Use fdisk to look at your slices. If you really are getting the above from /dev/ad2 rather than /dev/ad2sN where N is a number from 1 to 4, then it's in dedicated mode and the issue is moot, since there's no slice table. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: RFC: Adding a ``user'' mount option
Stefan Sperling wrote: Why do GNOME/KDE rely on /etc/fstab on FreeBSD? GNOME/KDE could be patched to create mount points somewhere in the user's home directory, and issue a 'mount device mount_point' instead of 'mount mount_point' if the user clicks the device icon. Limiting GNOME/KDE to just those mounts listed in /etc/fstab provides a mechanism of access control. If GNOME/KDE allowed user mounts of any device, then it would become possible for users to mount umounted system volumes. Using fstab also makes it possible for GNOME/KDE to mount items with mount options (sync, mode limits, quotas, etc.) and just rely on the system to get it right, rather than having system-specific, parallel mount code. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: bafug Freebsd 6.1 meeting
On 4/4/06 02:04, Julian Elischer [EMAIL PROTECTED] wrote: Julian Elischer wrote: The topic is 6.1... your questions answered Is there any call for it to be streamed out? I ask because we usually stream the meetings when there is a speaker, but this is more round table.. If it's not too much of a pain, I'd like to see it please, if only to see what kind of questions are out there. Ceri -- That must be wonderful! I don't understand it at all. -- Moliere ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: RFC: Adding a ``user'' mount option
So why not have GNOME/KDE create mount points for the user if vfs.usermount is 1? Since FreeBSD uses devfs, every device in /dev that usually represents a device with removable media can assumed to be present in hardware. GNOME/KDE could be patched to create mount points somewhere in the user's home directory, and issue a 'mount device mount_point' instead of 'mount mount_point' if the user clicks the device icon. pardon my ignorance, but how any of those methods described earlier may be superior to simply using sudo? Timestamp: 0x44335A44 [SorAlx] http://cydem.org.ua/ ridin' VN1500-B2 ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]