[fpc-pascal]port access as simple user

2003-07-29 Thread Balázs Csaba
Title: Üzenet



Hi!
I like to access 
ports as a simple user. Only root user can do it.
So i like to run a 
program with root user and first fork or execve to the same program with 
setuid(). So how can i run a program with root user whene i logged in with a 
simple one? Can i fork port access rights?
 
Best 
reg.
#Tsch : Balázs Csaba 
 


[fpc-pascal]port access as simple user

2003-07-29 Thread Balázs Csaba
Hi!
I like to access ports as a simple user. Only root user can do it.
So i like to run a program with root user and first fork or execve to the
same program with setuid(). So how can i run a program with root user whene
i logged in with a simple one? Can i fork port access rights?

Best reg.
#Tsch : Balázs Csaba 


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]port access as simple user

2003-07-29 Thread Michael Van Canneyt


On Tue, 29 Jul 2003, [iso-8859-2] Balázs Csaba wrote:

> Hi!
> I like to access ports as a simple user. Only root user can do it.
> So i like to run a program with root user and first fork or execve to the
> same program with setuid(). So how can i run a program with root user whene
> i logged in with a simple one? Can i fork port access rights?

You must make your program "setuid root".

i.e. compile and install as root, and then run
"chmod 4755 yourprogram"

The program will then be run with root permissions.

Michael.


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RE: [fpc-pascal]port access as simple user

2003-07-29 Thread Balázs Csaba
Thx, it was the problem.

#Tsch : Balázs Csaba 

> You must make your program "setuid root".
> 


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]Resource file syntax...

2003-07-29 Thread L D Blake

Does anyone know where I can get some documentation and examples on Windows
resource files?

I'm mostly interested in imbedding icons, menus, dialogs gadgets and version
info.

Thanks..

-
 L D Blake


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


RE: [fpc-pascal]Resource file syntax...

2003-07-29 Thread Balázs Csaba
http://www.users.on.net/johnson/resourcehacker/

It can handle all exe files, that compiled with resources. Can get or edit
menus, dialogs, icons and not only text mode. You can see menus and dialogs
in wyswyg mode.

#Tsch : Balázs Csaba 

> Does anyone know where I can get some documentation and 
> examples on Windows resource files?
> 
> I'm mostly interested in imbedding icons, menus, dialogs 
> gadgets and version info.


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]ASCII plotting

2003-07-29 Thread Alan Mead
I would like to include some simple "ascii plots" in my textual
output files, like :

10.0|  **
| *  *
| *  *
|**
|**
*  *
*   *
**
* *
* *
*  *
0.00|---*-*-
 -3.5  3.50

I've coded something simple ... three times now... and I now realize
how complex this can get.  Lot's of isues with changing scales,
optimizing the ouptut for very granular rows and columns, syncing the
plot with the labels, choosing "good" labels, etc.  For example, I
found that I need to draw a "line" between the points otherwise the
vertical line segments get lost:

10.0|  **
| *  *
| 
|**
|  
|  *
|   *
|*
| *
|  
*  *
0.00|---*-*-
 -3.5  3.50

But now I find that if I choose too many X values then the line
segment drawing tends to make the make the drawing "fat", especially
at the tails:

10.0|  **
| *  *
| *  *
|**
|* *
|* *
|* *
|*  *
**  *
****
** ***
0.00|---***-
 -3.5  3.50

Because I'm plotting discrete functions, changing the number of X
values requires a complicated interpolation procedure...

So, does anyone, by chance, already have a unit for doing this?

-Alan Mead

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Resource file syntax...

2003-07-29 Thread Ivan Shikhalev
Hello, L!
You wrote to "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> on Tue, 29 Jul 2003 09:55:38 -0400:


 LB> Does anyone know where I can get some documentation and examples on
 LB> Windows resource files?

 LB> I'm mostly interested in imbedding icons, menus, dialogs gadgets and
 LB> version info.

This is a documentation page of the resource compiler GoRC^
http://www.jorgon.freeserve.co.uk/ResourceFrame.htm


 Ivan Shikhalev
 http://fpc.by.ru/


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]ASCII plotting

2003-07-29 Thread Johann Glaser
Hi!

> I would like to include some simple "ascii plots" in my textual
> output files, like :

I'm sorry that I can't give you a unit. But look at "Maple"
(http://www.maplesoft.com/). For Linux I've got an X interface (xmaple)
and a text interface (maple).

The text interface does drawing plots as text. It even can draw 3D plots
in text mode! Probably you have the chance to examine this program. Then
try these feeatures!

Bye
  Hansi

-- 
Johann Glaser   <[EMAIL PROTECTED]>
   Vienna University of Technology
   Electrical Engineering 
 http://www.johann-glaser.at/ 


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Resource file syntax...

2003-07-29 Thread L D Blake
In reply to your message of July 29, 2003


> http://www.users.on.net/johnson/resourcehacker/

> It can handle all exe files, that compiled with resources. Can get or edit
> menus, dialogs, icons and not only text mode. You can see menus and dialogs
> in wyswyg mode.

Yeah I looked at that, and it works great if the .RES stuff is already in the
file... I don't want to get stuff out   the idea is to add stuff in.

-
 L D Blake


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]ASCII plotting

2003-07-29 Thread jeffwin

>I would like to include some simple "ascii plots" in my textual output
>files, like :

There are some routines for ASCII plotting in this book:
   Press, W. H., Flannery, B. P., Teukolsky, S. A., & Vetterling, W. T.
(1986).
   Numerical recipes: The art of scientific computing. Cambridge, England:
   Cambridge University Press.
One version of the book has the source code in Pascal,
and I'm sure it would work with FPC.

Jeff Miller

[EMAIL PROTECTED]


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]Resource file syntax...

2003-07-29 Thread L D Blake
In reply to your message of July 29, 2003

> This is a documentation page of the resource compiler GoRC^
> http://www.jorgon.freeserve.co.uk/ResourceFrame.htm


Now THAT was helpful!  Thank you.

I also found out I was missing a couple of help files from WinSDK I "borrowed"
from Delphi7...  one of them was the documentation on the resource stings.

Between the two, I should be on the way!
(Well, until my next dumb question, that is...)

-
 L D Blake


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]ASCII plotting

2003-07-29 Thread L D Blake
In reply to your message of July 29, 2003

>> I would like to include some simple "ascii plots" in my textual
>> output files, like :

> I'm sorry that I can't give you a unit. But look at "Maple"
> (http://www.maplesoft.com/). For Linux I've got an X interface (xmaple)
> and a text interface (maple).

> The text interface does drawing plots as text. It even can draw 3D plots
> in text mode! Probably you have the chance to examine this program. Then
> try these feeatures!

One thing I found helps with that "fatness" problem you got in a couple of
spots is to confine your screen coordinates ... x,y : byte ... less chance of
fractional or out of range returns causing the plotting decisions to wobble.
(Text mode is decidedly low res, so use a low res numbering scheme to match
).

-
 L D Blake


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal]socket example

2003-07-29 Thread Harald Houppermans
I need a simple socket example in free pascal for windows and linux
platform.




___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]socket example

2003-07-29 Thread Harald Houppermans
> I need a simple socket example in free pascal for windows and linux
> platform.

I found the documentation in the free pascal distribution...

I will now try to make my own example :D



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]socket failed ?

2003-07-29 Thread Harald Houppermans
MySocket := socket( AF_INET, SOCK_DGRAM, PF_INET );

This call fails with socket error 10043

I am guessing protocol not supported ?

Do I need to start winsock first or something...

I would like to work with the udp protocol.


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]socket failed ?

2003-07-29 Thread Harald Houppermans
This does seem to work but if it is usefull ?

 MySocket := socket( AF_INET, SOCK_DGRAM, PF_UNSPEC );



___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]socket failed ?

2003-07-29 Thread Harald Houppermans
Well... whatta ya know... :)

sending udp packets actually works :D


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]sending udp packets works :D

2003-07-29 Thread Harald Houppermans
In windows that is...

Now trying for linux :D


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]sending works wow

2003-07-29 Thread Harald Houppermans
Wow..

Sending udp packets works for linux too...

Exactly the same code :)

Just cross compiled lol.

:D


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]socket requirements.

2003-07-29 Thread Harald Houppermans
What my program would need is:

When a packet is received:

source address and source port

When sending a packet...

supplieing a

dest address and dest port.

The last could be done with connect.

How to do the first is now the question...

Maybe with recv... but the doc says it needs to be in a connected state?

Also maybe with getpeername

This seems to be a weird way of working with datagrams...


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal]socket unit doc out of date.

2003-07-29 Thread Harald Houppermans
Wow it seems the socket unit documentation is way out of date.

I check the source...

sockets.pp uses winsock :D

sockets has a lot more functions :D


___
fpc-pascal maillist  -  [EMAIL PROTECTED]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal