Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

ftp chmod!!

 [1/13] from: maximo:meteorstudios at: 5-Aug-2003 10:10


hi there! for all the networking gurus on the list... can we setup ftp to call chmod on remote files. When dumping cgi scripts they must be set to chmod 755 and I wonder how I can do this when I copy files via ftp. I do not have shell access to the server (As is often the case) so I can't just login and change them. I don't want to have to use graphical packages cause the file xfer is automated via a rebol script. If we can't do it directly in rebol, can someone tell me if there is a windows command-line software which would let me do a chmod on a remote machine using ftp command. I have a pro license, so I don't mind calling a shell command after each xfer. THANKS IN ADVANCE... -max PS: LIQUID-VID is getting quite insane .. I have finished 80 % of standard styles and many even function better than their original (like slider which can be integer OR decimal with min/max range). I also integrated them into the library mechanism so that you can load data right from your library without having to give a path... this is usefull for gadget images and bg, for example. ----------- meteor Studios, T.D. ----------- Never Argue with an idiot. They will bring you down to their level and beat you with experience

 [2/13] from: SunandaDH:aol at: 5-Aug-2003 11:03


Maxim:
> If we can't do it directly in rebol, can someone tell me if there is a > windows command-line software which would let me do a chmod on a remote > machine using ftp command. I have a pro license, so I don't mind calling a > shell command after each xfer.
REBOL can't do chmod, as you've spotted. I use the windows FTP program (not command line, I'm afraid): SmartFTP http://www.smartftp.com/ This has a Commands / Properies/CHMOD menu that lets you set the right file privileges. Setting CHMOD is a pain, but once you've set it once, you need never set it again -- later uploads using REBOL FTP will keep the same CHMOD (at least, they do for me). Sunanda.

 [3/13] from: maximo::meteorstudios::com at: 5-Aug-2003 11:24


> REBOL can't do chmod, as you've spotted. > I use the windows FTP program (not command line, I'm afraid): > SmartFTP http://www.smartftp.com/
Yes I downloaded it just yesterday, and it works nicely!
> Setting CHMOD is a pain, but once you've set it once, you > need never set it again -- later uploads using REBOL FTP will keep the same > CHMOD (at least, they do for me).
that's interesting! thanks for the tip, I don't think I would have noticed, and yess it does work for me too! -Max

 [4/13] from: petr:krenzelok:trz:cz at: 5-Aug-2003 18:41


Maxim Olivier-Adlhoch wrote:
>>REBOL can't do chmod, as you've spotted. >>
<<quoted lines omitted: 12>>
>thanks for the tip, I don't think I would have noticed, and yess it does work for me too! >-Max
I was told by my friend that it is actually possible. Your FTP server would have to be configured to be allowed to accept SITE CHMOD command (WUFPTD may have QUOTE command). The configuration of server varries, so you are probably on your own. Try to look here: http://www.glftpd.com/docs/glftpd.docs http://proftpd.linux.co.uk/docs/directives/configuration_full.html#ALLOWCHMOD for two known ftp servers. Search for "chmod" string. Anyway, I tried to 'open ftp connection only and then use something like INSERT serv "SITE" but Rebol told me that 'insert can't be used with such type of port ... so I think it may be possible to chmod files but it would have to be supported directly by ftp scheme ... but I can be wrong ... -pekr-

 [5/13] from: maximo:meteorstudios at: 5-Aug-2003 13:11


hi Pekr,
> I was told by my friend that it is actually possible. Your FTP server > would have to be configured to be allowed to accept SITE > CHMOD command
it is, I was able to change it with smartFtp :-)
> Anyway, I tried to 'open ftp connection only and then use > something like > INSERT serv "SITE" but Rebol told me that 'insert can't be used with > such type of port ... so I think it may be possible to chmod > files
[...] I think too, Gabrielle suggested it might be done with set-modes get-modes, but would have to be patched in the ftp scheme itself... Since rebol's ftp doesn't seem to overwrite the chmod data once its been set, I'm already less anxious about the problem, its not as if I had to call chmod everytime I did a slight modif or test (as is the case when saving files on disk). To have a definite answer, we'd have to delve deeper into the scheme's code ... in normal times, I'd have fun trying that, but since I'm straining every ounce of time I have to get steel tools downloadable, I really don't have time, right now... If anyone does poke around, please report your findings to the list :-) Thanks to everyone for the help and comments. -MAx

 [6/13] from: Rebolinth:nodep:dds:nl at: 24-Dec-2003 22:29


-- Conversation/lunch: "How do you Eat your Rebol in the Morning?" Hiya, Its true , rebol can read with the open the files in its buffer but not update it with set-modes, the option "CHMOD" is not implemented to write back, so a patch is needed for that. But "CHMOD" should not be done on the client site but on the server site (umask it or use a wide configurable ftpdaemon and dont use passive mode) thats why not all ftpdaemons have it enabled (security issue) Anyway.. a raw patch on the scheme 'ftp could do it but you should be able to do a direct write on the file. (R)egards, Norman.

 [7/13] from: maximo:meteorstudios at: 5-Aug-2003 14:21


> raw patch on the scheme 'ftp could do it but you should be > able to do a
how would adding an (optional) third value in the user-part of the url look? ftp://user:password:[umask--domain--com]/path/to/file.ext as in: ftp://me:enter:[755--domain--com]//path/to/file.cgi what do y'all think if we all agree, maybe RT will heed the suggestion, it sometime happens. -Max

 [8/13] from: nitsch-lists:netcologne at: 5-Aug-2003 23:49


Am Dienstag, 5. August 2003 17:03 schrieb [SunandaDH--aol--com]:
> Maxim: > > If we can't do it directly in rebol, can someone tell me if there is a
<<quoted lines omitted: 9>>
> again -- later uploads using REBOL FTP will keep the same CHMOD (at least, > they do for me).
Somewhere on Altme Cal Dixon wrote: Some FTP servers allow setting modes via FTP. You can open a connection to the ftp site normally, then get the sub-port from the open port, then send a command like "SITE CHMOD 775 file" then wait for a responce from the server (which will usually be a numeric code, a space an english language result, and a newline). It's not very convienent, but it may be easier than telnet, if the FTP server supports it. but never tried it. -Volker

 [9/13] from: g:santilli:tiscalinet:it at: 6-Aug-2003 11:34


Hi Petr, On Tuesday, August 5, 2003, 6:41:16 PM, you wrote: PK> http://proftpd.linux.co.uk/docs/directives/configuration_full.html#ALLOWCHMOD It's ProFTPD there, by the way. PK> Anyway, I tried to 'open ftp connection only and then use something like PK> INSERT serv "SITE" but Rebol told me that 'insert can't be used with PK> such type of port ... so I think it may be possible to chmod files but PK> it would have to be supported directly by ftp scheme ... but I can be PK> wrong ... You could insert directly into the sub-port, but then you have to make sure you don't interfere with the handler. I think the best solution would be to write a new FTP handler or patch the existing one to support SET-MODES and GET-MODES. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/

 [10/13] from: petr:krenzelok:trz:cz at: 6-Aug-2003 11:53


Gabriele Santilli wrote:
>Hi Petr, >On Tuesday, August 5, 2003, 6:41:16 PM, you wrote:
<<quoted lines omitted: 9>>
>solution would be to write a new FTP handler or patch the existing >one to support SET-MODES and GET-MODES.
Yes, exactly - but it is for gurus only. I would prefer if Rebol would try to be more tolerant to various anomalies, such as usage of @ or # chars in scheme. We can be rigid and say hey, it is not according to RFCXY, but well, rebol users will face such anomalies, as they exist. E.g. if I want to connect to FTP from behind the firewall, I have to go thru proxy: print read ftp://[pekr--moon--rebol--cz]:[my-pass--proxy--sec--trz--cz] It will not be swallowed by Rebol parser untill I apply following patch: net-utils/url-parser/user-char: union net-utils/url-parser/user-char make bitset! #"@" I could see lots of similar questions asked on ml, that is why I would prefer Rebol being able to handle such case/anomaly natively. From talks to Reichart I know that FTP is probably the most screwed standard . Well - I think that no matter what command what FTP server supports, we should enrich rebol's scheme each time we find new problem and its solution, instead of suggesting of usign sub-port, as there can be ppl as me, who will not be able to solve such problem by simply suggesting how to hack it around ... Cheers, -pekr-

 [11/13] from: maximo:meteorstudios at: 6-Aug-2003 10:52


From: Petr Krenzelok [mailto:[cant_nab_this_mail_address--localhost]]
> Yes, exactly - but it is for gurus only. > > I could see lots of similar questions asked on ml, that is > why I would > prefer Rebol being able to handle such case/anomaly natively.
IF they apply fixes that we find ASAP, then we'll all be happy!
> From talks to Reichart I know that FTP is probably the most screwed > "standard".
I read a little of the ftp rfc and yess it a lot of "history"... it was continually updated from 1973 to 1985...
> Well - I think that no matter what command what > FTP server
<<quoted lines omitted: 4>>
> be ppl as me, who will not be able to solve such problem by simply > suggesting how to hack it around
I think I'll send my patch to rebol feedback , once its had a little more testing and (maybe) debating here. But it sure would be cool to find a way to supply the chmod mode as an option of the ftp scheme (like having an enable chmod flag, in the ftp port, with a list of extensions which should get chmoded ). There could then be a simple function which sets up the ftp handler to enable chmod or not. we could also debate on if we want to add a new protocol (such as chmodftp://user:passwd:[umask--domain]/path/file.ext) which explicitely handles chmod on any file transfer, without looking for a .cgi in the target filename... Gabrielle's idea about set-modes get-modes is also a nifty one, I have no time to research it right now, though (really ;-). -MAx

 [12/13] from: maximo::meteorstudios::com at: 6-Aug-2003 17:08


WRT ftp thread, I just realized that a proper place for permissions block would be the /allow refinement of write. the only limitation is that in the docs, it specifically mentions that the block is only applied to the user part of the permission spec, so. maybe we could path the ftp port to use the allow data and if its a three digit integer it means that its a chmod specification instead... I do not know if we have access to the allow data in the port though, I haven't checked that... -max ----------- meteor Studios, T.D. ----------- Never Argue with an idiot. They will bring you down to their level and beat you with experience

 [13/13] from: antonr:iinet:au at: 8-Aug-2003 1:09


I like the url idea, but as a possible alternative, put the umask at the end ? like this: chmodftp://user:[passwd--domain]/path/file.ext:umask It's probably better to do the set-modes way first, though. Less breaking of existing code will result from that. Anton.

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted