1. Any chance of a BSD constant?

I'm a huge FreeBSD fan (best server OS ever) but never really used Euphoria on
it for whatever reason until now. However, I've run into a problem with a script
I wrote. This script does some security related stuff and needs to open a .so
file. Sadly, on BSD I use a more reliable library than the one that Linux has but
I need the script to work on both platforms but platform() returns LINUX for
both. I had a workaround that used certain files in the filesystem heirarchy to
determine the OS but I intend to use this on BSD as a jailed process and don't
want to have to allow access to certain directories just to determine the
platform. So, is there any chance of having a BSD constant for use by platform()
for those of us that are developing for both BSD and Linux at a level where they
differ?


The Euphoria Standard Library project :
    http://esl.sourceforge.net/
The Euphoria Standard Library mailing list :
    https://lists.sourceforge.net/lists/listinfo/esl-discussion

new topic     » topic index » view message » categorize

2. Re: Any chance of a BSD constant?

D. Newhall wrote:
> I'm a huge FreeBSD fan (best server OS ever) but never really used Euphoria
> on it for whatever reason until now. However, I've run into a problem with a
> script I wrote. This script does some security related stuff and needs to open
> a .so file. Sadly, on BSD I use a more reliable library than the one that
> Linux
> has but I need the script to work on both platforms but platform() returns
> LINUX
> for both. I had a workaround that used certain files in the filesystem
> heirarchy
> to determine the OS but I intend to use this on BSD as a jailed process and
> don't want to have to allow access to certain directories just to determine
> the platform. So, is there any chance of having a BSD constant for use by
> platform()
> for those of us that are developing for both BSD and Linux at a level where
> they differ?

I guess something should be done about this.
Unfortunately the obvious solution of adding BSD
to the list of platform constants won't work.
I've already set the platform values to be the same
for Linux and FreeBSD, since 90% of the time that's
what you want. A lot of code would break if I
gave BSD it's own platform value.

I guess for now, if you can't detect a difference,
using getenv(), or open() or something,
you could just add your own BSD constant to your code, and
change one line of code when you copy to a Linux machine.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

3. Re: Any chance of a BSD constant?

I'm just starting to get into FreeBSD.

While we're waiting for a BSD constant, couldn't we
get 'uname' to tell us what kind of platform we're on?

Regards,
Bruce.

---
Warning:
This web site contains images and information which might disturb some viewers,
it may also affect the way you perceive the world around you
-- http://www.answersingenesis.org.au

new topic     » goto parent     » topic index » view message » categorize

4. Re: Any chance of a BSD constant?

Bruce M. Axtens wrote:
> 
> I'm just starting to get into FreeBSD.
> 
> While we're waiting for a BSD constant, couldn't we
> get 'uname' to tell us what kind of platform we're on?
> 
> Regards,
> Bruce.

Most of the time, yes, but it's a common security tactic to disable it so anyone
who gets shell access won't know the system specifics.


The Euphoria Standard Library project :
    http://esl.sourceforge.net/
The Euphoria Standard Library mailing list :
    https://lists.sourceforge.net/lists/listinfo/esl-discussion

new topic     » goto parent     » topic index » view message » categorize

5. Re: Any chance of a BSD constant?

Hi

What does getenv("OSTYPE") return, in your jailed application?

Chris

new topic     » goto parent     » topic index » view message » categorize

6. Re: Any chance of a BSD constant?

> What does getenv("OSTYPE") return, in your jailed application?

(just poking my $0.02 in here)

Ubuntu Linux - getenv("OSTYPE") = "linux-gnu"
Windows XP - getenv("OS") = "Windows_NT"

~Greg

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu