Many changes #62

Merged
Kan18 merged 9 commits from Kan18/develop-1.8 into develop-1.8 2026-03-22 11:58:42 -04:00
Showing only changes of commit 8fbcc7b8bc - Show all commits

View File

@@ -59,6 +59,10 @@ local function sambaConnection(socket)
print('samba: Connection closed') print('samba: Connection closed')
end end
local function sanitizeLabel(computer)
return (computer.id.."_"..computer.label:gsub("[%c%.\"'/%*]", "")):sub(64)
end
Event.addRoutine(function() Event.addRoutine(function()
print('samba: listening on port 139') print('samba: listening on port 139')
@@ -79,10 +83,10 @@ Event.addRoutine(function()
end) end)
Event.on('network_attach', function(_, computer) Event.on('network_attach', function(_, computer)
fs.mount(fs.combine('network', computer.label), 'netfs', computer.id) fs.mount(fs.combine('network', sanitizeLabel(computer)), 'netfs', computer.id)
end) end)
Event.on('network_detach', function(_, computer) Event.on('network_detach', function(_, computer)
print('samba: detaching ' .. computer.label) print('samba: detaching ' .. sanitizeLabel(computer))
fs.unmount(fs.combine('network', computer.label)) fs.unmount(fs.combine('network', sanitizeLabel(computer)))
end) end)