John Starks
12afdbf8b8
Merge pull request #86 from azdagron/file-handle-access
...
provide access to underlying file handle
2019-05-16 09:56:58 -07:00
John Starks
2be8053e58
Merge pull request #138 from microsoft/etw-write-error
...
etwlogrus: Ignore error from ETW WriteEvent
2019-05-08 08:21:23 -07:00
John Starks
1bcf844dd4
Merge pull request #140 from microsoft/etwlogrus-tests
...
etwlogrus: Improve tests to actually go through logrus hook
2019-05-08 08:20:37 -07:00
John Starks
b092048eb0
Merge pull request #139 from microsoft/fix-etw-logrus
...
etwlogrus: Fix event logging not including fields
2019-05-08 08:19:54 -07:00
John Starks
e90d8317de
Merge pull request #133 from jstarks/sort_keys
...
pkg/etwlogrus: Ensure stable event field order
2019-05-07 13:40:08 -07:00
John Starks
664840fcdb
pkg/etwlogrus: Ensure stable event field order
...
This change updates the logrus hook to sort the incoming logrus data
before passing it to the tracelogging code. This is useful because it
ensures that two instances of the same event have the fields in the same
order, which is necessary to get WPA to line the fields up.
2019-05-07 19:27:13 +00:00
John Starks
89c1d0e19d
pkg/etw: Add support for time.Time
...
This change adds support for encoding time.Time values as FILETIME
values in tracelogging events. FILETIME has slightly less precision than
time.Time (100ns vs 1ns), but it is the closest availble match.
2019-05-05 00:02:18 +00:00
John Starks
d132a827c0
Merge pull request #128 from jstarks/hvsock
...
winio: Add AF_HYPERV listener
2019-04-22 09:32:45 -07:00
John Starks
7776571819
winio: Add AF_HYPERV listener
2019-04-21 15:35:05 -07:00
John Starks
bd71ef0e5d
pipe: Fix ListenPipe/DialPipe race
...
ListenPipe can fail if there is a concurrent DialPipe because there is a
race window where DialPipe can connect to the initial server named pipe
before it is connected to and closed by ListenPipe.
To fix this, use the lower-level NT API for creating the server pipe,
since this API allows for specifying that a server pipe should initially
be in the disconnected state instead of the listening state. This allows
us to avoid the race condition by creating the pipe in the correct state
initially, so there is no longer a need to create a dummy client
connection.
2019-04-08 10:08:23 -07:00
John Starks and kevpar
98d07c865e
Update pkg/etw/event.go
...
Co-Authored-By: kevpar <kevpar@users.noreply.github.com >
2018-12-18 18:20:29 -08:00
John Starks
a6d595ae73
Merge pull request #80 from nanomsg/norace2
...
fixes #67 DialPipe problem with multiple calls / waiting for busy pipe
2018-07-19 15:37:18 -07:00
John Starks
67921128fb
Merge pull request #82 from jstarks/pipe_message_mode
...
Support pipe message read mode
2018-06-25 13:58:01 -07:00
John Starks
3eabd1969d
Clean up message mode pipe handling, add test
2018-06-25 09:31:55 -07:00
John Starks
ae842e48e0
pipe: Resolve race between close and connect
...
This change resolves the issue where Accept() returns ERROR_NO_DATA
because the client closes the connection immediately. It resolves
the race by ignoring that particular connection and waiting on a
new one.
2018-01-09 13:28:13 -08:00
John Starks
78439966b3
Merge pull request #65 from darrenstahlmsft/waitGroup
...
Prevent adding to a sync.WaitGroup that has a waiter
2017-08-04 13:09:54 -07:00
John Starks
036d9d8653
Merge pull request #64 from jstarks/tar_ea
...
Add support for EAs to Windows tars
2017-08-02 11:48:47 -07:00
John Starks
353f5972cb
Merge pull request #63 from fsouza/fix-data-race
...
Copy pointer to prevent data race on pipe connection
2017-08-02 11:45:34 -07:00
John Starks
c4dc1301f1
Merge pull request #56 from swernli/master
...
Adding simple CreateVhdx method
2017-07-11 21:46:15 -07:00
John Starks
d311c76e77
Merge pull request #51 from darrenstahlmsft/NoCGO
...
Remove cgo as a dependency added by #49
2017-05-08 14:01:43 -07:00
John Starks
518e6ebd8b
Merge pull request #50 from Microsoft/Timeout
...
Apply read and write deadlines to pending IO
2017-05-08 13:59:22 -07:00
John Starks
13736c3252
Merge pull request #48 from darrenstahlmsft/Go1.8
...
Added runtime.KeepAlive for the new stricter 1.8 GC
2017-05-03 12:50:31 -07:00
John Starks
307e919c66
Merge pull request #37 from vanita5/master
...
Replace unnecessary mod17 function with builtin mod
2017-01-12 16:12:40 -08:00
John Starks
562bb09f66
Merge pull request #35 from Microsoft/jjh/disableprocpriv
...
Add DisableProcessPrivileges
2016-11-03 11:56:17 -07:00
John Starks
2cf8f2ee8b
Add reference to code of conduct
2016-06-21 14:08:28 -07:00
John Starks
4f1a71750d
Merge pull request #24 from Microsoft/fix
...
Pass FILE_FLAG_OPEN_REPARSE_POINT in OpenForBackup
2016-05-19 17:05:29 -07:00
John Starks
f4304cf7dc
Pass FILE_FLAG_OPEN_REPARSE_POINT in OpenForBackup
2016-05-19 17:02:51 -07:00
John Starks
88d9b9ee05
Merge pull request #23 from Microsoft/wim_opts
...
Optimize WIM parsing
2016-05-17 13:16:34 -07:00
John Starks
2255376ea2
Merge pull request #22 from Microsoft/priv_opts
...
Add function for setting privileges globally
2016-05-13 11:41:16 -07:00
John Starks
e94cfdcd8a
Merge pull request #21 from Microsoft/sjw/sddl-fix
...
Remove use of SDDL in tar headers
2016-05-12 21:35:16 -07:00
John Starks
f1a78c8aaf
Add function for setting privileges globally
...
Also optimize privilege setting with the same privilege name multiple
times.
2016-05-12 21:33:03 -07:00
John Starks
69b46ecca8
LZX: Split table into two parts
2016-05-12 19:47:52 -07:00
John Starks
d69c9fb04e
LZX: Perform buffering internally
2016-05-12 19:47:51 -07:00
John Starks
5e100a8bcc
LZX: Improve huffman table encoding
2016-05-12 19:47:47 -07:00
John Starks
d1317d5733
Reduce decompression of directory metadata
2016-05-11 16:33:31 -07:00
John Starks
3b8b3c98b2
Merge pull request #18 from Microsoft/wim_multi
...
Fix multiple calls to img.Open
2016-04-18 15:16:11 -07:00
John Starks
24c009df14
Fix multiple calls to img.Open
2016-04-18 12:51:10 -07:00
John Starks
862b655792
Merge pull request #17 from Microsoft/fix_symlink
...
Backuptar: replace slash with backslash on link target
2016-04-11 18:00:29 -07:00
John Starks
6606cf93e2
Handle long paths correctly in reparse points
2016-04-11 17:20:42 -07:00
John Starks
93ca0b892a
Backuptar: replace slash with backslash on link target
2016-04-11 15:45:43 -07:00
John Starks
9f57cbbcbc
Merge pull request #16 from Microsoft/fixing_wim
...
Fix various WIM bugs
2016-04-06 17:10:02 -07:00
John Starks
a7636ef88a
WIM: Parse XML data
...
This parses the XML data so that callers do not have to.
2016-04-06 17:09:08 -07:00
John Starks
9ef8a67999
Add .gitignore
2016-04-06 13:59:58 -07:00
John Starks
d18f2f3f56
Add validate tool to scan all directories in a WIM
2016-04-06 13:58:23 -07:00
John Starks
2748a384c0
WIM: Don't use syscall package
...
This allows the WIM code to build on other OSes.
2016-04-06 13:57:09 -07:00
John Starks
3cedae2e26
WIM: Fix handling of reparse points
...
Reparse point data is not always in the first stream, sometimes it is in
the file data itself. Remove ReparseStream and always put it in the file
data.
2016-04-06 13:56:25 -07:00
John Starks
bad3e111b5
LZX: Fix unaligned block failure
...
This fixes the case where an unaligned block lands on a 16-bit boundary.
2016-04-06 13:45:37 -07:00
John Starks
9e60d867bd
Merge pull request #15 from Microsoft/wim_support
...
Add WIM parser
2016-04-05 12:21:21 -07:00
John Starks
0e1e9fec26
Add WIM parser
...
This new code supports parsing WIM files. Currently, only WIM files that
were created with no compression or LZX compression are supported. Xpress
compression is not.
2016-04-04 13:51:45 -07:00
John Starks
9e2895e5f6
Merge pull request #14 from Microsoft/tar_changes
...
Backup-related improvements
2016-03-30 12:52:49 -07:00
John Starks
346aee8003
Add backuptar.BasicInfoHeader helper function
...
This is useful for creating tar headers for things that don't have backup
streams, such as links.
2016-03-30 12:38:06 -07:00
John Starks
3b18fb5af2
Add OpenForBackup function
...
This works with RunWithPrivileges to allow opening files as an
administrator without access checks.
2016-03-30 12:38:05 -07:00
John Starks
2245090e75
Add GetFileID function
2016-03-30 12:38:04 -07:00
John Starks
424d62c72e
Use existing PAX headers for time
...
This removes the MSWINDOWS.* time fields and uses PAX times directly. I
didn't previously realize that PAX times could be negative, which
eliminates the need to store Windows times in a different format.
This also uses the LIBARCHIVE.creationtime field for creation times to
match OS X behavior.
2016-03-30 12:38:03 -07:00
John Starks
8f9387ea7e
Merge pull request #13 from Microsoft/TimerResolutionFix
...
Fixed error in #12
2016-03-15 17:33:20 -07:00
John Starks
dc33d951c5
Merge pull request #12 from Microsoft/TimerResolution
...
Fixes performance regression in GO 1.6
2016-03-15 15:38:50 -07:00
John Starks
8f29b1bf99
Merge pull request #11 from Microsoft/test_pipe_eof
...
Support CloseWrite() by using pipe message mode
2016-03-15 15:11:27 -07:00
John Starks
b12bd3ac52
Let clients set pipe buffer sizes
2016-03-15 11:59:27 -07:00
John Starks
36f4e701c4
Add support for CloseWrite() to pipes
...
This change adds support for message mode pipes and uses them to support
CloseWrite() to better match TCP and UNIX sockets. Message mode pipes
support writing and (optionally) reading data in message-sized chunks.
This is useful for us because when in this mode a zero-sized message can
be read. We use this zero-sized message to signal that no more writes will
arrive. This is not standard practice in Windows, but it is a reasonable
compromise.
2016-03-15 11:58:02 -07:00
John Starks
0c1e4a09ec
Add tests that check for EOF on pipe close
2016-03-14 16:33:35 -07:00
John Starks
f778f05015
Merge pull request #10 from Microsoft/priv_fix
...
Fix RunWithPrivilege when the process token already has the privilege
2016-03-05 18:57:29 -08:00
John Starks
cd7216c8af
Fix RunWithPrivilege when the process token already has the privilege
2016-03-05 18:49:41 -08:00
John Starks
c40bf24f40
Merge pull request #9 from Microsoft/add_tar
...
Use forked archive/tar to encode Windows metadata properly
2016-02-23 12:49:43 -08:00
John Starks
b1cf780eb5
Use tar fork to encode Windows metadata correctly
2016-02-23 12:48:28 -08:00
John Starks
71ac47a42e
Add tar.Headers.Winheaders for Windows metadata
2016-02-23 12:48:26 -08:00
John Starks
752c574975
Add archive/tar from go 1.6
...
github.com/golang/go bfccf7b3e198587372f755d4ebace292a06ea2e5
2016-02-23 12:48:25 -08:00
John Starks
db2d8862e6
Merge pull request #8 from Microsoft/backup
...
Fix encoding of Win32 file times
2016-02-23 12:10:00 -08:00
John Starks
0186d1e4dd
Fix encoding of Win32 file times
2016-02-22 14:04:34 -08:00
John Starks
a7276e8bc4
Merge pull request #7 from Microsoft/backup
...
Interfaces on top of BackupRead, BackupWrite
2016-02-18 20:42:46 -08:00
John Starks
0cd1930b37
Add experimental code to convert backup streams to tar streams
...
This code is experimental because it currently writes Windows metadata to
tar.Header.Xattrs, which is actually for POSIX extended attributes.
2016-02-18 20:41:01 -08:00
John Starks
f011a81ddc
Add interface to BackupRead/BackupWrite
2016-02-18 20:40:32 -08:00
John Starks
606856475f
Merge pull request #6 from Microsoft/privilege
...
Add functions for running with privileges
2016-02-18 20:37:48 -08:00
John Starks
6a0656b357
Add functions for running with privileges
2016-02-18 20:36:50 -08:00
John Starks
da7011968c
Merge pull request #5 from Microsoft/fileinfo
...
Add functions to get/set FILE_BASIC_INFO
2016-02-18 20:35:20 -08:00
John Starks
1ac2c4761f
Add functions to get/set FILE_BASIC_INFO
2016-02-18 20:33:57 -08:00
John Starks
94a8d2823f
Merge pull request #4 from Microsoft/mksyscall
...
Use mksyscall_windows.go from go source in go generate
2016-02-16 18:21:30 -08:00
John Starks
a920ad0a26
Use mksyscall_windows.go from go source in go generate
2016-02-16 18:20:22 -08:00
John Starks
eb176a9831
Merge pull request #3 from Microsoft/fix_386
...
Fix build on windows/386
2016-02-04 10:50:47 -08:00
John Starks
5292a3509e
Fix build on windows/386
...
Signed-off-by: John Starks <jostarks@microsoft.com >
2016-02-04 10:49:26 -08:00
John Starks
2b085935f0
Update README.md
2016-01-31 17:48:08 -08:00
John Starks
89bdf52a5b
Add routine for looking up account names
...
Signed-off-by: John Starks <jostarks@microsoft.com >
2016-01-31 16:08:10 -08:00
John Starks
fe517a5118
Misc. cleanup
...
Signed-off-by: John Starks <jostarks@microsoft.com >
2016-01-31 14:18:04 -08:00
John Starks
3aa597fc55
Open pipe client with anonymous security
...
This ensures that the pipe server cannot impersonate or even identify
the user that has connected to the pipe. This is a good default to
prevent malicious squatting on a named pipe name.
Signed-off-by: John Starks <jostarks@microsoft.com >
2016-01-31 14:03:47 -08:00
John Starks
99eef7be8d
Ensure DialPipe times eventually by default
...
Signed-off-by: John Starks <jostarks@microsoft.com >
2016-01-31 14:00:21 -08:00
John Starks
3191792462
Fix errors to better match net package
...
Signed-off-by: John Starks <jostarks@microsoft.com >
2016-01-31 13:47:08 -08:00
John Starks
b0d265e6c2
Ensure win32PipeListener.Close() correctly aborts Listen() calls
...
Signed-off-by: John Starks <jostarks@microsoft.com >
2016-01-31 13:46:55 -08:00
John Starks
f001f808a9
Add file and pipe Windows wrappers
...
This includes Reader, Writer, and Closer interfaces on top of
Windows file handles in a way that does not block the system thread
while the IO is outstanding.
This also includes net.Listener and net.Conn for named pipes.
2016-01-30 18:11:47 -08:00