Uploaded image for project: 'Couchbase Gateway'
  1. Couchbase Gateway
  2. CBG-514

running sgcollect_info on command with root privileges is overriding bin/sync_gateway file on MacOS

    XMLWordPrintable

    Details

    • Required Mobile Fields:
      Hide
      Mandatory:
       - CBL / SG Version:
         - SG Config:
       - Steps to Reproduce:
       - Actual Result:
       - Expected Result:
       - Logs :
            SGW LOGS: sgcollect info
            CBL LOGS:
            Logcat LOGS: for Android tickets
       - Github link for the code:
       - Jenkins job failure link:
       - Pytest Command
       - What is the last build this test passed:
      Show
      Mandatory:  - CBL / SG Version:    - SG Config:  - Steps to Reproduce:  - Actual Result:  - Expected Result:  - Logs :       SGW LOGS: sgcollect info       CBL LOGS:       Logcat LOGS: for Android tickets  - Github link for the code:  - Jenkins job failure link:  - Pytest Command  - What is the last build this test passed:
    • Sprint:
      CBG Sprint 31
    • Story Points:
      3

      Description

      SGW Version : 2.6.0-127 -> Not a regression, looks like it is first time tested.
      SG Config: SG collect info should have
      Steps to Reproduce:

      1. Create some docs
      2. Run sgCollect_info from command line with sudo

      Actual Result:

      /opt/couchbase-sync-gateway/bin/sync_gateway file get overrided with text 

      "

      RedactLevel:partial,HashOfSalt:78d3dac761769fafb90b6fd2f6630313e5df13e8"

       Expected Result:

        bin/sync_gateway file should not get override the binary file

      SGW LOGSsgcollectsaltingtest-redacted-withoutsudo.zip

      sgcollectsaltingtest-withoutsudo.zip

      sgcollectsaltingtest1-redacted-withsudo.zip

      sgcollectsaltingtest1-withsudo.zip

      Command to run the sgcollect : 

      sudo /opt/couchbase-sync-gateway/tools/sgcollect_info --log-redaction-level=partial sgcollectsaltingtest.zip --log-redaction-salt=redacted-salt

      What is the last build this test passed: This is first time tested with sudo

        Attachments

          Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

            Hide
            ben.brooks Ben Brooks added a comment - - edited

            Reproduced on all versions since 2.1.0 (when redaction was added)

            Looks like this issue was always there. I will find the root cause and see if it could possibly affect other platforms.

            Show
            ben.brooks Ben Brooks added a comment - - edited Reproduced on all versions since 2.1.0 (when redaction was added) Looks like this issue was always there. I will find the root cause and see if it could possibly affect other platforms.
            Hide
            sridevi.saragadam Sridevi Saragadam added a comment -

            i dont see this issue on centos 

            Show
            sridevi.saragadam Sridevi Saragadam added a comment - i dont see this issue on centos 
            Hide
            adamf Adam Fraser added a comment -

            Needs additional analysis to determine actual root cause, but adding the binary into the set of exclusions for redaction should address this. Would still like to complete the root cause analysis, though, to ensure there aren't any related issues going on.

            Show
            adamf Adam Fraser added a comment - Needs additional analysis to determine actual root cause, but adding the binary into the set of exclusions for redaction should address this. Would still like to complete the root cause analysis, though, to ensure there aren't any related issues going on.
            Hide
            build-team Couchbase Build Team added a comment -

            Build sync_gateway-2.7.0-38 contains sync_gateway commit 0d029bb with commit message:
            CBG-514: SGCollect overwrite binary fix (#4242)

            Show
            build-team Couchbase Build Team added a comment - Build sync_gateway-2.7.0-38 contains sync_gateway commit 0d029bb with commit message: CBG-514 : SGCollect overwrite binary fix (#4242)
            Hide
            jacques.rascagneres Jacques Rascagneres added a comment - - edited

            This issue is reproducible in both Centos and MacOS. However, if the process is running in Centos when sgcollect is ran it will fail to overwrite the running binary (this may be why it wasn't seen above).

            The following conditions all have to be true for this to occur:

            • sgcollect ran with sudo
            • sgcollect ran with redaction enabled
            • sync_gateway binary is in the default /opt... directory
            • the sync_gateway binary is not running (Only in the centos case)
            Show
            jacques.rascagneres Jacques Rascagneres added a comment - - edited This issue is reproducible in both Centos and MacOS. However, if the process is running in Centos when sgcollect  is ran it will fail to overwrite the running binary (this may be why it wasn't seen above). The following conditions all have to be true for this to occur: sgcollect ran with sudo sgcollect ran with redaction enabled sync_gateway binary is in the default /opt ... directory the sync_gateway binary is not running (Only in the centos case)

              People

              Assignee:
              jacques.rascagneres Jacques Rascagneres
              Reporter:
              sridevi.saragadam Sridevi Saragadam
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes

                    PagerDuty