File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
dragonfly-client/src/grpc Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ use dragonfly_client_core::{
42
42
} ;
43
43
use dragonfly_client_util:: http:: { get_range, hashmap_to_headermap, headermap_to_hashmap} ;
44
44
use hyper_util:: rt:: TokioIo ;
45
+ use std:: os:: unix:: fs:: PermissionsExt ;
45
46
use std:: path:: { Path , PathBuf } ;
46
47
use std:: sync:: Arc ;
47
48
use std:: time:: { Duration , Instant } ;
@@ -124,14 +125,16 @@ impl DfdaemonDownloadServer {
124
125
125
126
// Start download grpc server with unix domain socket.
126
127
fs:: create_dir_all ( self . socket_path . parent ( ) . unwrap ( ) ) . await ?;
127
-
128
128
if self . socket_path . is_file ( ) {
129
129
// Remove the old unix domain socket file if it exists.
130
130
fs:: remove_file ( & self . socket_path ) . await ?;
131
131
}
132
+
132
133
let uds = UnixListener :: bind ( & self . socket_path ) ?;
133
- let uds_stream = UnixListenerStream :: new ( uds) ;
134
+ let perms = std:: fs:: Permissions :: from_mode ( 0o660 ) ;
135
+ fs:: set_permissions ( & self . socket_path , perms) . await ?;
134
136
137
+ let uds_stream = UnixListenerStream :: new ( uds) ;
135
138
let server = Server :: builder ( )
136
139
. max_frame_size ( super :: MAX_FRAME_SIZE )
137
140
. tcp_keepalive ( Some ( super :: TCP_KEEPALIVE ) )
You can’t perform that action at this time.
0 commit comments