Hairstyle magazine, hairstyle for 2008, 2009
Hide Right Panel
We should show our individuality not only across the style of dressing ourselves, but also by our head-dresses.
According to latest tendencies, head-dresses have to be as most natural. - We turn already to natural slaughter-houses, to the natural texture of hair. Such which can be blow-dried, does not it is necessary them to press with the iron, does not it is necessary them to turn on brushes, absolutely not to comb back, rolls on the head also already are not necessarily  timely - Philip Galas  speaks. - We found  that these natural head-dresses, completely free, completely loose, this this is, what to wear will be.
 
FireBoard
Welcome, Guest
Please Login or Register.    Lost Password?
prefix path Is a directory exported? (1 viewing) (1) Guests
Go to bottom Post Reply Favoured: 0
TOPIC: prefix path Is a directory exported?
#16251
Paul D. Smith (Visitor)
Click here to see the profile of this user
Birthdate:
prefix path Is a directory exported?  
I need to write a _script_ which can tell, with 100% accuracy, whether a directory is properly NFS-exported from the local host (and I can't use rsh to go to another host and check it . Also, this must work on at least SunOS 4.x, Solaris, HP-UX, AIX, Linux, and FreeBSD. Either sh or perl is OK. I'm slogging my way through doing things like checking /etc/xtab (or /usr/sbin/share on Solaris) for a list of exported directories, then trying to determine if the directory I'm given is (a) a subdirectory of any of those and (b) on the same filesystem, but it's pretty tedious. Not to mention the horror if the directory I get is a sym_link_ or (ugh!) its path contains a sym_link_!! I'm wondering if anyone has a shortcut. It's damn annoying that /net/`hostname` lists _all_ the filesystems, not just those that are exported, or this would be quite simple :-/.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#16252
Kai Großjohann (Visitor)
Click here to see the profile of this user
Birthdate:
prefix path Is a directory exported?  
I need to write a _script_ which can tell, with 100% accuracy, whether a directory is properly NFS-exported from the local host (and I can't use rsh to go to another host and check it . Hm.  I like to use `df -k .' to find out the mount point of the current directory.  And I guess you should be able to find that mount point in the output of `showmount -e'. But somehow I'm afraid that this is far too simplistic an approach and you have already tried it first thing in the morning...  But maybe it helps if you say what problems that approach has? kai
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#16253
Paul D. Smith (Visitor)
Click here to see the profile of this user
Birthdate:
prefix path Is a directory exported?  
%% This e-mail address is being protected from spam bots, you need JavaScript enabled to view it (Kai Großjohann) writes:   kg Paul D. Smith < This e-mail address is being protected from spam bots, you need JavaScript enabled to view it writes:   I need to write a _script_ which can tell, with 100% accuracy, whether a   directory is properly NFS-exported from the local host (and I can't use   rsh to go to another host and check it .   kg Hm.  I like to use `df -k .' to find out the mount point of the   kg current directory.  And I guess you should be able to find that mount   kg point in the output of `showmount -e'.   kg But somehow I'm afraid that this is far too simplistic an approach and   kg you have already tried it first thing in the morning...  But maybe it   kg helps if you say what problems that approach has? Using df will tell me what the mount point is, and I can easily find out, for example, whether the directory is _mounted_. I want to know if a local directory is _exported_. Recall that you don't have to export an entire filesystem: you can export any subset of a filesystem, so knowing what filesystem I'm on is only half the battle. I need to make sure that the directory in question is (a) a subdirectory of an exported directory, and (b) on the same filesystem as the exported directory.  At least, I can't think of any simpler way. Then things get gross, because what if some part of the path is a sym_link_ that goes through a non-exported directory, but the result of the _link_ is exported?  So you can't, to be 100% sure, just jump to the end of the _link_ and use pwd to find the fully-qualified path, because on a remote system you might not be able to follow all those _link_s!  You'd have to check each component of the path for sym_link_s and make sure each one _link_s to an exported directory...  ugh. For example, suppose I have filesystem /home and /opt.  I export /opt/my/subdir.  But my filesystem looks like this:   /home/_link_2 - /opt/my/subdir/dir2   /opt/my/subdir/dir2   /opt/my/subdir/_link_1 - /home/_link_2 Now on the local host, that all works; if I check /opt/my/subdir/_link_1 and the directory it (eventually) points to, and it will appear to be properly exported.  The only way I can tell it isn't is by following all the sym_link_s by hand and testing each one. I was hoping there was some way I could convince NFS or something to do it for me :-/. If the @#$%& /net filesystem worked correctly and contained only the _exported_ filesystems instead of _all_ the filesystems, it would be trivial; I could just check to see if /net/`hostname`/opt/my/subdir/_link_1/. or whatever existed.  But, it doesn't so I can't.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#16254
Kai Großjohann (Visitor)
Click here to see the profile of this user
Birthdate:
prefix path Is a directory exported?  
If the @#$%& /net filesystem worked correctly and contained only the _exported_ filesystems instead of _all_ the filesystems, it would be trivial; I could just check to see if /net/`hostname`/opt/my/subdir/_link_1/. or whatever existed.  But, it doesn't so I can't. Well, /net/`hostname`/opt/my/subdir/_link_1/ is a sym_link_ to /home/_link_2 which need not be exported.  It would work if it was a sym_link_ to ../../../../home/_link_2, but it isn't.  But I see what you mean. Absolute sym_link_s (at least) on NFS file systems should be forbidden I'm afraid you're right: you need to go through the path and check each component whether it's a sym_link_ and do smart things with it. Hm. kai
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#16255
Ken Pizzini (Visitor)
Click here to see the profile of this user
Birthdate:
prefix path Is a directory exported?  
Then things get gross, because what if some part of the path is a sym_link_ that goes through a non-exported directory, but the result of the _link_ is exported?  So you can't, to be 100% sure, just jump to the end of the _link_ and use pwd to find the fully-qualified path, because on a remote system you might not be able to follow all those _link_s!  You'd have to check each component of the path for sym_link_s and make sure each one _link_s to an exported directory...  ugh. And if a _link_ crosses from within one exported directory to outside it (either via an absolute path or via a .. past the root of the exported tree), you need to know details of the mount point names (and sym_link_s to same) on the remote system in order to tell whether or not you are landing back on an exported directory.  This is not likely to be something that you want to be tracking on the exporting system, so you really just want to be sure that you never leave an exported directory. Below is a perl _script_ which should serve as a starting point for your needs.  (It can be rewritten in bash or ksh if desired; perl just seemed more natural at first glance.)                
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
#16256
Paul D. Smith (Visitor)
Click here to see the profile of this user
Birthdate:
prefix path Is a directory exported?  
%% This e-mail address is being protected from spam bots, you need JavaScript enabled to view it (Ken Pizzini) writes:   kp And if a _link_ crosses from within one exported directory to   kp outside it (either via an absolute path or via a .. past the   kp root of the exported tree), you need to know details of the   kp mount point names (and sym_link_s to same) on the remote system in   kp order to tell whether or not you are landing back on an exported   kp directory. This would generally be true, of course, but I have the slight advantage in knowing that all these filesystems will be available using the /net/<host special automount map, and not through traditional mounting. So, in fact, I always _do_ know the details of the mount point names; they're the same as on the local system (with /net/<host prepended to fully-qualified paths obviously). OTOH, maybe you're right and I should just force this situation to be an error.  I'll have to think about whether it would be acceptable to the users to disqualify this behavior.   kp Below is a perl _script_ which should serve as a starting point   kp for your needs. Cool, I'll check it out.
 
Report to moderator   Logged Logged  
  The administrator has disabled public write access.
Go to top Post Reply
Powered by FireBoardget the latest posts directly to your desktop
Język ANSI C
Język ANSI C
godi.pl
Hotele Hrubieszów

www.hotelenamapie.pl
moto giełda
ogłoszenia motoryzacyjne
www.gieldamotor.pl
cukierki
cukierasy
www.wiaderko.com
Taśmy z nadrukiem
Taśmy z nadrukiem Biella
www.biella.pl
Full free games for download - Polish builders - Le c a s i n o online - Dating - drug detox center - Bumpres - mastitis tester - uptime monitoring service - Hoteller Berlin - Hotel Berlino
meble seo Bilety lotnicze KLM Życzenia urodzinowe schody