From cd04ba8bf9e872a94d4099beae69bbdb291eb9ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arturo=20Filast=C3=B2?= Date: Tue, 18 Sep 2018 12:10:11 +0200 Subject: [PATCH] Remove sketchy workaround to UTF-8 characters in homedir We now implement a workaround to this inside of probe-desktop. See: https://github.com/ooni/probe-desktop/pull/17/commits/d97189f312eff5462abeb56e34a2b9de36e6b51e --- nettests/nettests.go | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/nettests/nettests.go b/nettests/nettests.go index 3b4455b..1348fea 100644 --- a/nettests/nettests.go +++ b/nettests/nettests.go @@ -75,47 +75,11 @@ func (c *Controller) Init(nt *mk.Nettest) error { testName := strcase.ToSnake(nt.Name) resultID := c.res.ID reportFilePath := c.msmtPath - - // This is to workaround homedirs having UTF-8 characters in them. - // See: https://github.com/measurement-kit/measurement-kit/issues/1635 geoIPCountryPath := filepath.Join(utils.GeoIPDir(c.Ctx.Home), "GeoIP.dat") geoIPASNPath := filepath.Join(utils.GeoIPDir(c.Ctx.Home), "GeoIPASNum.dat") caBundlePath := getCaBundlePath() msmtPath := c.msmtPath - userHome, err := utils.GetOONIHome() - if err != nil { - log.WithError(err).Error("failed to figure out the homedir") - return err - } - // Get the parent of it - userHome = filepath.Dir(userHome) - - relPath, err := filepath.Rel(userHome, caBundlePath) - if err != nil { - log.WithError(err).Error("caBundlePath is not relative to the users home") - } else { - caBundlePath = relPath - } - relPath, err = filepath.Rel(userHome, geoIPASNPath) - if err != nil { - log.WithError(err).Error("geoIPASNPath is not relative to the users home") - } else { - geoIPASNPath = relPath - } - relPath, err = filepath.Rel(userHome, geoIPCountryPath) - if err != nil { - log.WithError(err).Error("geoIPCountryPath is not relative to the users home") - } else { - geoIPCountryPath = relPath - } - - log.Debugf("Chdir to: %s", userHome) - if err := os.Chdir(userHome); err != nil { - log.WithError(err).Errorf("failed to chdir to %s", userHome) - return err - } - log.Debugf("OutputPath: %s", msmtPath) nt.Options = mk.NettestOptions{ IncludeIP: c.Ctx.Config.Sharing.IncludeIP,