bugzilla-daemon at bugzilla.mindrot.org
2008-Nov-24 13:21 UTC
[Bug 1541] New: sftp: the do_stat() failure is ignored for chown, chgrp ops. in parse_dispatch_command()
https://bugzilla.mindrot.org/show_bug.cgi?id=1541 Summary: sftp: the do_stat() failure is ignored for chown, chgrp ops. in parse_dispatch_command() Product: Portable OpenSSH Version: -current Platform: All OS/Version: All Status: NEW Severity: trivial Priority: P5 Component: sftp AssignedTo: unassigned-bugs at mindrot.org ReportedBy: anedvedicky at gmail.com This is a realy small bug. the code in parse_dispatch_command() looks as follows @1186 for (i = 0; g.gl_pathv[i] && !interrupted; i++) { if (!(aa = do_stat(conn, g.gl_pathv[i], 0))) { if (err != 0 && err_abort) break; else continue; the err is always 0, once for loop is entered (this is guaranteed by code in parse_dispatch_command() so if do_stat() operation fails, the if (err != 0 && err_abort) is still not satisfied and continue is always executed. this prevents sftp client to bail out the function on the first failure. this will cause problem only in batchmode. --- cut here to get patch ------ bash-3.2$ diff -u /net/grok.czech/ws-local/onnv-clone/usr/src/cmd/ssh/sftp/sftp.c sftp.c --- /net/grok.czech/ws-local/onnv-clone/usr/src/cmd/ssh/sftp/sftp.c Wed Oct 15 00:41:07 2008 +++ sftp.c Fri Nov 21 17:05:48 2008 @@ -1185,18 +1185,26 @@ remote_glob(conn, path1, GLOB_NOCHECK, NULL, &g); for (i = 0; g.gl_pathv[i] && !interrupted; i++) { if (!(aa = do_stat(conn, g.gl_pathv[i], 0))) { - if (err != 0 && err_abort) + if (err_abort) { + err = -1; break; - else + } + else { + err = 0; continue; + } } if (!(aa->flags & SSH2_FILEXFER_ATTR_UIDGID)) { error("Can't get current ownership of " "remote file \"%s\"", g.gl_pathv[i]); - if (err != 0 && err_abort) + if (err_abort) { + err = -1; break; - else + } + else { + err = 0; continue; + } } aa->flags &= SSH2_FILEXFER_ATTR_UIDGID; if (cmdnum == I_CHOWN) { -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Dec-07 22:24 UTC
[Bug 1541] sftp: the do_stat() failure is ignored for chown, chgrp ops. in parse_dispatch_command()
https://bugzilla.mindrot.org/show_bug.cgi?id=1541 --- Comment #1 from Damien Miller <djm at mindrot.org> 2008-12-08 09:24:52 --- Created an attachment (id=1584) --> (http://bugzilla.mindrot.org/attachment.cgi?id=1584) propagate error on failure inside chown/chgrp -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Dec-07 22:25 UTC
[Bug 1541] sftp: the do_stat() failure is ignored for chown, chgrp ops. in parse_dispatch_command()
https://bugzilla.mindrot.org/show_bug.cgi?id=1541 Damien Miller <djm at mindrot.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |djm at mindrot.org Blocks| |1481 --- Comment #2 from Damien Miller <djm at mindrot.org> 2008-12-08 09:25:17 --- Put this on the list for openssh-5.2 -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug. You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2008-Dec-09 03:13 UTC
[Bug 1541] sftp: the do_stat() failure is ignored for chown, chgrp ops. in parse_dispatch_command()
https://bugzilla.mindrot.org/show_bug.cgi?id=1541 --- Comment #3 from Damien Miller <djm at mindrot.org> 2008-12-09 14:13:19 --- Fix applied. This will be in openssh-5.2 - thanks! -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug. You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2009-Jan-13 06:15 UTC
[Bug 1541] sftp: the do_stat() failure is ignored for chown, chgrp ops. in parse_dispatch_command()
https://bugzilla.mindrot.org/show_bug.cgi?id=1541 Damien Miller <djm at mindrot.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug. You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2009-Feb-23 02:36 UTC
[Bug 1541] sftp: the do_stat() failure is ignored for chown, chgrp ops. in parse_dispatch_command()
https://bugzilla.mindrot.org/show_bug.cgi?id=1541 Damien Miller <djm at mindrot.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #4 from Damien Miller <djm at mindrot.org> 2009-02-23 13:36:42 --- Close bugs fixed/reviewed for openssh-5.2 release -- Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching the assignee of the bug. You are watching someone on the CC list of the bug.