[fpc-pascal] Re: Windows installer fails to add fpc binaries to PATH

2012-09-15 Thread Reinier Olislagers
On 14-9-2012 23:32, Andrew Pennebaker wrote:
> Well, I just checked:
> 
> http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/install/fpc.ist?view=annotate&root=fpcbuild
> around line 253 and further.
> 
> It matches my experience.
> 
> Maybe you are using Windows ME or older windows versions.
> 
> 
> I am using Windows 7 Professional x64. Which version are you using?

> My Windows account has full Administrative privileges. I'm curious if
> the installer neglects to explicitly request administrative privileges.
> I bet if we edit the installer's security properties, forcing it to run
> in administrative mode, it will then modify PATH accordingly.
So... have you verified this theory?
Have you tried running the installer explicitly as Admin (e.g. right
click, Run as Admin)? Did it change the system path then?

> All of this is easily done with Advanced Installer
> , by the way. I'm not sure which
> tools you're using to construct the official Free Pascal Windows
> installer, but the output of that build process is not working on my system.
Well, blame the tools by all means rather than help analyze and fix the
problem.
It is an Inno Setup script. Inno Setup works very well for many
programs, including Lazarus.
I've never heard of Advanced Installer.

If you want to look into patching the Inno Setup script, perhaps have a
look at PrivilegesRequired in the [Setup] section:
http://www.jrsoftware.org/ishelp/index.php?topic=setup_privilegesrequired

Good luck,
Reinier
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Function for checking correct file name

2012-09-15 Thread Sven Barth

On 14.09.2012 17:44, Graeme Geldenhuys wrote:

On 14/09/12 13:48, Krzysztof wrote:

I just quicky googled not allowed characters and wrote this simple
function:


Also in Windows (as far as I know), file names my not be longer than 255
characters. So you will have to check the length of AFilename parameter
too.


It depends. If you use normal "C:\bla\bla" notation you are right, but 
if you access the NT namespace (which you can do from within the WinAPI) 
you can use paths with up to 32767 characters. You need to use this 
notation though: "\\?\C:\bla\bla" (in this case you MUST use "\" though 
as "/" is not converted here).


For more information see here: 
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#maxpath


Regards,
Sven

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


Re: [fpc-pascal] Function for checking correct file name

2012-09-15 Thread Vinzent Höfler
On Sat, 15 Sep 2012 11:20:53 +0200, Sven Barth  
 wrote:



On 14.09.2012 17:44, Graeme Geldenhuys wrote:

On 14/09/12 13:48, Krzysztof wrote:

I just quicky googled not allowed characters and wrote this simple
function:


Also in Windows (as far as I know), file names my not be longer than 255
characters. So you will have to check the length of AFilename parameter
too.


It depends. If you use normal "C:\bla\bla" notation you are right, but  
if you access the NT namespace (which you can do from within the WinAPI)  
you can use paths with up to 32767 characters. You need to use this  
notation though: "\\?\C:\bla\bla" (in this case you MUST use "\" though  
as "/" is not converted here).


Careful. There's a difference between file/component length and path  
length.


For more information see here:  
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#maxpath


|This type of path is composed of components separated by backslashes,
|each up to the value returned in the lpMaximumComponentLength parameter
|of the GetVolumeInformation function (this value is commonly 255  
characters).


So, although the path may be up to 32767 characters in length, each  
component

of the path can no longer than 255 characters. This includes the file name.


Vinzent.

--
The most likely way for the world to be destroyed, most experts agree,
is by accident. That's where we come in; we're computer professionals.
We cause accidents.
-- Nathaniel Borenstein
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FBAdmin

2012-09-15 Thread patspiper

On 14/09/12 20:07, Ludo Brands wrote:

It is already quite a useful component as is. Since you are FBAdmin's
author, and are knowledgeable in the service API, what do you
recommend
regarding the non basic admin actions? Forced Writes in particular is
interesting as it might have to be turned off when pumping
data for example.

As said before IMHO forced writes doesn't belong in a component that comes
standard with Lazarus. Google for Firebird forced writes off and you get as
first page http://www.firebirdsql.org/manual/qsg2-safety.html chapter "how
to corrupt a database". Forced Writes is a speed hack that turns off
effectively the database integrity for the time of the operation. That is
integrity in the largest sense. When something goes wrong, your complete
database can become unusable.

+1

My question was more geared towards an extension to FBAdmin, or an 
entirely different component such as FBServices which is derived from 
FBAdmin.

  Unless you are writing a db admin tool or a
very specialised tool, no business application should use this.
A corner case which could benefit from Forced Writes off, almost risk 
free: Data is pumped into a freshly created FB database, report tables 
are created and populated, then used for reporting purposes. Then the 
whole thing is discarded.


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


Re: [fpc-pascal] Function for checking correct file name

2012-09-15 Thread Sven Barth

On 15.09.2012 11:34, Vinzent Höfler wrote:

On Sat, 15 Sep 2012 11:20:53 +0200, Sven Barth
 wrote:


On 14.09.2012 17:44, Graeme Geldenhuys wrote:

On 14/09/12 13:48, Krzysztof wrote:

I just quicky googled not allowed characters and wrote this simple
function:


Also in Windows (as far as I know), file names my not be longer than 255
characters. So you will have to check the length of AFilename parameter
too.


It depends. If you use normal "C:\bla\bla" notation you are right, but
if you access the NT namespace (which you can do from within the
WinAPI) you can use paths with up to 32767 characters. You need to use
this notation though: "\\?\C:\bla\bla" (in this case you MUST use "\"
though as "/" is not converted here).


Careful. There's a difference between file/component length and path
length.


For more information see here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#maxpath



|This type of path is composed of components separated by backslashes,
|each up to the value returned in the lpMaximumComponentLength parameter
|of the GetVolumeInformation function (this value is commonly 255
characters).

So, although the path may be up to 32767 characters in length, each
component
of the path can no longer than 255 characters. This includes the file name.


Right... but 255 characters for a filename is already rather much as 
well when I compare this with the amount of text I can squash into a SMS ;)


Regards,
Sven

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


Re: [fpc-pascal] Windows installer fails to add fpc binaries to PATH

2012-09-15 Thread Bart
On 9/14/12, Andrew Pennebaker  wrote:

> I am using Windows 7 Professional x64. Which version are you using?

> My Windows account has full Administrative privileges. I'm curious if the
> installer neglects to explicitly request administrative privileges.

IIRC UAC asked me for the administrator password when I installed 2.6.0.
(Win7-64)

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


Re: [fpc-pascal] Windows installer fails to add fpc binaries to PATH

2012-09-15 Thread Andrew Pennebaker
Oh, I just remembered--I had a similar problem with CMake, where for
everyone else the installer successfully modified PATH, but not on my
machine.

I use a lot of command line programs, all installed in different
directories, so my PATH was too long for the CMake installer to modify.
There was a C-like assumption of the maximum number of characters that PATH
could contain.

Perhaps the Inno Setup script, or Inno Setup itself makes a similar
assumption.

One way to verify that this is the problem is for me to temporarily shorten
PATH and then try the installer, and for others to temporarily lengthen
PATH (e.g. add ;C:\bin over and over and over), until Inno Setup stops
correctly modifying PATH.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Function for checking correct file name

2012-09-15 Thread Graeme Geldenhuys

On 15/09/12 10:54, Sven Barth wrote:

Right... but 255 characters for a filename is already rather much as
well when I compare this with the amount of text I can squash into a SMS ;)



Now I can't remember exactly, is that 255 characters, or 255 bytes? 
Because if it is the latter, then the Unicode character count limit 
could be significantly less than 255.


Regards,
  - Graeme -

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


Re: [fpc-pascal] Function for checking correct file name

2012-09-15 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said:
> > Right... but 255 characters for a filename is already rather much as
> > well when I compare this with the amount of text I can squash into a SMS ;)
> Now I can't remember exactly, is that 255 characters, or 255 bytes? 
> Because if it is the latter, then the Unicode character count limit 
> could be significantly less than 255.

Not really, since on Windows unicode means utf16
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Function for checking correct file name

2012-09-15 Thread Sven Barth

On 15.09.2012 21:18, Graeme Geldenhuys wrote:

On 15/09/12 10:54, Sven Barth wrote:

Right... but 255 characters for a filename is already rather much as
well when I compare this with the amount of text I can squash into a
SMS ;)



Now I can't remember exactly, is that 255 characters, or 255 bytes?
Because if it is the latter, then the Unicode character count limit
could be significantly less than 255.


If you look at the link I gave it says 255 characters. This is because 
the filename limit on the NTFS filesystem is 255 UTF-16 characters as 
well (the API seems to be capable of handling larger filenames tough as 
this is indicated by the point that using the GetVolumeInformation 
function you can get a value that contains the maximum amount of 
characters for a file or directory name).


Regards,
Sven

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


Re: [fpc-pascal] Function for checking correct file name

2012-09-15 Thread Jorge Aldo G. de F. Junior
Vinzent, i dont know why you need to check the filename - would
fileexists() be enough ? - but i suspect that you already know about
that function, so, if you need something more complex, i *feel* that
it is something related to security.

Supose you wrote a webserver (or whatever thing similar for that
matter) and you need to be sure that users can only access files
located at c:\htmlpages.

This is a security risk, because, if the function isnt almost perfect,
someone could end up reading the passwords file (security.sam on
windows ? whatever im not a windows programmer) or rewriting criticial
files on a system.

I believe that you already know that, but thats why i asked if others
are considering the security risk involved in filenames.

For evidence sake look at this old IIS bug :

http://www.hackingspirits.com/eth-hac/papers/iis_uni.html

Morale : Filenames can be nasty and filename checking functions tend
to be complex...

You will need one function for each freepascal target (If you aim at
portability).

I believe this can be solved by writing a parser (using a BNF notation
of the target filesystem structuring) and a interpreter to expand all
the macros possible, without letting the OS even come close to the
filename before its sanitized.

That, if i understood your question correctly.

Sorry if i misunderstood.

On a side note : I believe FreePascal should add such filename
sanityzing function on future versions (a multiplatform one) to avoid
this.

2012/9/15 Vinzent Höfler :
> On Sat, 15 Sep 2012 11:20:53 +0200, Sven Barth 
> wrote:
>
>> On 14.09.2012 17:44, Graeme Geldenhuys wrote:
>>>
>>> On 14/09/12 13:48, Krzysztof wrote:

 I just quicky googled not allowed characters and wrote this simple
 function:
>>>
>>>
>>> Also in Windows (as far as I know), file names my not be longer than 255
>>> characters. So you will have to check the length of AFilename parameter
>>> too.
>>
>>
>> It depends. If you use normal "C:\bla\bla" notation you are right, but if
>> you access the NT namespace (which you can do from within the WinAPI) you
>> can use paths with up to 32767 characters. You need to use this notation
>> though: "\\?\C:\bla\bla" (in this case you MUST use "\" though as "/" is not
>> converted here).
>
>
> Careful. There's a difference between file/component length and path length.
>
>
>> For more information see here:
>> http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#maxpath
>
>
> |This type of path is composed of components separated by backslashes,
> |each up to the value returned in the lpMaximumComponentLength parameter
> |of the GetVolumeInformation function (this value is commonly 255
> characters).
>
> So, although the path may be up to 32767 characters in length, each
> component
> of the path can no longer than 255 characters. This includes the file name.
>
>
> Vinzent.
>
> --
> The most likely way for the world to be destroyed, most experts agree,
> is by accident. That's where we come in; we're computer professionals.
> We cause accidents.
> -- Nathaniel Borenstein
>
> ___
> fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] FPC + fpGUI + Raspberry Pi = fantastic

2012-09-15 Thread Paul Breneman

Three minimal FPC and fpGUI distros were just updated on this page:
  http://www.turbocontrol.com/easyfpgui.htm

The serial debug terminal (uses SynaSer part of Synapse) now compiles 
and the RPi works with my Gearmo USB to serial adapters (that use FTDI 
chipsets).


Should be fun to see what embedded projects the RPi can be used in...  :)
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal