Hello Craig,

Monday, February 12, 2007, 8:00:22 PM, you wrote:

CB> http://blog.sun.com/ThinkThin/entry/cam_mass_storage_workaround

CB> You'll probably also want to make sure at the end of the CAM script that
CB> you unmount the USB drives and purge the mount point for the user.  I've
CB> been meaning to add that to the script.
I've tried to make a menu-item "Unmount USB" script, but it fails.

According to the log I found that when I plug in the USB drive,
the server does make a mountpoint directory owned by "utcu1:nobody"
but ownership soon changes to "root:root" (perhaps upon mounting?).
There's also a symlink to the mountpoint like "disk1", is seems to
always be owned by root:other.

While I might permit using utumount by sudo or SUID, is there a
better way? I think I remember this matter was discussed on the
list or in the blog, but the internet is too choppy on location
here to search efficiently :(

--- My menuitem for unmounting flashes

#!/bin/sh

# Umount user's USB devices if any
PATH=/opt/SUNWut/bin:$PATH:/usr/openwin/bin:.:/bin:/opt/SUNWutContrib/CAMGreet/bin
export PATH

#exec > /tmp/utumountusb.log 2>&1
#set -x

if [ -d "/tmp/SUNWut/mnt/$USER" ]; then
    for F in /tmp/SUNWut/mnt/"$USER"/*; do
        if [ -d "$F" -a ! -L "$F" ]; then
            # Only unmount directories
            utumount -u "$F" && rm -f "$F"
        fi
    done
    for F in /tmp/SUNWut/mnt/"$USER"/*; do
        if [ ! -d "$F" -a -L "$F" ]; then
            # Clean up stale symlinks
            rm -f "$F"
        fi
    done
fi

-- 
Best regards,
 Jim Klimov                            mailto:[EMAIL PROTECTED]

_______________________________________________
SunRay-Users mailing list
[email protected]
http://www.filibeto.org/mailman/listinfo/sunray-users

Reply via email to