Re: RFC: Adding a ``user'' mount option
Hello all, I've been watching this thread with some interest. I have actually found quite a straightforward solution to this problem that works for me under FreeBSD, and requires no extra entries in fstab, scripts changing permissions on login, or any other fairly ugly workaround. I assume that basically what we are looking for is to make mounting/unmounting of devices as simple as possible for non-technical users so they do not have to run mount manually at the command line. As mentioned before, you can easily globally restrict which users you wish to allow mounting of a particular device by simply using group permissions on the device. Then, assuming you've set vfs.usermount = 1: 1. ) First create some suitable directories under the user's /home folder for mounting the devices. For example, I have: [= Yggdrasil | aren | /usr/home/aren =]% ls -l media total 8 drwxr-xr-x 2 aren aren 512 Apr 6 21:37 cdrw/ drwxr-xr-x 2 aren aren 512 Apr 6 13:19 dvdrom/ drwxr-xr-x 2 aren aren 512 Apr 6 15:03 floppy/ drwxr-xr-x 2 aren aren 512 Apr 6 14:04 usbflash/ 2.) Next, add the devices icons to your KDE (or whichever) desktop. 3.) Now KDE by default will use the mount point specified under /etc/fstab. Obviously this is no good, since the current user will not own the mount point specified. However, if you simply open up the actual desktop device file, it is a very straightforward text file. You can then simply edit the MountPoint entry to point to the new mount location under your home folder. For example, for my DVD-ROM drive desktop link: [= Yggdrasil | aren | /usr/home/aren/Desktop =]% cat DVD-ROM [Desktop Action Eject] Exec=kdeeject %v Name=Eject [Desktop Entry] Actions=Eject; Dev=/dev/cd1 Encoding=UTF-8 Icon=dvd_mount MountPoint=/home/aren/media/dvdrom FSType=cd9660 ReadOnly=true Type=FSDevice UnmountIcon=dvd_unmount X-KDE-Priority=TopLevel The FSType entry is not usually there by default either, but it helps to make sure that the correct option is called to mount. Mounting a device is as simple as just clicking on the desktop icon now, which is exactly what we wanted. It will mount the device under the mount location in my /home, which I own, and everything works great. This method requires no alteration/extra entries in /etc/fstab, no chown on a global mount location (since the user always owns their own local mount point), no sudo and no setuid. Minimal security compromise. For a large network, it should be fairly trivial to create a script that will add the users to the correct group(s) for mouting the given device(s), create the necessary mount directories under the user's /home directory, and populate their KDE (or whichever) desktop with the correct (modified) desktop entries. Job done. Regards, Aren. pgprdvGZRpCF3.pgp Description: PGP signature
Re: RFC: Adding a ``user'' mount option
Anyway, I consider this to be a hack too :-) Hello all, I've been watching this thread with some interest. I have actually found quite a straightforward solution to this problem that works for me under FreeBSD, and requires no extra entries in fstab, scripts changing permissions on login, or any other fairly ugly workaround. I assume that basically what we are looking for is to make mounting/unmounting of devices as simple as possible for non-technical users so they do not have to run mount manually at the command line. As mentioned before, you can easily globally restrict which users you wish to allow mounting of a particular device by simply using group permissions on the device. Then, assuming you've set vfs.usermount = 1: 1. ) First create some suitable directories under the user's /home folder for mounting the devices. For example, I have: [= Yggdrasil | aren | /usr/home/aren =]% ls -l media total 8 drwxr-xr-x 2 aren aren 512 Apr 6 21:37 cdrw/ drwxr-xr-x 2 aren aren 512 Apr 6 13:19 dvdrom/ drwxr-xr-x 2 aren aren 512 Apr 6 15:03 floppy/ drwxr-xr-x 2 aren aren 512 Apr 6 14:04 usbflash/ 2.) Next, add the devices icons to your KDE (or whichever) desktop. 3.) Now KDE by default will use the mount point specified under /etc/fstab. Obviously this is no good, since the current user will not own the mount point specified. However, if you simply open up the actual desktop device file, it is a very straightforward text file. You can then simply edit the MountPoint entry to point to the new mount location under your home folder. For example, for my DVD-ROM drive desktop link: [= Yggdrasil | aren | /usr/home/aren/Desktop =]% cat DVD-ROM [Desktop Action Eject] Exec=kdeeject %v Name=Eject [Desktop Entry] Actions=Eject; Dev=/dev/cd1 Encoding=UTF-8 Icon=dvd_mount MountPoint=/home/aren/media/dvdrom FSType=cd9660 ReadOnly=true Type=FSDevice UnmountIcon=dvd_unmount X-KDE-Priority=TopLevel The FSType entry is not usually there by default either, but it helps to make sure that the correct option is called to mount. Mounting a device is as simple as just clicking on the desktop icon now, which is exactly what we wanted. It will mount the device under the mount location in my /home, which I own, and everything works great. This method requires no alteration/extra entries in /etc/fstab, no chown on a global mount location (since the user always owns their own local mount point), no sudo and no setuid. Minimal security compromise. For a large network, it should be fairly trivial to create a script that will add the users to the correct group(s) for mouting the given device(s), create the necessary mount directories under the user's /home directory, and populate their KDE (or whichever) desktop with the correct (modified) desktop entries. Job done. Regards, Aren. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
patches for devel/mprof
I include patches to stop teh devel/mprof port from core-dumping when run. it seems to produce reasonable results on my limited testing. it really needs someone who knows about symbol table formats to check it over and see if I've screwed up in some way. It was coredumping whenever it couldn't assign a symbol (function) name to a memory address. for example if the address was in a shared library. Anyone in ports like to check this? I ran it on 4.x but I think it hasn't really changed.. (I wonder if there is a newer version somewhere) Julian Only in xwork: .PLIST.flattened Only in xwork: .PLIST.mktmp Only in xwork: .PLIST.objdump Only in xwork: .PLIST.setuid Only in xwork: .PLIST.writable Only in xwork: .install_done.mprof-3.0._usr_local Binary files work/libc_mp.a and xwork/libc_mp.a differ diff -u work/mpgraph.c xwork/mpgraph.c --- work/mpgraph.c Fri Apr 7 13:39:45 2006 +++ xwork/mpgraph.c Fri Apr 7 01:45:35 2006 @@ -836,7 +836,15 @@ while (!mp_null(chain)) { vertex v; s = (mpsym) mp_car(chain); - v = make_vertex(fn_name(s), count, fn_lcount(s), fn_parents(s)); + if ( s == NULL) { + chain = (mpcell) mp_cdr(chain); + continue; + } + if (fn_name(s)) + v = make_vertex(fn_name(s), count, fn_lcount(s), fn_parents(s)); + else + v = make_vertex(unknown, count, fn_lcount(s), fn_parents(s)); + vpush(v, vset); count += 1; chain = (mpcell) mp_cdr(chain); @@ -864,7 +872,11 @@ parent_name = fn_name((mpsym) mp_car(parent)); parent_data = (mpdata) mp_cdr(parent); - vfrom = hlookup(parent_name); + if (parent_name == NULL) { + vfrom = hlookup(unknown); + } else { + vfrom = hlookup(parent_name); + } if (vfrom == vto) { vto-srefs += 1; Binary files work/mpgraph.o and xwork/mpgraph.o differ Binary files work/mprof and xwork/mprof differ diff -u work/mprof.c xwork/mprof.c --- work/mprof.cFri Apr 7 13:39:45 2006 +++ xwork/mprof.c Fri Apr 7 01:28:45 2006 @@ -186,7 +186,7 @@ }; -#define STHASH_SIZE2047 +#define STHASH_SIZE(2^20 -1) struct sthash *sthmem[STHASH_SIZE]; #defineSTNIL NULL @@ -491,7 +491,7 @@ #definestab_name(x)(stab[(x)].name) #definestab_addr(x)(stab[(x)].addr) -#defineST_SIZE 5000 +#defineST_SIZE 5 #defineST_NOT_FOUND-1 typedefint stindex; @@ -899,7 +899,8 @@ if (*(colp+2) == '(') { char *commap; commap = index(symp, ','); - *commap = '0'; + if (commap) + *commap = '0'; tnum = atoi((char *) index(symp, '(')+1); } else { tnum = atoi((char *) (colp+2)); @@ -926,7 +927,8 @@ if (*(colp+2) == '(') { char *commap; commap = index(symp, ','); - *commap = '0'; + if (commap) + *commap = '0'; tnum = atoi((char *) index(symp, '(')+1); } else { tnum = atoi((char *) colp+2); @@ -1275,9 +1277,15 @@ if (d5 != 0) { fx = st_locate(d5); fsym = pc_lookup(stab_addr(fx)); - fn_name(fsym) = stab_name(fx); - lte-path[SHORT_CALLSTACK_SIZE - (i + 1)].func = fn_name(fsym); - lte-path[SHORT_CALLSTACK_SIZE - (i + 1)].offset = d5 - stab_addr(fx); + if (stab_name(fx) == NULL) { + fn_name(fsym) = ; + lte-path[SHORT_CALLSTACK_SIZE - (i + 1)].func = ; + lte-path[SHORT_CALLSTACK_SIZE - (i + 1)].offset = 0; + } else { + fn_name(fsym) = stab_name(fx); + lte-path[SHORT_CALLSTACK_SIZE - (i + 1)].func = fn_name(fsym); + lte-path[SHORT_CALLSTACK_SIZE - (i + 1)].offset = d5 - stab_addr(fx); + } } else { lte-path[SHORT_CALLSTACK_SIZE - (i + 1)].func = ; lte-path[SHORT_CALLSTACK_SIZE - (i + 1)].offset = 0; @@ -1403,6 +1411,8 @@ fprintf(outfile, ...); } for (j = 0; j SHORT_CALLSTACK_SIZE; j++) { + if (lte.path[j].func == NULL) + lte.path[j].func = ; if (strcmp(lte.path[j].func, ) != 0) { if (leak_level == LEAK_SHOW) { fprintf(outfile, %s , lte.path[j].func); Binary files work/mprof.o and xwork/mprof.o differ ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
Using any network interface whatsoever
I'm trying to configure a bootable image to be used in various situations and on various (mostly unknown) hardware. For the filesystem I can use geom_label and /dev/ufs/UnlikelyString, but I'd also like to have it try to configure whatever interfaces the machine happens to have via DHCP. Other than specifying ifconfig_if0=DHCP once for every possible value of if, is there a mechanism to do this already? 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: Using any network interface whatsoever
On Fri, Apr 07, 2006 at 11:53:42PM +0100, Ceri Davies wrote: I'm trying to configure a bootable image to be used in various situations and on various (mostly unknown) hardware. For the filesystem I can use geom_label and /dev/ufs/UnlikelyString, but I'd also like to have it try to configure whatever interfaces the machine happens to have via DHCP. Other than specifying ifconfig_if0=DHCP once for every possible value of if, is there a mechanism to do this already? ifconfig_DEFAULT If you have non-Ethernet-like interfaces compiled in, you will probably want create empty ifconfig_if variables for them since DHCP won't work very well there. :) -- Brooks -- Any statement of the form X is the one, true Y is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 pgp0vch5GVjmd.pgp Description: PGP signature
Re: Using any network interface whatsoever
On Fri, Apr 07, 2006 at 03:57:42PM -0700, Brooks Davis wrote: On Fri, Apr 07, 2006 at 11:53:42PM +0100, Ceri Davies wrote: I'm trying to configure a bootable image to be used in various situations and on various (mostly unknown) hardware. For the filesystem I can use geom_label and /dev/ufs/UnlikelyString, but I'd also like to have it try to configure whatever interfaces the machine happens to have via DHCP. Other than specifying ifconfig_if0=DHCP once for every possible value of if, is there a mechanism to do this already? ifconfig_DEFAULT Superb, thank you! If you have non-Ethernet-like interfaces compiled in, you will probably want create empty ifconfig_if variables for them since DHCP won't work very well there. :) Good point, thanks again :) Ceri -- That must be wonderful! I don't understand it at all. -- Moliere pgpwXDII5LVgC.pgp Description: PGP signature
Re: RFC: Adding a ``user'' mount option
I suppose it would be nice to have something that works out of the box, but the solution I have been using is group permissions on the devices and then making the mount point in fstab relative instead of absolute. ie: /dev/cd0 cdrom cd9660 ro,noauto 0 0 Each user has a cdrom directory under their home directory. You still need mount points designated for all possible devices though. Does anyone know how Darwin / OsX are handling their auto-mount magic? Jeremy ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to [EMAIL PROTECTED]
patch for openssh - opinions?
hello, a while ago i've made a patch http://tehran.lain.pl/patches/ssh::controlfork against RELENG_6's openssh. it adds an option called `ControlFork' - if it is set on the master (ControlMaster) and its session disconnects, master forks into the background instead of waiting and blocking the terminal. i'm fairly novice to c, although i tried to make it in a non-intrusive and clean manner, i ask you if it's worth anything, i.e. do i have a lot of nerve asking if there's any point in sending it to the openssh devel list? -- sh pgpCQuWyE1V7y.pgp Description: PGP signature