Re: [fpc-pascal] fpdoc project file

2015-12-06 Thread Michael Van Canneyt



On Sun, 6 Dec 2015, Mattias Gaertner wrote:


Hi,

The 3.1.1 fpdoc -h help has some confusing items. Can someone explain
them please:

--project=fileUse file as project file


The command-line can get very long.

Instead, you can write a project file with all options in it.



--write-project=file
 Do not write documentation, create project file instead
--write-project=file
 Write all command-line options to a project file


Hmmm. Seems like a double entry in the help. Please create a bugreport.

This is to create a start of a project file based on a known command-line.

You take the command-line you used to generate documentation, add 
--write-project=file
and it will create a project file with the equivalent of the command-line 
settings.

As of that moment, you can simply use --project=file instead.

Seems also I didn't document the project file. I will.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] shell script with root rights and automatic password

2015-12-06 Thread Marc Santhoff
On So, 2015-12-06 at 17:20 +0100, Rainer Stratmann wrote:
> How to do this?
> 
> I would like to run a script with root rights from an application.
> The password should be transferred automatically.

Others told that unix doesn't allow skripts run as root.

For your task sudo may help. With it you allow the user (or group) in
question to run programs with root rights, but they have to identify
with their own password. Lowering security risk ...

-- 
Marc Santhoff 

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] shell script with root rights and automatic password

2015-12-06 Thread Rainer Stratmann
How to do this?

I would like to run a script with root rights from an application.
The password should be transferred automatically.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] shell script with root rights and automatic password

2015-12-06 Thread Mark Morgan Lloyd

Rainer Stratmann wrote:

How to do this?

I would like to run a script with root rights from an application.
The password should be transferred automatically.


Assuming you're talking unix: probably setuid root, but note that some 
programs- particularly anything using gtk- don't like this.


Otherwise you're probably into the realms of SSHing to localhost, but if 
you're having to do that sort of thing you really do need to ask 
yourself whether you really want to do what you think you want to do.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] shell script with root rights and automatic password

2015-12-06 Thread Michael Van Canneyt



On Sun, 6 Dec 2015, Rainer Stratmann wrote:


How to do this?

I would like to run a script with root rights from an application.
The password should be transferred automatically.


As far as I know, this cannot be done except by making the application itself 
setuid root.
If you create a setuid script, it will nevertheless execute with the rights of 
the invoking user.

I use a very small program which is setuid root, which I supply with the name of  a script and the 
arguments to feed to the script. The name of the script must match one of a list.


Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] fpdoc project file

2015-12-06 Thread Mattias Gaertner
Hi,

The 3.1.1 fpdoc -h help has some confusing items. Can someone explain
them please:

--project=fileUse file as project file
--write-project=file
  Do not write documentation, create project file instead
--write-project=file
  Write all command-line options to a project file


Mattias
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Target Win32 missing

2015-12-06 Thread Lukas Gradl


Quoting from my previous e-mail above: 'You need to tell fpc to call
compiler for the respective CPU using the -Pi386'. I.e. add '-Pi386' to
the command line options of 'fpc' (together with '-Twin32' and whatever
else you'd need there) and it should work.

Adding the -Pi386 parameter to fpc.cfg would not work (it's ignored
there); changing the default CPU to something different than the host CPU
doesn't make much sense (it would be more reasonable to install the 32-bit
compiler instead of the 64-bit compiler if you wanted to have i386 as the
default CPU target).


you mean calling through fpc -Twin32 -Pi386 ?

I tried that - got the "Error: Illegal parameter: -Twin32" again...

I'll do a make distclean;make all now for the whole thing...
perhaps that will help.

And while the machine is working I'll get some sleep...

Thanks for your patient help,

Lukas

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] Target Win32 missing

2015-12-06 Thread Lukas Gradl

Hello!

Sorry to disturb anyone... Perhaps I just need a little bit more  
sleep, but I cant find a solution to my problem...


When calling fpc from linux command line -Twin32 is missing. -TWin64  
works as expected.


Where did -Twin32 go?

I'm using Debian jessie x86_64 as main OS.

I compile fpc from the latest trunk sources with a script I wrote once.
Basically it does (among a few other things and platforms):

make all FPC=/usr/lib/fpc/2.6.4/ppcx64
sudo make install PREFIX=/usr FPC=/usr/lib/fpc/2.6.4/ppcx64
make clean
make crossall CPU_TARGET=i386 OS_TARGET=win32
sudo make crossinstall CPU_TARGET=i386 OS_TARGET=win32 PREFIX=/usrmake clean
make clean
make crossall OS_TARGET=win64
sudo make crossinstall OS_TARGET=win64 PREFIX=/usr


When calling fpc it shows under section -T
  -T  Target operating system:
  -Tdarwin   Darwin/Mac OS X
  -Tfreebsd  FreeBSD
  -Tiphonesim  iPhoneSimulator
  -TlinuxLinux
  -Tnetbsd   NetBSD
  -Topenbsd  OpenBSD
  -Tsolaris  Solaris
  -Twin64Win64 (64 bit Windows systems)

but no win32. And trying to compile results in "Error: Illegal  
parameter: -Twin32".


Any hint what I'm doing wrong?

regards
Lukas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Target Win32 missing

2015-12-06 Thread Karoly Balogh (Charlie/SGR)
Hi

On Sun, 6 Dec 2015, Lukas Gradl wrote:

> When calling fpc from linux command line -Twin32 is missing. -TWin64 works as
> expected. Where did -Twin32 go?

Nowhere. Seems you are using a 64bit targeted compiler, which can only
output x86_64 code, so Win64 only. You need an i386 compiler or
crosscompiler, to produce Win32 (therefore x86/i386) code.

There was no single compiler binary ever, which could do Win32 and Win64
in one.

Yes, indeed, have a sleep. :)

Charlie
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Target Win32 missing

2015-12-06 Thread Tomas Hajny
On Mon, December 7, 2015 00:04, Lukas Gradl wrote:


Hello,

 .
 .
> When calling fpc from linux command line -Twin32 is missing. -TWin64
> works as expected.
>
> Where did -Twin32 go?
>
> I'm using Debian jessie x86_64 as main OS.
>
> I compile fpc from the latest trunk sources with a script I wrote once.
> Basically it does (among a few other things and platforms):
>
> make all FPC=/usr/lib/fpc/2.6.4/ppcx64
> sudo make install PREFIX=/usr FPC=/usr/lib/fpc/2.6.4/ppcx64
> make clean
> make crossall CPU_TARGET=i386 OS_TARGET=win32
> sudo make crossinstall CPU_TARGET=i386 OS_TARGET=win32 PREFIX=/usrmake
> clean
> make clean
> make crossall OS_TARGET=win64
> sudo make crossinstall OS_TARGET=win64 PREFIX=/usr
>
>
> When calling fpc it shows under section -T
>-T  Target operating system:
>-Tdarwin   Darwin/Mac OS X
>-Tfreebsd  FreeBSD
>-Tiphonesim  iPhoneSimulator
>-TlinuxLinux
>-Tnetbsd   NetBSD
>-Topenbsd  OpenBSD
>-Tsolaris  Solaris
>-Twin64Win64 (64 bit Windows systems)
>
> but no win32. And trying to compile results in "Error: Illegal
> parameter: -Twin32".
>
> Any hint what I'm doing wrong?
 .
 .

What does '`fpc -Pi386 -PB`' do (the outer quotes should be removed before
copying it to the command line, the inner quotes are there on purpose)?

You need to tell fpc to call compiler for the respective CPU using the
-Pi386 (if it is installed correctly). Then you would see all the targets
supported for i386 listed under -T.

Tomas


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Target Win32 missing

2015-12-06 Thread Lukas Gradl


What does '`fpc -Pi386 -PB`' do (the outer quotes should be removed before
copying it to the command line, the inner quotes are there on purpose)?


it says:
/usr/bin/ppcross386

When I call that directly I get win32 under the -T section
But not when calling through fpc.


You need to tell fpc to call compiler for the respective CPU using the
-Pi386 (if it is installed correctly). Then you would see all the targets
supported for i386 listed under -T.


And how do I tell this to fpc? In the fpc.cfg?
I didn't touch win32 for some time - but it had been working. And I  
can't remember what I might have changed so it stopped working


Thanks for the help

Lukas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Target Win32 missing

2015-12-06 Thread Tomas Hajny
On Mon, December 7, 2015 01:02, Lukas Gradl wrote:
>>
>> What does '`fpc -Pi386 -PB`' do (the outer quotes should be removed
>> before
>> copying it to the command line, the inner quotes are there on purpose)?
>
> it says:
> /usr/bin/ppcross386
>
> When I call that directly I get win32 under the -T section
> But not when calling through fpc.
>
>> You need to tell fpc to call compiler for the respective CPU using the
>> -Pi386 (if it is installed correctly). Then you would see all the
>> targets
>> supported for i386 listed under -T.
>
> And how do I tell this to fpc? In the fpc.cfg?
> I didn't touch win32 for some time - but it had been working. And I
> can't remember what I might have changed so it stopped working

Quoting from my previous e-mail above: 'You need to tell fpc to call
compiler for the respective CPU using the -Pi386'. I.e. add '-Pi386' to
the command line options of 'fpc' (together with '-Twin32' and whatever
else you'd need there) and it should work.

Adding the -Pi386 parameter to fpc.cfg would not work (it's ignored
there); changing the default CPU to something different than the host CPU
doesn't make much sense (it would be more reasonable to install the 32-bit
compiler instead of the 64-bit compiler if you wanted to have i386 as the
default CPU target).

Hope this helps

Tomas


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] shell script with root rights and automatic password

2015-12-06 Thread Rainer Stratmann
 On Sunday 06 December 2015 19:15:45 you wrote:
> On So, 2015-12-06 at 17:20 +0100, Rainer Stratmann wrote:
> > How to do this?
> > 
> > I would like to run a script with root rights from an application.
> > The password should be transferred automatically.
> 
> Others told that unix doesn't allow skripts run as root.

That seens to be true. Nothing found about that.

What works is an entry in the sudoers file.
And then the program/script you can call with root rights.
 
> For your task sudo may help. With it you allow the user (or group) in
> question to run programs with root rights, but they have to identify
> with their own password. Lowering security risk ... 

What do you mean exactly with "with their own password"?
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] I thought fpc 3.0 would be compilable from fpc 3.0?

2015-12-06 Thread Bo Berglund
On Thu, 3 Dec 2015 10:32:24 -0500, Anthony Walter
 wrote:

>Follow up, yes the tags release 3 0 0 worked. Compiled on arm-linux
>Raspberry Pi 2. Thanks Jonas.

I am interested in getting a release version of FPC running on my RPi2
with Raspbian Jessie. I have been away so I am a few days late with my
question.
Was your approach this:

1) Install a version 2.6.4 FPC compiler on the Pi.

2) Check out release tag sources using
http://svn.freepascal.org/svn/fpc/tags/release_3_0_0/

3) Use the 2.6.4 compiler to build 3.0.0

4) Check out the sources again and use the newly made compiler to
build it.

Did I get this correct?

PS:
Is there a package available for Debian Jessie on Raspberry Pi2 such
that one does not have to build the compiler at all?
Like getting it via apt:
sudo apt-get install freepascal

DS

-- 
Bo Berglund
Developer in Sweden

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] I thought fpc 3.0 would be compilable from fpc 3.0?

2015-12-06 Thread Pierre Free Pascal
I just uploaded a raspberry 1 fpc-3.0.0 installation tar file
in dist/3.0.0/arm-linux directory on ftp.freepascal.org.

The IDE crashes when you try to debug a program within it,
but otherwise it should work ...
I will generate a testsuite run to see if there are specific issues.

Pierre Muller

> -Message d'origine-
> De : fpc-pascal-boun...@lists.freepascal.org [mailto:fpc-pascal-
> boun...@lists.freepascal.org] De la part de Bo Berglund
> Envoyé : dimanche 6 décembre 2015 18:12
> À : fpc-pascal@lists.freepascal.org
> Objet : Re: [fpc-pascal] I thought fpc 3.0 would be compilable from fpc
> 3.0?
> 
> On Thu, 3 Dec 2015 10:32:24 -0500, Anthony Walter
>  wrote:
> 
> >Follow up, yes the tags release 3 0 0 worked. Compiled on arm-linux
> >Raspberry Pi 2. Thanks Jonas.
> 
> I am interested in getting a release version of FPC running on my RPi2
> with Raspbian Jessie. I have been away so I am a few days late with my
> question.
> Was your approach this:
> 
> 1) Install a version 2.6.4 FPC compiler on the Pi.
> 
> 2) Check out release tag sources using
> http://svn.freepascal.org/svn/fpc/tags/release_3_0_0/
> 
> 3) Use the 2.6.4 compiler to build 3.0.0
> 
> 4) Check out the sources again and use the newly made compiler to
> build it.
> 
> Did I get this correct?
> 
> PS:
> Is there a package available for Debian Jessie on Raspberry Pi2 such
> that one does not have to build the compiler at all?
> Like getting it via apt:
> sudo apt-get install freepascal
> 
> DS
> 
> --
> Bo Berglund
> Developer in Sweden
> 
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Target Win32 missing

2015-12-06 Thread Lukas Gradl


Zitat von "Karoly Balogh (Charlie/SGR)" :


Hi

On Sun, 6 Dec 2015, Lukas Gradl wrote:

When calling fpc from linux command line -Twin32 is missing.  
-TWin64 works as

expected. Where did -Twin32 go?


Nowhere. Seems you are using a 64bit targeted compiler, which can only
output x86_64 code, so Win64 only. You need an i386 compiler or
crosscompiler, to produce Win32 (therefore x86/i386) code.

There was no single compiler binary ever, which could do Win32 and Win64
in one.

Yes, indeed, have a sleep. :)


but there was fpc as a wrapper for a long time calling the right compiler.
I have ppcrossi386 and other crosscompilers in my path - as I had for  
a long time. (see my answer to Tomas answer btw...)


When calling ppcrossi386 directly the win32 Target ist there - but not  
when calling through the fpc wrapper


Thanks for the help
Lukas
--


software security networks
Lukas Gradl 
Eduard-Bodem-Gasse 6
A - 6020 Innsbruck
Tel: +43-512-214040-0
Fax: +43-512-214040-21

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Target Win32 missing

2015-12-06 Thread leledumbo
> you mean calling through fpc -Twin32 -Pi386 ? 
> 
> I tried that - got the "Error: Illegal parameter: -Twin32" again... 

Works fine here. Can you ensure that fpc, ppcx64 and ppcross386 (the latter
two are symlinks) are in the same /usr/bin? fpc driver will process -P
parameter to decide which ppc to call, the other parameters will be
straightly passed to the called ppc.

Here's one from mine:
$ fpc -Pi386 -i
Free Pascal Compiler version 3.1.1

Compiler date  : 2015/11/30
Compiler CPU target: i386

Supported targets (targets marked with '{*}' are under development):
  Go32v2: GO32 V2 DOS extender
  Linux: Linux for i386
  OS2: OS/2
  Win32: Win32 for i386
  FreeBSD: FreeBSD/ELF for i386
  solaris: Solaris for i386 {*}
  Beos: Beos for i386 {*}
  NetBSD: NetBSD for i386 {*}
  Netware: Netware for i386(clib)
  WDOSX: WDOSX DOS extender
  OpenBSD: OpenBSD for i386 {*}
  EMX: OS/2 via EMX
  WATCOM: Watcom compatible DOS extenders
  Netwlibc: Netware for i386(libc)
  WinCE: WinCE for i386
  Darwin: Darwin for i386
  embedded: Embedded
  Symbian: Symbian OS for i386
  Haiku: Haiku for i386 {*}
  NativeNT: Native NT for i386 {*}
  iPhoneSim: Darwin/iPhoneSim for i386
  Android: Android for i386
  AROS: AROS for i386

$ fpc -Px86_64 -i
Free Pascal Compiler version 3.1.1

Compiler date  : 2015/11/30
Compiler CPU target: x86_64

Supported targets (targets marked with '{*}' are under development):
  Linux: Linux for x86-64
  FreeBSD: FreeBSD for x86-64
  Win64: Win64 for x64
  Darwin: Darwin for x86_64
  solaris: Solaris for x86-64 {*}
  OpenBSD: OpenBSD for x86-64 {*}
  NetBSD: NetBSD for x86-64 {*}
  AROS: AROS for x86_64
  DragonFly: DragonFly for x86-64
  iPhoneSim: Darwin/iPhoneSim for x86_64




--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Target-Win32-missing-tp5723272p5723279.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] shell script with root rights and automatic password

2015-12-06 Thread Jonas Maebe

Rainer Stratmann wrote:

What works is an entry in the sudoers file.
And then the program/script you can call with root rights.


I hope this is for something that will only ever run on your own 
machine, because unless you take a lot of precautions (hardcoding a set 
of *absolute* paths to scripts that may be executed this way like 
Michael mentioned can help, but only if you can guarantee none of these 
locations can be overwritten, symlinked to somewhere else or substituted 
through mounting), this is a security disaster waiting to happen.


A lot of security holes in various Unix-like OSes happen through abuse 
of setuid helpers or helper programs executed as root. If you really 
need to do something as root, having a small setuid binary that can only 
do this one thing is much safer than invoking a general purpose shell 
that can do anything. You can find a very basic overview of some issues 
at 
https://developer.apple.com/library/mac/documentation/OpenSource/Conceptual/ShellScripting/ShellScriptSecurity/ShellScriptSecurity.html 
.


If everything mentioned there isn't completely obvious to you, please do 
not distribute any program that invokes shell scripts as root before you 
familiarise yourself very thoroughly with security at the Unix/shell 
level. And even if it is, ask yourself whether there is no safer way to 
achieve the same results.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Target Win32 missing

2015-12-06 Thread Tomas Hajny
On Mon, December 7, 2015 01:31, Lukas Gradl wrote:
 .
 .
> you mean calling through fpc -Twin32 -Pi386 ?
>
> I tried that - got the "Error: Illegal parameter: -Twin32" again...
 .
 .

Yes, that's what I meant. Could you please check the timestamp of the fpc
binary on your path to make sure that it isn't some very old version (it
might be possible that some really old version required the -P parameter
at the beginning or something like that)? Also, could you please run 'fpc
-Pi386 -it' (it should list the supported targets for i386)?

Thanks

Tomas


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal