Mental Patient on Mon, 21 Apr 2003 12:11:06 -0400


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

Re: [PLUG] automount question


On Mon, 2003-04-21 at 10:26, Eric Lucas wrote:
> I've successfully set up automount on a RH 8 system but 
> cannot get rid of a particular undesirable behavior.
> 
> When I cd to the automount directory "/misc/share" it 
> mounts it with all the files showing as owned by root.  
> I'd like to see who actually owns the files.
> 

Is this an nfs mount, or a local filesystem (other than something brain
dead like iso9660 or vfat)? I've had to add extra mount options to 'fix'
automounted windows partitions. They'd default to root ownerships (as
thats what automount runs as when it does the mount). 

> When I log onto the server where the share is I can see 
> the file is owned by the user, as expected.
> 

This lead me to ask about nfs... 

> I've perused the man pages for smbmount, 
> automount, and others, without finding the answer.
> 
> Anybody deal with this before?
> 

Look in the mount manpage? 

You dont have to stick to the /etc/auto.misc format. It is possible to
write a 'smarter' wrapper that checks who is doing the mount and acts
accordingly. It just needs to emit the appropriate output at some point.
Something like this:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main (int argc, char **argv) 
{
  char *dirname; /* the thing whoever is trying to mount */
  if ( (argc < 2) || (strcmp("myshare1",argv[1]) &&
strcmp("myshare2",argv[1])) ){ 
    fprintf(stderr,"Need valid share name\n");
    exit(-1);
  }
  dirname = argv[1];
  printf("-fstype=WHATEVER,dir=%s none\n",dirname);
  return 0;
}

I did something similar to this to set permissions to whom ever was
logged in and accessing a vfat mount point. Combined with a breif
timeout, it worked well enough, but this was essentially a single user
system.


Or, if its a matter of a multiuser mount point, the question then
becomes how to mount it. If its possible to achieve the desired mount
from the commandline, it should be possible to do the same via autofs.
If its NOT possible to mount this share properly on the commandline, fix
the driver/tools :)




-- 
Mental (Mental@NeverLight.com)

"Shouting at people who, for one reason or another, cannot hear you 
is mentally-ill behavior -- or evidence of idiots in command."

--George Smith, a virus researcher and columnist for SecurityFocus. 

CARPE NOCTEM, QUAM MINIMUM CREDULA POSTERO.

GPG public key: http://www.neverlight.com/pas/Mental.asc

Attachment: signature.asc
Description: This is a digitally signed message part