-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull request 285: AG-23599 use hostsfile vol.2
Merge in GO/dnsproxy from AG-23599-use-hostsfile-vol.2 to master Squashed commit of the following: commit b8fd8d5 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 10 19:21:33 2023 +0300 upstream: fix nil deref commit 11ec4fe Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 10 18:54:45 2023 +0300 bootstrap: imp docs commit 93aa3b1 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 10 17:30:15 2023 +0300 bootstrap: imp doc commit 9779260 Merge: 1240ee1 ea0f2b1 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 10 16:43:54 2023 +0300 Merge branch 'master' into AG-23599-use-hostsfile-vol.2 commit 1240ee1 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 9 17:37:58 2023 +0300 upstream: remove sort from upstream resolver commit f22fe9b Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 9 15:37:01 2023 +0300 all: upd go commit 45c5215 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Nov 9 15:34:22 2023 +0300 upstream: remove empty impl commit 8582ed9 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 8 13:00:14 2023 +0300 upstream: imp cognit commit 35ce9dc Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 8 12:47:25 2023 +0300 all: imp code, fmt commit 1823da5 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Nov 8 12:33:35 2023 +0300 all: imp docs, restore behavior commit aeda179 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 7 15:23:17 2023 +0300 main: fix import commit fa37464 Merge: eb12aec 254e5a8 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Nov 7 14:33:18 2023 +0300 Merge branch 'master' into AG-23599-use-hostsfile-vol.2 commit eb12aec Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 3 19:44:15 2023 +0300 upstream: fix nil deref commit e897536 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Fri Nov 3 18:38:00 2023 +0300 all: imp code, docs commit 60e7099 Merge: 0e6e9ad 8d20902 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Tue Oct 31 17:16:14 2023 +0300 Merge branch 'master' into AG-23599-use-hostsfile-vol.2 commit 0e6e9ad Merge: b10f900 b4abccf Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Oct 11 17:09:08 2023 +0300 Merge branch 'master' into AG-23599-use-hostsfile-vol.2 commit b10f900 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Wed Oct 11 16:30:18 2023 +0300 upstream: imp returning types & docs commit a5f5077 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Oct 5 18:52:20 2023 +0300 proxy: fix merged test commit a153556 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Oct 5 18:50:27 2023 +0300 netutil: doc more, fix type check commit 718aee8 Merge: 34750a6 60d2174 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Oct 5 16:07:10 2023 +0300 Merge branch 'master' into AG-23599-use-hostsfile-vol.2 ... and 8 more commits
- Loading branch information
1 parent
ea0f2b1
commit 65b5293
Showing
31 changed files
with
735 additions
and
643 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Package osutil contains utilities for functions requiring system calls and | ||
// other OS-specific APIs, except for network-related ones. | ||
package osutil | ||
|
||
import "io/fs" | ||
|
||
// RootDirFS returns the fs.FS rooted at the operating system's root. On | ||
// Windows it returns the fs.FS rooted at the volume of the system directory | ||
// (usually, C:). | ||
// | ||
// TODO(e.burkov): Move to golibs. | ||
func RootDirFS() (fsys fs.FS) { | ||
return rootDirFS() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build !windows | ||
|
||
package osutil | ||
|
||
import ( | ||
"io/fs" | ||
"os" | ||
) | ||
|
||
func rootDirFS() (fsys fs.FS) { | ||
return os.DirFS("/") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//go:build windows | ||
|
||
package osutil | ||
|
||
import ( | ||
"io/fs" | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/AdguardTeam/golibs/log" | ||
"golang.org/x/sys/windows" | ||
) | ||
|
||
func rootDirFS() (fsys fs.FS) { | ||
// TODO(a.garipov): Use a better way if golang/go#44279 is ever resolved. | ||
sysDir, err := windows.GetSystemDirectory() | ||
if err != nil { | ||
log.Error("aghos: getting root filesystem: %s; using C:", err) | ||
|
||
// Assume that C: is the safe default. | ||
return os.DirFS("C:") | ||
} | ||
|
||
return os.DirFS(filepath.VolumeName(sysDir)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.