1827458 Members
6182 Online
109965 Solutions
New Discussion

VMS symbolic link

 
rambabubolla
New Member

VMS symbolic link

How can i find symbolic link information in FAB?

I am having situavtion
if(the file is the symbolic linke )
{
do this;
}

else
{
do this;

}
9 REPLIES 9
Ian Miller.
Honored Contributor

Re: VMS symbolic link

If a file is a symbolic link the file organisation will be FAT$_special, record attributes will show its a symbolic link
____________________
Purely Personal Opinion
Steven Schweda
Honored Contributor

Re: VMS symbolic link

> How can i find symbolic link information in
> FAB?

Why look in the FAB? If you're writing in C,
then why not use the usual C RTL lstat() and
a macro like, say, S_ISLNK? (See .)
Or, what does readlink() do?

Drag in the FAB if it's convenient, or if you
can't do the job any other way, but it would
not be the first thing that I'd try.
Steven Schweda
Honored Contributor

Re: VMS symbolic link

alp $ type isl.c
#include
#include
#include

int main( int argc, char **argv)
{
int sts = 0;
struct stat stat_l;

if (argc >= 2)
{
sts = lstat( argv[ 1], &stat_l);
if (sts == 0)
{
printf( " symlink = %d, readlink() = %d.\n",
S_ISLNK(stat_l.st_mode), readlink( argv[ 1], NULL, 0));
}
}
return sts;
}
alp $ cc isl
alp $ link isl

alp $ dire /date /prot /size isl.c;, isl.link;

Directory ALP$DKA0:[SMS.ITRC]

isl.c;5 1 20-SEP-2010 09:19:57.94 (RWED,RWED,RE,)
isl.link;1 -> isl.c
1 20-SEP-2010 09:12:08.81 (RWED,RWED,RE,)

Total of 2 files, 2 blocks.

alp $ mcr sys$disk:[]isl isl.c
symlink = 0, readlink() = -1.

alp $ mcr sys$disk:[]isl isl.link
symlink = 1, readlink() = 0.
Cass Witkowski
Trusted Contributor

Re: VMS symbolic link

Does OpenVMS truly support symbolic links or just alias and hardlinks?

Hoff
Honored Contributor

Re: VMS symbolic link

Here's some V8.3 stuff on symlinks, and which where this all started:

http://h71000.www7.hp.com/doc/83final/5763/5763pro_021.html

http://h71000.www7.hp.com/doc/83final/6679/6679pro_008.html

Here's some V8.4 stuff, and look at section 3.6

http://h71000.www7.hp.com/doc/84final/6677/ba322_90089.pdf

Which gets you to commands such as:

$ CREATE /SYMLINK="/SYS$HELP/CC_RELEASE_NOTES.PS" RELNOTES.PS

Steven Schweda
Honored Contributor

Re: VMS symbolic link

> Does OpenVMS truly support symbolic links
> or just alias and hardlinks?

Are you looking at these postings?

> isl.link;1 -> isl.c
> 1 20-SEP-2010 09:12:08.81 (RWED,RWED,RE,)

What does that look like to you?
rambabubolla
New Member

Re: VMS symbolic link

thanks for replays
Cass Witkowski
Trusted Contributor

Re: VMS symbolic link

Hoff,

Thanks for the links.

Steve, I know that my question may have sounded stupid but symbolics links are new to me. I'm not very familiar with this type of links in Unix and was only familiar with alias and hard links on OpenVMS. I was asking for clarification and confirmation.

I'm working on security the Apache server on OpenVMS to DoD standards. One of their issues is the use of symbolic links in the HTDOCS directory. Apparently, symbolic links are a known security issues in Unix. I'm trying to accertain if now that these symbolic links are available in OpenVMS whether the same security issues will present themselves.

Hoff
Honored Contributor

Re: VMS symbolic link

>Steve, I know that my question may have sounded stupid but symbolics links are new to me. I'm not very familiar with this type of links in Unix and was only familiar with alias and hard links on OpenVMS. I was asking for clarification and confirmation.

In all seriousness, I went to Google and entered a couple of search strings to get those links.

To help target the search to OpenVMS and environs, it is often preferable to add /site:h71000.www7.hp.com/ onto the Google query to target the search to a specific web server. This tactic on those parts of the HP web site that don't have Google blocked; some sections do.

>I'm working on security the Apache server on OpenVMS to DoD standards. One of their issues is the use of symbolic links in the HTDOCS directory. Apparently, symbolic links are a known security issues in Unix. I'm trying to accertain if now that these symbolic links are available in OpenVMS whether the same security issues will present themselves.

There are controls over whether the symbolic links can be followed within Apache, and Apache is going to use the C interfaces.

See the FollowSymLinks and related settings

http://httpd.apache.org/docs/2.0/sections.html

The same issue that the security reviewers are likely concerned about with that has been entirely and easily possible with VMS since VAX/VMS V3.0 or so, too. ftp servers can have some similar issues with following links, too.

I would encourage starting your own thread if this area is of interest to you, after having done some initial Google searches. There's no sense conflating this Apache security discussion with a C programming topic, after all.

Which reminds me (for both of the questioners in this thread), go read the C reference manual. The C folks added a gazillion library calls from around 1995 to around 2005 or so; there are numerous "new" APIs there that didn't really make the release notes. This if you haven't read the reference manual from end-to-end in the past decade or so, as I hadn't done when I discovered this. And C99 has some useful features, and a subset of C99 is available on VMS.