Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Stew MacLean

I’m working on a Linux deployment and find that I have to unzip under root, then I have to use a brute force chmod –R a+rwx on the base directory, then logout and login as a normal user (otherwise the executable is not seen?).

 

I then start up using exec runtimeEngine image.im on a bash console.

 

Is there a more user friendly way of doing this?

 

Thanks,

 

Stewart

Reply | Threaded
Open this post in threaded view
|

Re: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Reinout Heeck
Stewart MacLean wrote:

I’m working on a Linux deployment and find that I have to unzip under root, then I have to use a brute forcechmod –R a+rwx on the base directory,

AFAIK Zip does not keep (all) file permissions, so you may want to use another packaging format (like tar+gzip)

then logout and login as a normal user (otherwise the executable is not seen?).


Root has a different $PATH than normal users. For example root does not have the current working directory in his path whereas normal users do (this is to protect the system from nefarious local users tricking root into running their code).

 

I then start up using exec runtimeEngine image.im on a bash console.


exec ./runtimeEngine image.im   might make it work for root too.


Is there a more user friendly way of doing this?


Are you literally switching sessions using login/logout? 
I suggest you open a shell with root permissions to do the installation work while you stay in your normal user XSession:
  su - bash

 

Thanks,

 

Stewart



Reply | Threaded
Open this post in threaded view
|

Re: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Reinout Heeck

Reinout Heeck wrote:
Stewart MacLean wrote:

I’m working on a Linux deployment and find that I have to unzip under root, then I have to use a brute forcechmod –R a+rwx on the base directory,



I didnt notice at first, but what is the 'w' doing in the flags to chmod, you don't want all users to have write permission to the files do you?


R
-
Reply | Threaded
Open this post in threaded view
|

RE: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Stew MacLean
In reply to this post by Stew MacLean

Hi Reinout,

 

Thanks for these helpful suggestions.

 

I was hoping to do all my packaging and deployment generation on Windows. However I can’t seem to find a windows based tar+gzip that enables me to set the unix rwx file attributes on tar file creation. Do you know if such a program exists?

 

Thanks for the super user pointer. I have done this along time ago, but had forgotten how!

 

Time to brush up on my Unix… will come in useful when I do MacOSX.

 

Cheers,

 

Stewart

 

 

-----Original Message-----
From: Reinout Heeck [mailto:[hidden email]]
Sent
:
21 November 2006 3:25 a.m.
To: vwnc-list NC
Subject: Re: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

 

Stewart MacLean wrote:

I’m working on a Linux deployment and find that I have to unzip under root, then I have to use a brute forcechmod –R a+rwx on the base directory,

AFAIK Zip does not keep (all) file permissions, so you may want to use another packaging format (like tar+gzip)

 

then logout and login as a normal user (otherwise the executable is not seen?).



Root has a different $PATH than normal users. For example root does not have the current working directory in his path whereas normal users do (this is to protect the system from nefarious local users tricking root into running their code).

 

I then start up using exec runtimeEngine image.im on a bash console.

 

exec ./runtimeEngine image.im   might make it work for root too.



 

Is there a more user friendly way of doing this?

 

Are you literally switching sessions using login/logout? 

I suggest you open a shell with root permissions to do the installation work while you stay in your normal user XSession:

  su - bash



 

Thanks,

 

Stewart



 

Reply | Threaded
Open this post in threaded view
|

Re: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Reinout Heeck
Stewart MacLean wrote:

> I was hoping to do all my packaging and deployment generation on  
> Windows. However I can’t seem to find a windows based tar+gzip that  
> enables me to set the unix rwx file attributes on tar file  
> creation. Do you know if such a program exists?

No, but the tar format seems simple enough to implement yourself:
   http://en.wikipedia.org/wiki/Tar_(file_format)#Format_details
You'll still need to run the resulting .tar through gzip (which VW  
already implements).



Regarding file permissions ('file mode' in the page above) and  
ownership I suggest that

-all files and dirs are owned by user root and group root (0 and 0)

-directories permissions: user&group=rwx, others=rx (octal: 0775)

-file permissions: user&group=rw, others=r (octal: 0664)

-executables&scripts: user&group=rwx, others=rx (same as directories)



Success!

R
-

Reply | Threaded
Open this post in threaded view
|

AW: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Georg Heeg
We have a tar implementation in VisalWorks which lets you control every
field from the Smalltalk side. In case of interest, please let me know.

Georg

-----Ursprüngliche Nachricht-----
Von: Reinout Heeck [mailto:[hidden email]]
Gesendet: Dienstag, 21. November 2006 08:27
An: vwnc-list NC
Betreff: Re: Avoiding chmod on Linux installation from .zip [Mandrake 2.2,
VW 7.4.0]

Stewart MacLean wrote:

> I was hoping to do all my packaging and deployment generation on  
> Windows. However I can’t seem to find a windows based tar+gzip that  
> enables me to set the unix rwx file attributes on tar file  
> creation. Do you know if such a program exists?

No, but the tar format seems simple enough to implement yourself:
   http://en.wikipedia.org/wiki/Tar_(file_format)#Format_details
You'll still need to run the resulting .tar through gzip (which VW  
already implements).



Regarding file permissions ('file mode' in the page above) and  
ownership I suggest that

-all files and dirs are owned by user root and group root (0 and 0)

-directories permissions: user&group=rwx, others=rx (octal: 0775)

-file permissions: user&group=rw, others=r (octal: 0664)

-executables&scripts: user&group=rwx, others=rx (same as directories)



Success!

R
-


Reply | Threaded
Open this post in threaded view
|

Re: AW: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Reinout Heeck

Georg Heeg wrote:

> We have a tar implementation in VisalWorks which lets you control  
> every
> field from the Smalltalk side. In case of interest, please let me  
> know.


Hi Georg,

this sounds like a perfect candidate for turning into a 'goodie'.
Please consider releasing this code to the community.


Thanks,

Reinout
-------


Reply | Threaded
Open this post in threaded view
|

RE: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Stew MacLean
In reply to this post by Reinout Heeck
Hi Reinout,

DIY (Do it yourself) has already been suggested, which I didn't really
want to do (it always takes longer than you think!).

However considering Georg's kind offer, that should integrate nicely
into my system builder tool without too much effort.

Cheers,

Stewart

>-----Original Message-----
>From: Reinout Heeck [mailto:[hidden email]]
>Sent: 21 November 2006 8:27 p.m.
>To: vwnc-list NC
>Subject: Re: Avoiding chmod on Linux installation from .zip [Mandrake
2.2,

>VW 7.4.0]
>
>Stewart MacLean wrote:
>
>> I was hoping to do all my packaging and deployment generation on
>> Windows. However I can't seem to find a windows based tar+gzip that
>> enables me to set the unix rwx file attributes on tar file
>> creation. Do you know if such a program exists?
>
>No, but the tar format seems simple enough to implement yourself:
>   http://en.wikipedia.org/wiki/Tar_(file_format)#Format_details
>You'll still need to run the resulting .tar through gzip (which VW
>already implements).
>
>
>
>Regarding file permissions ('file mode' in the page above) and
>ownership I suggest that
>
>-all files and dirs are owned by user root and group root (0 and 0)
>
>-directories permissions: user&group=rwx, others=rx (octal: 0775)
>
>-file permissions: user&group=rw, others=r (octal: 0664)
>
>-executables&scripts: user&group=rwx, others=rx (same as directories)
>
>
>
>Success!
>
>R
>-



Reply | Threaded
Open this post in threaded view
|

RE: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Stew MacLean
In reply to this post by Georg Heeg
Hi Georg,

Yes! I'm very much interested in this and second Reinout's suggestion.

This will provide the polishing touches into my system builder tool, a
configurable, one click, multi platform; package, generate installers,
and install framework I've been working on for sometime. (which I'll
make available once I'm happy with it).

Do you use this for deployment as well?

Thanks,

Stewart

>-----Original Message-----
>From: Georg Heeg [mailto:[hidden email]]
>Sent: 21 November 2006 8:32 p.m.
>To: 'Reinout Heeck'; 'vwnc-list NC'
>Subject: AW: Avoiding chmod on Linux installation from .zip [Mandrake
2.2,

>VW 7.4.0]
>
>We have a tar implementation in VisalWorks which lets you control every
>field from the Smalltalk side. In case of interest, please let me know.
>
>Georg
>
>-----Ursprüngliche Nachricht-----
>Von: Reinout Heeck [mailto:[hidden email]]
>Gesendet: Dienstag, 21. November 2006 08:27
>An: vwnc-list NC
>Betreff: Re: Avoiding chmod on Linux installation from .zip [Mandrake
2.2,

>VW 7.4.0]
>
>Stewart MacLean wrote:
>
>> I was hoping to do all my packaging and deployment generation on
>> Windows. However I can’t seem to find a windows based tar+gzip that
>> enables me to set the unix rwx file attributes on tar file
>> creation. Do you know if such a program exists?
>
>No, but the tar format seems simple enough to implement yourself:
>   http://en.wikipedia.org/wiki/Tar_(file_format)#Format_details
>You'll still need to run the resulting .tar through gzip (which VW
>already implements).
>
>
>
>Regarding file permissions ('file mode' in the page above) and
>ownership I suggest that
>
>-all files and dirs are owned by user root and group root (0 and 0)
>
>-directories permissions: user&group=rwx, others=rx (octal: 0775)
>
>-file permissions: user&group=rw, others=r (octal: 0664)
>
>-executables&scripts: user&group=rwx, others=rx (same as directories)
>
>
>
>Success!
>
>R
>-
>



Reply | Threaded
Open this post in threaded view
|

Re: AW: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Alan Knight-2
In reply to this post by Reinout Heeck
At 02:54 AM 11/21/2006, Reinout Heeck wrote:

Georg Heeg wrote:

We have a tar implementation in VisalWorks which lets you control 
every
field from the Smalltalk side. In case of interest, please let me 
know.


Hi Georg,

this sounds like a perfect candidate for turning into a 'goodie'.
Please consider releasing this code to the community.

The VW installer uses a TAR implementation in VisualWorks to do the installation. See the "TAR" parcel in the distribution. I know nothing about its capabilities.

--
Alan Knight [|], Cincom Smalltalk Development

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross
Reply | Threaded
Open this post in threaded view
|

AW: AW: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Georg Heeg

Alan,

 

VisualWorks standard TAR is read-only, thus it does not help. NewTar is a prerequisite of SmalltalkArchives.

 

Georg

 


Von: Alan Knight [mailto:[hidden email]]
Gesendet: Dienstag, 21. November 2006 15:43
An: Reinout Heeck; vwnc-list NC
Betreff: Re: AW: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

 

At 02:54 AM 11/21/2006, Reinout Heeck wrote:


Georg Heeg wrote:


We have a tar implementation in VisalWorks which lets you control 
every
field from the Smalltalk side. In case of interest, please let me 
know.



Hi Georg,

this sounds like a perfect candidate for turning into a 'goodie'.
Please consider releasing this code to the community.


The VW installer uses a TAR implementation in VisualWorks to do the installation. See the "TAR" parcel in the distribution. I know nothing about its capabilities.


--
Alan Knight [|], Cincom Smalltalk Development

"The Static Typing Philosophy: Make it fast. Make it right. Make it run." - Niall Ross
Reply | Threaded
Open this post in threaded view
|

AW: Avoiding chmod on Linux installation from .zip [Mandrake 2.2, VW 7.4.0]

Georg Heeg
In reply to this post by Stew MacLean
All,

a bundle named Tar has been published to the Public Repository.

Here is the comment:

This is a new implementation of Tar. It implements both reading and writing
of Tar files.

The abstract class TarFile with its subclasses TarReadFile and TarWriteFile
provide SequenceableCollection protocol to access the contents which are
TarredReadStream or TarredWriteStream instances.

A TarGzArchiver is also privided.

Georg

-----Ursprüngliche Nachricht-----
Von: Stewart MacLean [mailto:[hidden email]]
Gesendet: Dienstag, 21. November 2006 09:25
An: 'Georg Heeg'; 'Reinout Heeck'; 'vwnc-list NC'
Betreff: RE: Avoiding chmod on Linux installation from .zip [Mandrake 2.2,
VW 7.4.0]

Hi Georg,

Yes! I'm very much interested in this and second Reinout's suggestion.

This will provide the polishing touches into my system builder tool, a
configurable, one click, multi platform; package, generate installers,
and install framework I've been working on for sometime. (which I'll
make available once I'm happy with it).

Do you use this for deployment as well?

Thanks,

Stewart

>-----Original Message-----
>From: Georg Heeg [mailto:[hidden email]]
>Sent: 21 November 2006 8:32 p.m.
>To: 'Reinout Heeck'; 'vwnc-list NC'
>Subject: AW: Avoiding chmod on Linux installation from .zip [Mandrake
2.2,

>VW 7.4.0]
>
>We have a tar implementation in VisalWorks which lets you control every
>field from the Smalltalk side. In case of interest, please let me know.
>
>Georg
>
>-----Ursprüngliche Nachricht-----
>Von: Reinout Heeck [mailto:[hidden email]]
>Gesendet: Dienstag, 21. November 2006 08:27
>An: vwnc-list NC
>Betreff: Re: Avoiding chmod on Linux installation from .zip [Mandrake
2.2,

>VW 7.4.0]
>
>Stewart MacLean wrote:
>
>> I was hoping to do all my packaging and deployment generation on
>> Windows. However I can’t seem to find a windows based tar+gzip that
>> enables me to set the unix rwx file attributes on tar file
>> creation. Do you know if such a program exists?
>
>No, but the tar format seems simple enough to implement yourself:
>   http://en.wikipedia.org/wiki/Tar_(file_format)#Format_details
>You'll still need to run the resulting .tar through gzip (which VW
>already implements).
>
>
>
>Regarding file permissions ('file mode' in the page above) and
>ownership I suggest that
>
>-all files and dirs are owned by user root and group root (0 and 0)
>
>-directories permissions: user&group=rwx, others=rx (octal: 0775)
>
>-file permissions: user&group=rw, others=r (octal: 0664)
>
>-executables&scripts: user&group=rwx, others=rx (same as directories)
>
>
>
>Success!
>
>R
>-
>