Support backup of sockets

This only works on Linux. Darwin does not allow mknod of a socket.
Have not tested BSD.
This commit is contained in:
2023-10-04 02:12:17 -05:00
parent 31c131b9e3
commit 059e74da17
4 changed files with 33 additions and 19 deletions

View File

@@ -516,7 +516,7 @@ func (entry *Entry) IsLink() bool {
}
func (entry *Entry) IsSpecial() bool {
return entry.Mode&uint32(os.ModeNamedPipe|os.ModeDevice|os.ModeCharDevice) != 0
return entry.Mode&uint32(os.ModeNamedPipe|os.ModeDevice|os.ModeCharDevice|os.ModeSocket) != 0
}
func (entry *Entry) IsFileOrSpecial() bool {
@@ -807,9 +807,6 @@ func ListEntries(top string, path string, patterns []string, nobackupFile string
if f.Name() == DUPLICACY_DIRECTORY {
continue
}
if f.Mode()&os.ModeSocket != 0 {
continue
}
entry := CreateEntryFromFileInfo(f, normalizedPath)
if len(patterns) > 0 && !MatchPath(entry.Path, patterns) {