[Flightgear-devel] [flightgear-devel] File Authorization

2009-09-04 Thread Behlül UÇAR
Hi,

I want to ask a question regarding to the authorization problems on
input/output operations.

How can we have the value of $FG_ROOT and $FG_HOME in Nasal scripts. Is it
possible? Is there a globally defined macro for them?

I want to write a Nasal function that creates a file under $FG_ROOT, I want
it to be portable, I mean both works on windows and linux machines. For this
reason, I have to use a macro like $FG_ROOT, is it possible?

Greetings.
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] [flightgear-devel] File Authorization

2009-09-04 Thread Martin Spott
Behlül UÇAR wrote:

 I want to write a Nasal function that creates a file under $FG_ROOT, I want
 it to be portable, I mean both works on windows and linux machines.

I'm a bit doubtful about the 'portability' of writing to $FG_ROOT in
general, simply because this directory is supposed not to be writeable
by the average user on most of the different installation targets.
Please take into account that on almost every well-done system setup
the user is permitted to write to his own user directory and nowhere
else.

Cheers,
Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] [flightgear-devel] File Authorization

2009-09-04 Thread Anders Gidenstam

On Fri, 4 Sep 2009, Behlül UÇAR wrote:


Hi,

I want to ask a question regarding to the authorization problems on
input/output operations.

How can we have the value of $FG_ROOT and $FG_HOME in Nasal scripts. Is it
possible? Is there a globally defined macro for them?

I want to write a Nasal function that creates a file under $FG_ROOT, I want
it to be portable, I mean both works on windows and linux machines. For this
reason, I have to use a macro like $FG_ROOT, is it possible?


IIRC the values of $FG_ROOT and $FG_HOME are available as properties 
(below sim/ ?). I think that by default you can only write files with 
certain extensions to $FG_HOME and nothing at all to $FG_ROOT.

FlightGear's internal access rules for Nasal scripts are defined in
$FG_ROOT/Nasal/IOrules but of course the file system permissions
must also permit the action you want to do.

Cheers,

Anders
--
---
Anders Gidenstam
WWW: http://www.gidenstam.org/FlightGear/--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] [flightgear-devel] File Authorization

2009-09-04 Thread Behlül UÇAR
Thanks both of you for your answers,

I was thinking about modifying $FG_ROOT/Nasal/IOrules file for beating the
permission issue but I hadn't thought about file permissions especially in
linux.

Then there are two solutions for beating this problem;
First is creating an empty and permanent file before running Nasal code and
modifying it instead of creating it inside the Nasal code.
And the second is creating ~/home/FlightGear/  folder and working under it.

Since first solution also requires super-user privileges in Linux, the ideal
solution seems to be the second one.

If someone has a better idea, it would be very good to hear it.

Greetings.

2009/9/4 Anders Gidenstam anders-...@gidenstam.org

 On Fri, 4 Sep 2009, Behlül UÇAR wrote:

  Hi,

 I want to ask a question regarding to the authorization problems on
 input/output operations.

 How can we have the value of $FG_ROOT and $FG_HOME in Nasal scripts. Is it
 possible? Is there a globally defined macro for them?

 I want to write a Nasal function that creates a file under $FG_ROOT, I
 want
 it to be portable, I mean both works on windows and linux machines. For
 this
 reason, I have to use a macro like $FG_ROOT, is it possible?


 IIRC the values of $FG_ROOT and $FG_HOME are available as properties (below
 sim/ ?). I think that by default you can only write files with certain
 extensions to $FG_HOME and nothing at all to $FG_ROOT.
 FlightGear's internal access rules for Nasal scripts are defined in
 $FG_ROOT/Nasal/IOrules but of course the file system permissions
 must also permit the action you want to do.

 Cheers,

 Anders
 --
 ---
 Anders Gidenstam
 WWW: http://www.gidenstam.org/FlightGear/

 --
 Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
 trial. Simplify your report design, integration and deployment - and focus
 on
 what you do best, core application coding. Discover what's new with
 Crystal Reports now.  http://p.sf.net/sfu/bobj-july
 ___
 Flightgear-devel mailing list
 Flightgear-devel@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/flightgear-devel


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] [flightgear-devel] File Authorization

2009-09-04 Thread Martin Spott
Behlül UÇAR wrote:

 And the second is creating ~/home/FlightGear/  folder and working under it.

As far as I remember FlightGear will create a ~/.fgfs/ directory by
default - if you don't prevent it from doing so,

Martin.
-- 
 Unix _IS_ user friendly - it's just selective about who its friends are !
--

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel


Re: [Flightgear-devel] [flightgear-devel] File Authorization

2009-09-04 Thread Ron Jensen
On Fri, 2009-09-04 at 17:38 +0300, Behlül UÇAR wrote:
 Thanks both of you for your answers,
 
 I was thinking about modifying $FG_ROOT/Nasal/IOrules file for beating
 the permission issue but I hadn't thought about file permissions
 especially in linux.

IOrules is there for a reason, and it should not be beaten If it is
possible to beat IOrules that is a bug that needs to be squashed.

By default you may write to any file named $FG_HOME/*.sav $FG_HOME/*.log
or $FG_HOME/Export/* There are more, but these seem the most logical
file names for a nasal script. 

 Then there are two solutions for beating this problem;

Again, this is a security feature not a problem.  I'm not even fully
comfortable with allowing nasal to write at all, but I got out-voted. :)

 First is creating an empty and permanent file before running Nasal
 code and modifying it instead of creating it inside the Nasal code.
 And the second is creating ~/home/FlightGear/  folder and working
 under it. 
 
 Since first solution also requires super-user privileges in Linux, the
 ideal solution seems to be the second one. 
 
 If someone has a better idea, it would be very good to hear it. 
 
 Greetings


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel