Details

    • Number of attachments :
      3

      Description

      We would recommend that for upload of files to a repository that the following cases be handled to provide greater robustness.

      1.) All uploads be to a "staging" area, this staging area could be the same directory or a temp directory and would upload the file with the file name extension of

      Henk Penning comments:

      > That would be great.
      >
      > I think, the best way for adding/replace stuff is
      >
      > – write a 'temp'
      > – rename 'temp' to 'file'
      >
      > because a rename is truly atomic if 'temp' and 'file' are
      > in the same file system.
      >
      > If you can implement the 'temp' for 'file' to be,
      > for instance, '.tmp.file', I can easily teach the checkers
      > to ignore '.tmp.*' files. I think rsync does something
      > like that (even better .tmp.$$.file).
      >

      So the goals here are to verify that rsync handles ".tmp.$$.file" which will stop it from attempting to sync partial uploads. Henk can alter the md5 checking utilities at Apache to postpone checking .tmp files md5 signatures.

      2.) All file permissions on uploaded files would best handled to be only writable by the individual user, not writable by group and readable by all. All directory permissions should be writable for user and group and readable by all. This forces the following implementation to be required.

      Any file upload that attempts to overwrite a file should instead, move that file out of the way to a temporary location, upload to the new file using strategy (1) and then name it to the old file, once this is completed the old file can be removed. This provides a means be which file "ownership" can be determined and maintained. The problem this solves is the following, if files are "group writable" then any individual in the group can overwite the file altering its contents, historically we cannot tell who actually made the alteration. If there are concerns about the integrity of the artifact or its signature, it is unclear who was responsible for the alteration.

      -Mark Diggory

      1. wagon.patch
        9 kB
        Henry S. Isidro
      2. WAGON-19.patch
        16 kB
        Carlos Sanchez
      3. WebDavWagon.patch
        1 kB
        Henry S. Isidro

        Issue Links

          Activity

          Hide
          Henry S. Isidro added a comment -

          Here's a patch for wagon-ftp that uploads a file with '.tmp.$$.file' appended to it's filename. Once transfer is complete, it removes the temporary extension.

          Show
          Henry S. Isidro added a comment - Here's a patch for wagon-ftp that uploads a file with '.tmp.$$.file' appended to it's filename. Once transfer is complete, it removes the temporary extension.
          Hide
          Henry S. Isidro added a comment -

          I deleted the wagon-ftp patch since I refactored it. This new patch includes implementations for strategy (1) for wagon-ftp, wagon-ssh, wagon-ssh-external and wagon-file.

          Show
          Henry S. Isidro added a comment - I deleted the wagon-ftp patch since I refactored it. This new patch includes implementations for strategy (1) for wagon-ftp, wagon-ssh, wagon-ssh-external and wagon-file.
          Hide
          Henry S. Isidro added a comment -

          Here's one for wagon-webdav which is in the sandbox.

          Show
          Henry S. Isidro added a comment - Here's one for wagon-webdav which is in the sandbox.
          Hide
          Carlos Sanchez added a comment -

          The part about permissions is covered by MDEPLOY-28

          Show
          Carlos Sanchez added a comment - The part about permissions is covered by MDEPLOY-28
          Hide
          Carlos Sanchez added a comment -

          This an updated and improved patch. Requires a lot of testing before applying as this is a really core part of maven

          Show
          Carlos Sanchez added a comment - This an updated and improved patch. Requires a lot of testing before applying as this is a really core part of maven
          Hide
          Brett Porter added a comment -

          I think the best answer here is to make this an optional configuration - other than that the patch looks ok.

          Also, I'm not sure it's needed for all protocols. Do ftp, sftp suffer the same effects as scp? http and webdav don't store permissions and users, so the only question is if it might end up half written.

          Show
          Brett Porter added a comment - I think the best answer here is to make this an optional configuration - other than that the patch looks ok. Also, I'm not sure it's needed for all protocols. Do ftp, sftp suffer the same effects as scp? http and webdav don't store permissions and users, so the only question is if it might end up half written.

            People

            • Assignee:
              Unassigned
              Reporter:
              Mark Diggory
            • Votes:
              11 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated: