| 11 | | Tue 02 Aug 2005 07:51:51 AM UTC, comment #7: |
| 12 | | |
| 13 | | I also think that those complaints are reasonable, but I don't |
| 14 | | understand what this has to do with anything ?! :) |
| 15 | | |
| 16 | | So far, if I've read the discussion correctly, I've understand that |
| 17 | | you also agree that both lchown() and chown() have to be used - |
| 18 | | depending on the task that has to be performed. So do you still |
| 19 | | think mc_lchown() is wrong ? If so - why do you think so ? |
| 20 | | Pavel Tsekov <ptsekov> |
| 21 | | Project Administrator |
| 22 | | Mon 01 Aug 2005 04:55:59 PM UTC, comment #6: |
| 23 | | |
| 24 | | Well, in that case I will use chown command. I heard complains |
| 25 | | about current behaviour and I found these complains reasonable. |
| 26 | | Andrew V. Samoilov <sav> |
| 27 | | Project MemberIn charge of this item. |
| 28 | | Mon 01 Aug 2005 02:55:55 PM UTC, comment #5: |
| 29 | | |
| 30 | | What happens if you want to work on the target of the symlink and |
| 31 | | not on the link itself ? readlink() followed by lchown () ? |
| 32 | | Pavel Tsekov <ptsekov> |
| 33 | | Project Administrator |
| 34 | | Mon 01 Aug 2005 02:40:32 PM UTC, comment #4: |
| 35 | | |
| 36 | | IMHO it's wrong idea to introduce mc_lchown(). |
| 37 | | Also if local_chown() will use lchown() we will fix bug with C-x O |
| 38 | | for symlinks. Now it change ownership for target of symlink. |
| 39 | | We can call mc_chown() after make_symlink(). |
| 40 | | Andrew V. Samoilov <sav> |
| 41 | | Project MemberIn charge of this item. |
| 42 | | Sat 16 Jul 2005 01:30:48 PM UTC, comment #3: |
| 43 | | |
| 44 | | Maybe we should keep the chown() call in local_chown() and |
| 45 | | introduce a new function called local_lchown() ? Then we use the |
| 46 | | appropriate call based on the value of 'follow Links' ? In any case |
| 47 | | currently MC doesn't support changing the ownership of the link |
| 48 | | when the link is copied: |
| 49 | | |
| 50 | | if (S_ISLNK (sb.st_mode)) { |
| 51 | | int retval; |
| 52 | | |
| 53 | | retval = make_symlink (ctx, src_path, dst_path); |
| 54 | | return retval; |
| 55 | | } |
| 56 | | |
| 57 | | This is the block of code dealing with symlinks in copy_file_file(). |
| 58 | | Pavel Tsekov <ptsekov> |
| 59 | | Project Administrator |
| 60 | | Sat 16 Jul 2005 09:29:22 AM UTC, comment #2: |
| 61 | | |
| 62 | | man 2 chown |
| 63 | | In versions of Linux prior to 2.1.81 (and distinct from |
| 64 | | 2.1.46), chown did not follow symbolic links. Since Linux |
| 65 | | 2.1.81, chown does follow symbolic links, and there is a |
| 66 | | new system call lchown that does not follow symbolic |
| 67 | | links. Since Linux 2.1.86, this new call (that has the |
| 68 | | same semantics as the old chown) has got the same syscall |
| 69 | | number, and chown got the newly introduced number. |
| 70 | | |
| 71 | | So we need to check one more function in configure and use lchown() |
| 72 | | insteod of chown() in the vfs/local.c if HAVE_LCHONW. |
| 73 | | Andrew V. Samoilov <sav> |
| 74 | | Project MemberIn charge of this item. |
| 75 | | Thu 07 Jul 2005 12:33:11 PM UTC, comment #1: |
| 76 | | |
| 77 | | Confirmed. I'll be working on this. |
| 78 | | Pavel Tsekov <ptsekov> |
| 79 | | Project Administrator |
| 80 | | Fri 17 Jun 2005 10:35:17 AM UTC, original submission: |
| 81 | | |
| | 28 | |
| | 29 | Comment 1 by Pavel Tsekov <ptsekov> at Thu 07 Jul 2005 12:33:11 PM UTC: |
| | 30 | {{{ |
| | 31 | Confirmed. I'll be working on this. |
| | 32 | }}} |
| | 33 | |
| | 34 | Comment 2 by Andrew V. Samoilov <sav> at Sat 16 Jul 2005 09:29:22 AM UTC: |
| | 35 | {{{ |
| | 36 | man 2 chown |
| | 37 | In versions of Linux prior to 2.1.81 (and distinct from |
| | 38 | 2.1.46), chown did not follow symbolic links. Since Linux |
| | 39 | 2.1.81, chown does follow symbolic links, and there is a |
| | 40 | new system call lchown that does not follow symbolic |
| | 41 | links. Since Linux 2.1.86, this new call (that has the |
| | 42 | same semantics as the old chown) has got the same syscall |
| | 43 | number, and chown got the newly introduced number. |
| | 44 | |
| | 45 | So we need to check one more function in configure and use lchown() |
| | 46 | insteod of chown() in the vfs/local.c if HAVE_LCHONW. |
| | 47 | }}} |
| | 48 | |
| | 49 | Comment 3 by Pavel Tsekov <ptsekov> at Sat 16 Jul 2005 01:30:48 PM UTC: |
| | 50 | {{{ |
| | 51 | Maybe we should keep the chown() call in local_chown() and |
| | 52 | introduce a new function called local_lchown() ? Then we use the |
| | 53 | appropriate call based on the value of 'follow Links' ? In any case |
| | 54 | currently MC doesn't support changing the ownership of the link |
| | 55 | when the link is copied: |
| | 56 | |
| | 57 | if (S_ISLNK (sb.st_mode)) { |
| | 58 | int retval; |
| | 59 | |
| | 60 | retval = make_symlink (ctx, src_path, dst_path); |
| | 61 | return retval; |
| | 62 | } |
| | 63 | |
| | 64 | This is the block of code dealing with symlinks in copy_file_file(). |
| | 65 | }}} |
| | 66 | |
| | 67 | Comment 4 by Andrew V. Samoilov <sav> at Mon 01 Aug 2005 02:40:32 PM UTC: |
| | 68 | {{{ |
| | 69 | IMHO it's wrong idea to introduce mc_lchown(). |
| | 70 | Also if local_chown() will use lchown() we will fix bug with C-x O |
| | 71 | for symlinks. Now it change ownership for target of symlink. |
| | 72 | We can call mc_chown() after make_symlink(). |
| | 73 | }}} |
| | 74 | |
| | 75 | Comment 5 by Pavel Tsekov <ptsekov> at Mon 01 Aug 2005 02:55:55 PM UTC: |
| | 76 | {{{ |
| | 77 | What happens if you want to work on the target of the symlink and |
| | 78 | not on the link itself ? readlink() followed by lchown () ? |
| | 79 | }}} |
| | 80 | |
| | 81 | Comment 6 by Andrew V. Samoilov <sav> at Mon 01 Aug 2005 04:55:59 PM UTC: |
| | 82 | {{{ |
| | 83 | Well, in that case I will use chown command. I heard complains |
| | 84 | about current behaviour and I found these complains reasonable. |
| | 85 | }}} |
| | 86 | |
| | 87 | Comment 7 by Pavel Tsekov <ptsekov> at Tue 02 Aug 2005 07:51:51 AM UTC: |
| | 88 | {{{ |
| | 89 | I also think that those complaints are reasonable, but I don't |
| | 90 | understand what this has to do with anything ?! :) |
| | 91 | |
| | 92 | So far, if I've read the discussion correctly, I've understand that |
| | 93 | you also agree that both lchown() and chown() have to be used - |
| | 94 | depending on the task that has to be performed. So do you still |
| | 95 | think mc_lchown() is wrong ? If so - why do you think so ? |
| | 96 | }}} |