tgstation-server
The /tg/station 13 server suite
Main Page
API
Architecture
Packages
Classes
Files
File List
src
Tgstation.Server.Host
IO
PosixPostWriteHandler.cs
Go to the documentation of this file.
1
using
Mono.Unix;
2
using
Mono.Unix.Native;
3
using
System
;
4
5
namespace
Tgstation
.
Server
.Host.IO
6
{
10
sealed
class
PosixPostWriteHandler
:
IPostWriteHandler
11
{
13
public
void
HandleWrite
(
string
filePath)
14
{
15
if
(filePath == null)
16
throw
new
ArgumentNullException(nameof(filePath));
17
18
//set executable bit every time, don't want people calling me when their uploaded "sl" binary doesn't work
19
if
(Syscall.stat(filePath, out var stat) != 0)
20
throw
new
UnixIOException(Stdlib.GetLastError());
21
22
if
(stat.st_mode.HasFlag(FilePermissions.S_IXUSR))
23
return
;
24
25
if
(Syscall.chmod(filePath, stat.st_mode | FilePermissions.S_IXUSR) != 0)
26
throw
new
UnixIOException(Stdlib.GetLastError());
27
}
28
}
29
}
Tgstation.Server.Host.IO.PosixPostWriteHandler.HandleWrite
void HandleWrite(string filePath)
For handling system specific necessities after a write
Definition:
PosixPostWriteHandler.cs:13
Tgstation.Server.Host.IO.PosixPostWriteHandler
IPostWriteHandler for POSIX systems
Definition:
PosixPostWriteHandler.cs:10
Tgstation.Server.Host.IO.IPostWriteHandler
Definition:
IPostWriteHandler.cs:3
Tgstation.Server.Api.Models.IrcPasswordType.Server
Use server authentication
System
Tgstation
Generated by
1.8.11