Re: /#sh:user@host file names with % bug

2010-01-17 Thread Pavel Machek
On Sat 2010-01-16 00:41:00, Oswald Buddenhagen wrote:
 On Fri, Jan 15, 2010 at 08:32:01PM +0100, Janek Kozicki wrote:
  1. create files named 
   efekt_skali__0.15%.png
   efekt_skali__1.5%.png
  
  2. log in remotely to that host using /#sh:u...@host
  
  3. observe wrong file names:
efekt_skali__0.1593cf4fcng
efekt_skali__1.593cf4fcng
  
  pretty weird, huh?
  
 it's not just weird, it is a potentially exploitable security hole.

Well, /#sh is just a weird hack, and probably contains many similar
problems.

It should be documented that it is not safe to connect to untrusted
hosts.

(Plus it should be fixed, of course).

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: HAVE_MMAP still necessary ?

2008-12-31 Thread Pavel Machek
On Sat 2008-12-27 21:43:53, Enrico Weigelt wrote:
 * Enrico Weigelt weig...@metux.de schrieb:
  
  Hi folks,
  
  
  I really wonder whether the mmap() stuff is still needed at all.
  It doesnt seem to be really used anywhere.
 
 Ups, didn't look hard enough (just scanned the vfs subdir) ;-O
 
 Okay, there're mainly two mmap()-using places: 
 
 a) cmd.c: compare_files() - it uses the mmap() call directly 
(w/o going over mcvfs), and it seems to work on local files 
only. wouldn't it make sense to let it run via mcvfs ? 
 
 b) view.c: it tries to mmap() in the file, obviously to let the
kernel do all the loading. 
BUT: do we *really* want mmap() here, or just some get me
that file into memory()-call (same in cmd.c) ?

I believe the idea is to be able to view parts of huge file without
loading them to RAM first. (for really big files, they may not even
fit in RAM.)

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) 
http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: midnight commander reloaded (?)

2006-05-27 Thread Pavel Machek
Hi!

 Maybe it should be permitted to modify an existing 
 project (I believe
 there is a file manager in Python) to match all 
 significant features of
 mc.  Although non-Python programmers would be at 
 disadvantage in this
 case.
 
 I've tried ZC (Zemljanka Commander) at one point and I 
 wasn't very fascinated. It is written in Python if I 
 remember correctly and uses
 GTK+/Gnome for the GUI. I am not sure but maybe one of 
 the authors
 used to work on MC in the past.

That was me. Well, ZC was college project, so it unfortunately ended
when grades were given.

It was written in C, mostly; and because being gtk+ meant it had to be
threaded, things were not too easy.

Take a look at krusader -- similar to zc. Unfortunately gui
programming is hard :-(.
Pavel
-- 
Thanks for all the (sleeping) penguins.
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: New Maintainer for MC Project?

2005-06-06 Thread Pavel Machek
Hi!

  * Tell the Leadership that thanks, but no thanks.
 
 ... If meritocracy is the rule I think we should decide this on merits,
 don't you? Which means you shouldn't decide this all by yourself. I
 would like to get some input from others as well.

I agree with Miguel here...
Pavel
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: New Maintainer for MC Project?

2005-06-06 Thread Pavel Machek

   Since it is not my policy to argue with fools, that's all I will
say along those lines.

Learn to use email, thanks. 
Pavel
___
Mc-devel mailing list
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: [PATCH] Add 'Ignore ...' buttons to error msg window

2003-06-20 Thread Pavel Machek
Hi!

 I'm sending a patch which adds the 'Ignore', 'Ignore all', 'Ignore similar'
 buttons to error message window.
 
 
 Description
 ---
 The error message window shows some more buttons:
 'Ignore all' - ignore all following errors
 'Ignore similar' - ignore this specific error;
 this is based on error message displayed and
 is by now (can be easily enhanced to another)
 - 'cannot remove directory'
 - 'cannot chown file'
 - 'cannot cmmod file'
 - 'cannot stat file'
 This button is not shown for other errors.
 
 'Ignore' - this is just renamed 'Skip' button, which now seems to
 be more logical with conjunction with names of other buttons
 
 If error concerns only one file, the buttons 'Ignore all/similar' are
 not shown.

What about keeping current buttons, but changing 'Ignore' from 'Ignore
all' to 'Ignore similar'? That seems right the right thing to do
(without having to explain what Ignore similar means).
Pavel
-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: Fixing resolve_symlink() in ftpfs.c

2003-02-17 Thread Pavel Machek
Hi!

 Is anyone working on teh $SUBJ ? I guess no :(
 (that few-pages long code between #ifdef FIXME_LATER since ages)
 I've started it today, but after many hours of grepping and patching i feel
 lost. Could someone please explain the transition from bucket+dcache
 (4.1.35) to me+super+dir (4.6.0) structures?

I did the translation, long time ago.

 Is the directory cache (at least for the current directory, just filled in
 dir_load()) accessible (searchable/readable) from ftpfs.c at all?

Nothing prevents you from calling vfs_s_inode_from_path() and walking
lists yourself...

Pavel
-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: Update TODO list

2003-02-10 Thread Pavel Machek
Hi!

   Some more TODO entries:
   
   The fishfs is a little buggy, if you start transferring a big
   file and then aborts with ctrl+c, it gets into unusable state,
   and thanks to the vfs dir cache you have to quit mc and restart
   to get it working again...
   Maybe someone familiar with fishfs code could fix it?
  
  Question is if it is possible to fix fishfs. Maybe replacement
 why not possible? in worst case just reopen the connection if it fails
 (now it prints error message but does not work any more after
 ctrl+c)

Problem is that fish is a hack. Imagine putting file full of

rm -rf /

and remote machine going oom and killing both dd-s. I do not see an
easy way to fix that :-(.

Pavel
-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: Update TODO list

2003-02-08 Thread Pavel Machek
Hi!

 Some more TODO entries:
 
 The fishfs is a little buggy, if you start transferring a big
 file and then aborts with ctrl+c, it gets into unusable state,
 and thanks to the vfs dir cache you have to quit mc and restart
 to get it working again...
 Maybe someone familiar with fishfs code could fix it?

Question is if it is possible to fix fishfs. Maybe replacement
filesystem (sftp?) is better idea?

 The lslR-fs is cool, but it's extremly slow (try to enter a 80mb
 ls-lR file) and eats extremly high memory (aoround 200mb for that
 80mb lslr file). I think we should write 'native' support for it,
 just like for tar and cpio. It could do an initial pass, searching

I don't think lslR is important enough for optimizing/rewritting into
C.

Pavel
-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: uarc, ucab, uadf, uimg

2003-01-17 Thread Pavel Machek
Hi!

 I've made some new extfs file system scripts:
 
 uarc is for reading ARC archives
 ucab is for reading Microsoft Cabinet files (copyout takes much disk space!)
 uadf is for reading Amiga disk images
 uimg is for reading/writing FAT disk images
 
 I hope some people will find them usefull. I did.

Looks good, but can you post it as diff -u? No need for tar balls,
diff can create new files, too.

 I have a proposal for future extfs feature:
 Would it be a good idea to include a test function in every extfs script? 
 This way one could open any archive with whatever extension with the same 
 keystroke (something like Total Commander's Control-PageDown). This would 
 be useful for e.g. archives that are made executable or disk images with 
 the extension .img that can have FAT, ext2, or whatever.

Well, you can cd file.exe#uzip...
Pavel
-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: [PATCH] lynx-like jumpkeys

2003-01-02 Thread Pavel Machek
Hi!

  Relying on timeout seems like bad idea to me.
  Its against UI guidelines (they say things should
  not depend on timing, except in games).
 
 That makes sense in general. That's why these timeout based
 features should be optional.

Being optional is not excuse for breaking guidelines.

  Mutt cerainly waits for you to press enter, no timeouts there.
 
 It the app waits for enter, then it also must provide an
 additional visual feedback - display the processed numbers
 somewhere (like mutt does). 
 
 The timeout based solution has the advantage, that it provides the
 visual feedback, because the selection cursor moves immediately
 as the keys are pressed.
... 
 Implementing that enter based approach would also be much more
 complicated, you would need an additional text input widget
 somewhere. It also has no advantage for those people who don't
 mind the timeout. It only imposes an unnecessary additional key
 press on them.

Timeout breaks randomly on overloaded systems
and slow networks. Bad idea. What about
non-number key ending move-by-number
mode? No timeouts neccessary.

I still dont see how it is better than C-S, through.
-- 
Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: [BUG] Hintbar switch off in 4.6.0-pre2

2003-01-02 Thread Pavel Machek
Hi!

 When I'm switching off the hintbar via Options-Layout,
 the hintbar text starts to appear at the upper left corner of Linux
 console.

Its a feature; ftpfs progress is displayed there
even if hintbar is off.
-- 
Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: [PATCH] lynx-like jumpkeys

2002-12-23 Thread Pavel Machek
Hi!

 Here is a patch which adds a fast lynx-like navigation to the
 panels and to the listbox widgets (history, hotlist, ...). Each
 displayed entry is numbered and may be selected by one or two
 keystrokes.
 
 To select for example a file or a hotlist entry numbered 23,
 just press the keys 2 and 3 in quick succession.  The

Relying on timeout seems like bad idea to me.
Its against UI guidelines (they say things should
not depend on timing, except in games).

 This type of keyboard navigation is used in lynx, mutt, slrn,
 cscope, vim, links and many other programs. Once one gets used to
 it, then it can help to save a lot of keystrokes.

Mutt cerainly waits for you to press enter,
no timeouts there.

-- 
Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: uzip extfs sanity patch

2002-12-10 Thread Pavel Machek
Hi!

  Well, if fish-like format was used, something like 
  
  Nfile_name
  Dsome_unparsable_junk
  Prwxr--r--
  
  would be passed to midnight. Midnight would refuse to interpret date,
 
 Well, that would be great, but it would implicate updating (and
 complicating, or even rewriting in Perl, like Pavel R. said) every
 extfs script - so it looks like it's not worth the effort.

Well, if correctness is not worth the effort... :-(. It could be done
one script at a time...

Imagine what happens with filenames like 2001 Space odysey etc.

Pavel
-- 
Worst form of spam? Adding advertisment signatures ala sourceforge.net.
What goes next? Inserting advertisment *into* email?
___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: [PATCH proposal] FISH: don't let ssh write its ouput to the controlling tty

2002-12-08 Thread Pavel Machek
Hi!

 This patch addresses the problem with ssh writing to the controlling
 terminal when asking for password and when displaying a message that the
 remote system is not known.

Maybe it is easier to fix ssh now that openBSD people maintain it?

-- 
Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: tilde-bug in vfs.c

2002-09-08 Thread Pavel Machek

Hi!

  What does your patch implement?  How does it work?  Please always comment
  non-obvious patches.  In this case we really should make a decision before
  we go ahead and patch the code.
 
 Oh, I thought it was so simple. :) Anyway, vfs_canon is modified to
 first canonicalize without tilde expansion. If this expanded file
 exists (according to the vfs's stat function), this name is returned.
 Otherwise, vfs_canon will simply canonicalize *with* tilde expansion
 and return the result.
 
 To accomplish this it was necessary to create a new function
 vfs_canon_internal that can canonicalize either with tilde expansion
 or without.
 
 The drawback is that vfs_canon in worst case takes twice as long,
 plus the time for the vfs stat call.

VFS stat can take *long*. I'd suggest against this. What about 
vfs_tilde_expand(char *name, int maxlen)?

Pavel



-- 
Philips Velo 1: 1x4x8, 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: MC handling of extfs supplied ls - style dirs more

2002-09-06 Thread Pavel Machek

Hi!

  Now, after the longish start, D64 images have files with names of up to
  16 character. These may contain spaces, '/' and all kind of other characters.
  We found it to be incomfortable to parse out the spaces, since the linux
  filesystems handle such stuff nicely usually. Currently only '/' and '@' are 
  escaped and awk 'gsub'ed' to a '_' ...
 
 I don't understand relevance of Linux filesystems in this context.
 
  I found, that especially leading spaces in filenames cause tremendous problems
  towards midnight commander. I also did a quick cross-compare with the supplied
  zip filesystem. A file containing e.g.test  and test.d64 can be 
  entered fine, but only test.d64 can be extracted.  test only can be 
  extracted using e.g. unzip. Though, MC handles (space)files on the normal 
  filesystems just fine.
 
 extfs tries to be flexible in respect to its input in assumption that the 
 filenames are not too strange.  That's the price to be paid to be 
 compatible with many different listings.
 
 It should be possible to implement a variant of extfs with more fixed 
 format and less limitations on filenames.  It may be useful for other 
 script-generated listings.

Maybe listing format from fish shoud be used? It uses \n as separator...

-- 
Philips Velo 1: 1x4x8, 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: vfs.c Could not parse

2001-10-07 Thread Pavel Machek

Hi!

   what about checking its three letters and if so, return ok but set date
   to 1970-01-01 to indicate date  is wrong?
  
  Sound good to me.  Letters should mean any ASCII letter or any character
  between 160 and 255.
 
  
 And is it defined anywhere, that months names should be only 3 chars long?
 I'm afraid that standart is more flexible in this...

There's no standard. Sorry. Check for 3 chars, see what breaks.
Pavel
-- 
I'm [EMAIL PROTECTED] In my country we have almost anarchy and I don't care.
Panos Katsaloulis describing me w.r.t. patents at [EMAIL PROTECTED]

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: vfs/ftpfs New feature on Solaris 2.7

2001-10-06 Thread Pavel Machek

Hi!

 Index: vfs.c
 ===
 RCS file: /home/sav/.cvsroot/mc/vfs/vfs.c,v
 retrieving revision 1.60
 diff -u -p -r1.60 vfs.c
 --- vfs.c 25 May 2000 18:00:34 -  1.60
 +++ vfs.c 27 Sep 2001 12:18:48 -
 @@ -1439,9 +1442,10 @@ vfs_parse_filetype (char c)
 return S_IFSOCK;
  #endif
  case 'p': return S_IFIFO;
 + case 'D': /* Solaris door */
  case 'm': case 'n':  /* Don't know what these are :-) */
  case '-': case '?': return S_IFREG;
  default: return -1;
  }
  }

Looks good!
Pavel

-- 
Philips Velo 1: 1x4x8, 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.


___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: vfs.c Could not parse

2001-10-06 Thread Pavel Machek

Hi!

  This FTP server outputs the file dates with Frech format:
 
  150 ASCII data connection for /bin/ls (139.54.66.187,1071) (0 bytes).
  total 15740
  drwxr-xr-x   6 root other512 sep  26 16:52 .
  drwxr-xr-x   3 root other512 sep  25 14:43 ..
  drwxr-xr-x  13 root other512 sep  26 15:23 apache
  drwxrwsr-x  28 root bin 1024 f.v   8  2001 ghost
  drwxr-xr-x   5 999  999  512 nov  27  2000 perl560
  drwxr-xr-x   9 999  999  512 nov   3  2000 tomcat
  -rw-r--r--   1 root other8042496 sep  26 16:51 TOMCAT.03.01.sol.tar
  226 ASCII Transfer complete.
 
  The table in
  static int
  is_month (char *str, struct tm *tim)
  {
  static char *month = JanFebMarAprMayJunJulAugSepOctNovDec;
 
  is obviously an English table, and is good for most servers.
  what can we do ?
 
 Some time ago we discussed this.  Then extended ftpfs URL with
 locale specifiacation was proposed.  But it does not cure if you
 have not required locale installed on your system.

what about checking its three letters and if so, return ok but set date
to 1970-01-01 to indicate date  is wrong?

-- 
Philips Velo 1: 1x4x8, 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.


___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: mmap and SIGBUS

2001-09-23 Thread Pavel Machek

Hi!

   And I like mmap, not just because of the file size thing but because it
   should provide the fastest parsers and reduce VM page duplication.  (I
   use it for text parsing, and so does GCC these days).  SIGBUS is an
   essential ingredient in fast parsers, if they are to recover on
   problematic filesystems.  Fortunately, recovery from SIGBUS _is_
   possible when it's required.
  
  I'm not very experienced in such matters, but I understand that the only
  way to recover after SIGBUS and SIGSEGV is to use longjpm in the signal
  handler.  Otherwise, the same instruction is executed, and if it's
  something like movl (%edx), %eax, there is no way to prevent it from
  failing over and over again.  Is it correct?
 
 No, it is possible to change the mapping and then return from the signal
 handler.  The same instruction can then proceed without raising a signal.
 
 However, in the cases of a file read error (due to permissions or hard
 errors), you'd probably want to use a longjmp or siglongjmp.  That would
 at least prevent a viewer from crashing: it would report a read error
 instead.
 
 That is probably the right thing to do for GMC.

Or you could map there /dev/zero, and set error flag somewhere,
killing longjmp mess.

Pavel
  Your sentiment about network transparency is very understandable.  Some
  people want their fancy keyboard combinations work they do in Windows, but
  the terminfo database doesn't have entries for keys like Ctrl-Alt-PgUp.
  Making everyone happy requires either hacks or redesigning very
  fundamental things.
 
 Well, xterm, emacs, ghostview etc. and even netscape  mozilla work just
 fine remotely, so I'm disappointed to find Gnome apps have the special
 feature of _not_ working remotely.  It is a peculiar weakness, given
 that network is what the N stands for.

pavel@bug:~$ ssh elf
Last login: Sun Sep 23 22:30:15 2001 from bug.ucw.cz
You have mail.
TERM=xterm

pavel@Elf:~$ gmc

Gdk-WARNING **: locale not supported by C library

...and it worked for me. Pretty new debian/testing, but gnome apps
worked over network forever...

Pavel
-- 
I'm [EMAIL PROTECTED] In my country we have almost anarchy and I don't care.
Panos Katsaloulis describing me w.r.t. patents at [EMAIL PROTECTED]

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: Possibility of Colorer usage (was: php syntax)

2001-09-20 Thread Pavel Machek

Hi!

  About the first problem: now colorer uses Apache Software License.
  Is it acceptable for us?
 
 I think it's Ok for GPL'd software to link against any libraries, even
 against the ones under restrictive commercial licenses (e.g. libc on
 Solaris).

Its not. GPL has special exception for libc.

-- 
Philips Velo 1: 1x4x8, 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.


___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel



Re: RFC on file_store()

2001-06-20 Thread Pavel Machek

Hi!

   1) Write fish_server and run it with exec. Maybe even upload fish_server
   if it's not on the server.
 
  (If you are going to write fish_server, in which language. If in
  shell, you can just stream your fish_server as it is currently
  done. If other language... and if it is not there?)
 
 Of course I meant using shell. But at some point it's easier to have a
 separate file. The idea is that the proposed fish server should never
 execute what it gets from the client without examining it for validity.
 
 If the client and the server share a key (call it a cookie if you want)
 and use it to validate commands, things like executing random commands
 become quite unlikely.
 
 Instead of a fixed cookie, it should be possible to send MD5 hashes of
 every command to the server and validate them there.

...yup. Ugly as hell ;-).

 But I still don't understand why I can login with ssh, run dd press Ctrl-C
 and kill dd _only_, but MC cannot.

Maybe it is because you are sending control-c while user control-c
generates signal and that is sent out-of-band? [Not sure it really
works like that.]
Pavel
-- 
I'm [EMAIL PROTECTED] In my country we have almost anarchy and I don't care.
Panos Katsaloulis describing me w.r.t. patents at [EMAIL PROTECTED]

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel