1: ; -*- lexical-binding: t -*-
2: ;
3: ; syd.el --- Emacs Lisp implementation of the virtual Syd stat(2) interface
4: ;
5: ; Syd: rock-solid application kernel
6: ; src/syd.el: Emacs Lisp implementation of the virtual Syd stat(2) interface
7: ;
8: ; Copyright (c) 2023, 2024, 2025, 2026 Ali Polatel <alip@chesswob.org>
9: ;
10: ; SPDX-License-Identifier: GPL-3.0
11:
12: ; Define lock states as keywords
13: (defconst syd-lock-off :lock-off
14: "The sandbox lock is off, allowing all sandbox commands.")
15:
16: (defconst syd-lock-exec :lock-exec
17: "The sandbox lock is set to on for all processes except the initial process
18: \(syd exec child). This is the default state.")
19:
20: (defconst syd-lock-drop :lock-drop
21: "The sandbox lock is in drop-only mode, allowing only privilege-dropping
22: sandbox commands.")
23:
24: (defconst syd-lock-read :lock-read
25: "The sandbox lock is in read-only mode, allowing only read-only access
26: to sandbox state.")
27:
28: (defconst syd-lock-on :lock-on
29: "The sandbox lock is on, disallowing all sandbox commands.")
30:
31: ; Define sandbox actions as keywords
32: (defconst syd-action-allow :action-allow
33: "Allow system call.")
34:
35: (defconst syd-action-warn :action-warn
36: "Allow system call and warn.")
37:
38: (defconst syd-action-filter :action-filter
39: "Deny system call silently.")
40:
41: (defconst syd-action-deny :action-deny
42: "Deny system call and warn.")
43:
44: (defconst syd-action-panic :action-panic
45: "Deny system call, warn and panic the current Syd thread.")
46:
47: (defconst syd-action-stop :action-stop
48: "Deny system call, warn and stop offending process.")
49:
50: (defconst syd-action-abort :action-abort
51: "Deny system call, warn and abort offending process.")
52:
53: (defconst syd-action-kill :action-kill
54: "Deny system call, warn and kill offending process.")
55:
56: (defconst syd-action-exit :action-exit
57: "Warn, and exit Syd immediately with deny errno as exit value.")
58:
59: (defun syd-info ()
60: "Reads the state of the syd sandbox from /dev/syd and returns it as an alist.
61: If the `json' module is not available, returns nil."
62: (if (require 'json nil t)
63: (condition-case nil
64: (with-temp-buffer
65: (insert-file-contents "/dev/syd")
66: (with-no-warnings
67: (let ((json-object-type 'alist)
68: (json-array-type 'list)
69: (json-key-type 'symbol)
70: (json-false nil)
71: (json-null nil))
72: (json-read))))
73: (file-error
74: (message "Error reading /dev/syd.")
75: nil)
76: (json-error
77: (message "JSON decoding error.")
78: nil))
79: (progn
80: (message "JSON module not available.")
81: nil)))
82:
83: (defun syd-api ()
84: "Performs a syd API check."
85: (if (syd--stat "/dev/syd/3")
86: 3 ; API number on success
87: nil)) ; On error, return nil
88:
89: (defun syd-check ()
90: "Check if '/dev/syd' is a character device."
91: (syd--stat "/dev/syd"))
92:
93: (defun syd-panic ()
94: "Causes syd to exit immediately with code 127"
95: (syd--stat "/dev/syd/panic"))
96:
97: (defun syd-reset ()
98: "Causes syd to reset sandboxing to the default state."
99: (syd--stat "/dev/syd/reset"))
100:
101: (defun syd-load (fd)
102: "Causes syd to read configuration from the given file descriptor FD."
103: (let ((path (concat "/dev/syd/load/" (number-to-string fd))))
104: (syd--stat path)))
105:
106: (defun syd-lock (state)
107: "Sets the state of the sandbox lock.
108: STATE is one of the keywords :lock-off, :lock-exec, :lock-drop, :lock-read, or :lock-on.
109: Returns t on success, nil on failure."
110: (cond
111: ((eq state syd-lock-off) (syd--stat "/dev/syd/lock:off"))
112: ((eq state syd-lock-exec) (syd--stat "/dev/syd/lock:exec"))
113: ((eq state syd-lock-drop) (syd--stat "/dev/syd/lock:drop"))
114: ((eq state syd-lock-read) (syd--stat "/dev/syd/lock:read"))
115: ((eq state syd-lock-on) (syd--stat "/dev/syd/lock:on"))
116: (t nil))) ; Invalid state
117:
118: (defun syd-enabled-fs ()
119: "Checks if Filesystem sandboxing is enabled."
120: (syd--stat "/dev/syd/sandbox/fs?"))
121:
122: (defun syd-enable-fs ()
123: "Enable Filesystem sandboxing."
124: (syd--stat "/dev/syd/sandbox/fs:on"))
125:
126: (defun syd-disable-fs ()
127: "Disable Filesystem sandboxing."
128: (syd--stat "/dev/syd/sandbox/fs:off"))
129:
130: (defun syd-enabled-walk ()
131: "Checks if Walk sandboxing is enabled."
132: (syd--stat "/dev/syd/sandbox/walk?"))
133:
134: (defun syd-enable-walk ()
135: "Enable Walk sandboxing."
136: (syd--stat "/dev/syd/sandbox/walk:on"))
137:
138: (defun syd-disable-walk ()
139: "Disable Walk sandboxing."
140: (syd--stat "/dev/syd/sandbox/walk:off"))
141:
142: (defun syd-enabled-list ()
143: "Checks if List sandboxing is enabled."
144: (syd--stat "/dev/syd/sandbox/list?"))
145:
146: (defun syd-enable-list ()
147: "Enable List sandboxing."
148: (syd--stat "/dev/syd/sandbox/list:on"))
149:
150: (defun syd-disable-list ()
151: "Disable List sandboxing."
152: (syd--stat "/dev/syd/sandbox/list:off"))
153:
154: (defun syd-enabled-stat ()
155: "Checks if Stat sandboxing is enabled."
156: (syd--stat "/dev/syd/sandbox/stat?"))
157:
158: (defun syd-enable-stat ()
159: "Enable Stat sandboxing."
160: (syd--stat "/dev/syd/sandbox/stat:on"))
161:
162: (defun syd-disable-stat ()
163: "Disable Stat sandboxing."
164: (syd--stat "/dev/syd/sandbox/stat:off"))
165:
166: (defun syd-enabled-read ()
167: "Checks if Read sandboxing is enabled."
168: (syd--stat "/dev/syd/sandbox/read?"))
169:
170: (defun syd-enable-read ()
171: "Enable Read sandboxing."
172: (syd--stat "/dev/syd/sandbox/read:on"))
173:
174: (defun syd-disable-read ()
175: "Disable Read sandboxing."
176: (syd--stat "/dev/syd/sandbox/read:off"))
177:
178: (defun syd-enabled-write ()
179: "Checks if Write sandboxing is enabled."
180: (syd--stat "/dev/syd/sandbox/write?"))
181:
182: (defun syd-enable-write ()
183: "Enable Write sandboxing."
184: (syd--stat "/dev/syd/sandbox/write:on"))
185:
186: (defun syd-disable-write ()
187: "Disable Write sandboxing."
188: (syd--stat "/dev/syd/sandbox/write:off"))
189:
190: (defun syd-enabled-exec ()
191: "Checks if Exec sandboxing is enabled."
192: (syd--stat "/dev/syd/sandbox/exec?"))
193:
194: (defun syd-enable-exec ()
195: "Enable Exec sandboxing."
196: (syd--stat "/dev/syd/sandbox/exec:on"))
197:
198: (defun syd-disable-exec ()
199: "Disable Exec sandboxing."
200: (syd--stat "/dev/syd/sandbox/exec:off"))
201:
202: (defun syd-enabled-ioctl ()
203: "Checks if Ioctl sandboxing is enabled."
204: (syd--stat "/dev/syd/sandbox/ioctl?"))
205:
206: (defun syd-enable-ioctl ()
207: "Enable Ioctl sandboxing."
208: (syd--stat "/dev/syd/sandbox/ioctl:on"))
209:
210: (defun syd-disable-ioctl ()
211: "Disable Ioctl sandboxing."
212: (syd--stat "/dev/syd/sandbox/ioctl:off"))
213:
214: (defun syd-enabled-create ()
215: "Checks if create sandboxing is enabled."
216: (syd--stat "/dev/syd/sandbox/create?"))
217:
218: (defun syd-enable-create ()
219: "Enable create sandboxing."
220: (syd--stat "/dev/syd/sandbox/create:on"))
221:
222: (defun syd-disable-create ()
223: "Disable create sandboxing."
224: (syd--stat "/dev/syd/sandbox/create:off"))
225:
226: (defun syd-enabled-delete ()
227: "Checks if delete sandboxing is enabled."
228: (syd--stat "/dev/syd/sandbox/delete?"))
229:
230: (defun syd-enable-delete ()
231: "Enable delete sandboxing."
232: (syd--stat "/dev/syd/sandbox/delete:on"))
233:
234: (defun syd-disable-delete ()
235: "Disable delete sandboxing."
236: (syd--stat "/dev/syd/sandbox/delete:off"))
237:
238: (defun syd-enabled-rename ()
239: "Checks if rename sandboxing is enabled."
240: (syd--stat "/dev/syd/sandbox/rename?"))
241:
242: (defun syd-enable-rename ()
243: "Enable rename sandboxing."
244: (syd--stat "/dev/syd/sandbox/rename:on"))
245:
246: (defun syd-disable-rename ()
247: "Disable rename sandboxing."
248: (syd--stat "/dev/syd/sandbox/rename:off"))
249:
250: (defun syd-enabled-readlink ()
251: "Checks if readlink sandboxing is enabled."
252: (syd--stat "/dev/syd/sandbox/readlink?"))
253:
254: (defun syd-enable-readlink ()
255: "Enable readlink sandboxing."
256: (syd--stat "/dev/syd/sandbox/readlink:on"))
257:
258: (defun syd-disable-readlink ()
259: "Disable readlink sandboxing."
260: (syd--stat "/dev/syd/sandbox/readlink:off"))
261:
262: (defun syd-enabled-symlink ()
263: "Checks if symlink sandboxing is enabled."
264: (syd--stat "/dev/syd/sandbox/symlink?"))
265:
266: (defun syd-enable-symlink ()
267: "Enable symlink sandboxing."
268: (syd--stat "/dev/syd/sandbox/symlink:on"))
269:
270: (defun syd-disable-symlink ()
271: "Disable symlink sandboxing."
272: (syd--stat "/dev/syd/sandbox/symlink:off"))
273:
274: (defun syd-enabled-truncate ()
275: "Checks if Truncate sandboxing is enabled."
276: (syd--stat "/dev/syd/sandbox/truncate?"))
277:
278: (defun syd-enable-truncate ()
279: "Enable Truncate sandboxing."
280: (syd--stat "/dev/syd/sandbox/truncate:on"))
281:
282: (defun syd-disable-truncate ()
283: "Disable Truncate sandboxing."
284: (syd--stat "/dev/syd/sandbox/truncate:off"))
285:
286: (defun syd-enabled-chdir ()
287: "Checks if chdir sandboxing is enabled."
288: (syd--stat "/dev/syd/sandbox/chdir?"))
289:
290: (defun syd-enable-chdir ()
291: "Enable chdir sandboxing."
292: (syd--stat "/dev/syd/sandbox/chdir:on"))
293:
294: (defun syd-disable-chdir ()
295: "Disable chdir sandboxing."
296: (syd--stat "/dev/syd/sandbox/chdir:off"))
297:
298: (defun syd-enabled-readdir ()
299: "Checks if readdir sandboxing is enabled."
300: (syd--stat "/dev/syd/sandbox/readdir?"))
301:
302: (defun syd-enable-readdir ()
303: "Enable readdir sandboxing."
304: (syd--stat "/dev/syd/sandbox/readdir:on"))
305:
306: (defun syd-disable-readdir ()
307: "Disable readdir sandboxing."
308: (syd--stat "/dev/syd/sandbox/readdir:off"))
309:
310: (defun syd-enabled-mkdir ()
311: "Checks if mkdir sandboxing is enabled."
312: (syd--stat "/dev/syd/sandbox/mkdir?"))
313:
314: (defun syd-enable-mkdir ()
315: "Enable mkdir sandboxing."
316: (syd--stat "/dev/syd/sandbox/mkdir:on"))
317:
318: (defun syd-disable-mkdir ()
319: "Disable mkdir sandboxing."
320: (syd--stat "/dev/syd/sandbox/mkdir:off"))
321:
322: (defun syd-enabled-rmdir ()
323: "Checks if rmdir sandboxing is enabled."
324: (syd--stat "/dev/syd/sandbox/rmdir?"))
325:
326: (defun syd-enable-rmdir ()
327: "Enable rmdir sandboxing."
328: (syd--stat "/dev/syd/sandbox/rmdir:on"))
329:
330: (defun syd-disable-rmdir ()
331: "Disable rmdir sandboxing."
332: (syd--stat "/dev/syd/sandbox/rmdir:off"))
333:
334: (defun syd-enabled-chown ()
335: "Checks if chown sandboxing is enabled."
336: (syd--stat "/dev/syd/sandbox/chown?"))
337:
338: (defun syd-enable-chown ()
339: "Enable chown sandboxing."
340: (syd--stat "/dev/syd/sandbox/chown:on"))
341:
342: (defun syd-disable-chown ()
343: "Disable chown sandboxing."
344: (syd--stat "/dev/syd/sandbox/chown:off"))
345:
346: (defun syd-enabled-chgrp ()
347: "Checks if chgrp sandboxing is enabled."
348: (syd--stat "/dev/syd/sandbox/chgrp?"))
349:
350: (defun syd-enable-chgrp ()
351: "Enable chgrp sandboxing."
352: (syd--stat "/dev/syd/sandbox/chgrp:on"))
353:
354: (defun syd-disable-chgrp ()
355: "Disable chgrp sandboxing."
356: (syd--stat "/dev/syd/sandbox/chgrp:off"))
357:
358: (defun syd-enabled-chmod ()
359: "Checks if chmod sandboxing is enabled."
360: (syd--stat "/dev/syd/sandbox/chmod?"))
361:
362: (defun syd-enable-chmod ()
363: "Enable chmod sandboxing."
364: (syd--stat "/dev/syd/sandbox/chmod:on"))
365:
366: (defun syd-disable-chmod ()
367: "Disable chmod sandboxing."
368: (syd--stat "/dev/syd/sandbox/chmod:off"))
369:
370: (defun syd-enabled-chattr ()
371: "Checks if chattr sandboxing is enabled."
372: (syd--stat "/dev/syd/sandbox/chattr?"))
373:
374: (defun syd-enable-chattr ()
375: "Enable chattr sandboxing."
376: (syd--stat "/dev/syd/sandbox/chattr:on"))
377:
378: (defun syd-disable-chattr ()
379: "Disable chattr sandboxing."
380: (syd--stat "/dev/syd/sandbox/chattr:off"))
381:
382: (defun syd-enabled-chroot ()
383: "Checks if chroot sandboxing is enabled."
384: (syd--stat "/dev/syd/sandbox/chroot?"))
385:
386: (defun syd-enable-chroot ()
387: "Enable chroot sandboxing."
388: (syd--stat "/dev/syd/sandbox/chroot:on"))
389:
390: (defun syd-disable-chroot ()
391: "Disable chroot sandboxing."
392: (syd--stat "/dev/syd/sandbox/chroot:off"))
393:
394: (defun syd-enabled-notify ()
395: "Checks if notify sandboxing is enabled."
396: (syd--stat "/dev/syd/sandbox/notify?"))
397:
398: (defun syd-enable-notify ()
399: "Enable notify sandboxing."
400: (syd--stat "/dev/syd/sandbox/notify:on"))
401:
402: (defun syd-disable-notify ()
403: "Disable notify sandboxing."
404: (syd--stat "/dev/syd/sandbox/notify:off"))
405:
406: (defun syd-enabled-utime ()
407: "Checks if utime sandboxing is enabled."
408: (syd--stat "/dev/syd/sandbox/utime?"))
409:
410: (defun syd-enable-utime ()
411: "Enable utime sandboxing."
412: (syd--stat "/dev/syd/sandbox/utime:on"))
413:
414: (defun syd-disable-utime ()
415: "Disable utime sandboxing."
416: (syd--stat "/dev/syd/sandbox/utime:off"))
417:
418: (defun syd-enabled-mkbdev ()
419: "Checks if mkbdev sandboxing is enabled."
420: (syd--stat "/dev/syd/sandbox/mkbdev?"))
421:
422: (defun syd-enable-mkbdev ()
423: "Enable mkbdev sandboxing."
424: (syd--stat "/dev/syd/sandbox/mkbdev:on"))
425:
426: (defun syd-disable-mkbdev ()
427: "Disable mkbdev sandboxing."
428: (syd--stat "/dev/syd/sandbox/mkbdev:off"))
429:
430: (defun syd-enabled-mkcdev ()
431: "Checks if mkcdev sandboxing is enabled."
432: (syd--stat "/dev/syd/sandbox/mkcdev?"))
433:
434: (defun syd-enable-mkcdev ()
435: "Enable mkcdev sandboxing."
436: (syd--stat "/dev/syd/sandbox/mkcdev:on"))
437:
438: (defun syd-disable-mkcdev ()
439: "Disable mkcdev sandboxing."
440: (syd--stat "/dev/syd/sandbox/mkcdev:off"))
441:
442: (defun syd-enabled-mkfifo ()
443: "Checks if mkfifo sandboxing is enabled."
444: (syd--stat "/dev/syd/sandbox/mkfifo?"))
445:
446: (defun syd-enable-mkfifo ()
447: "Enable mkfifo sandboxing."
448: (syd--stat "/dev/syd/sandbox/mkfifo:on"))
449:
450: (defun syd-disable-mkfifo ()
451: "Disable mkfifo sandboxing."
452: (syd--stat "/dev/syd/sandbox/mkfifo:off"))
453:
454: (defun syd-enabled-mktemp ()
455: "Checks if mktemp sandboxing is enabled."
456: (syd--stat "/dev/syd/sandbox/mktemp?"))
457:
458: (defun syd-enable-mktemp ()
459: "Enable mktemp sandboxing."
460: (syd--stat "/dev/syd/sandbox/mktemp:on"))
461:
462: (defun syd-disable-mktemp ()
463: "Disable mktemp sandboxing."
464: (syd--stat "/dev/syd/sandbox/mktemp:off"))
465:
466: (defun syd-enabled-net ()
467: "Checks if Network sandboxing is enabled."
468: (syd--stat "/dev/syd/sandbox/net?"))
469:
470: (defun syd-enable-net ()
471: "Enable Network sandboxing."
472: (syd--stat "/dev/syd/sandbox/net:on"))
473:
474: (defun syd-disable-net ()
475: "Disable Network sandboxing."
476: (syd--stat "/dev/syd/sandbox/net:off"))
477:
478: (defun syd-enabled-lock ()
479: "Checks if lock sandboxing is enabled."
480: (syd--stat "/dev/syd/sandbox/lock?"))
481:
482: (defun syd-enabled-crypt ()
483: "Checks if crypt sandboxing is enabled."
484: (syd--stat "/dev/syd/sandbox/crypt?"))
485:
486: (defun syd-enabled-proxy ()
487: "Checks if proxy sandboxing is enabled."
488: (syd--stat "/dev/syd/sandbox/proxy?"))
489:
490: (defun syd-enabled-mem ()
491: "Checks if memory sandboxing is enabled."
492: (syd--stat "/dev/syd/sandbox/mem?"))
493:
494: (defun syd-disable-mem ()
495: "Disable memory sandboxing."
496: (syd--stat "/dev/syd/sandbox/mem:off"))
497:
498: (defun syd-enabled-pid ()
499: "Checks if PID sandboxing is enabled."
500: (syd--stat "/dev/syd/sandbox/pid?"))
501:
502: (defun syd-enable-pid ()
503: "Enable PID sandboxing."
504: (syd--stat "/dev/syd/sandbox/pid:on"))
505:
506: (defun syd-disable-pid ()
507: "Disable PID sandboxing."
508: (syd--stat "/dev/syd/sandbox/pid:off"))
509:
510: (defun syd-enabled-force ()
511: "Checks if force sandboxing is enabled."
512: (syd--stat "/dev/syd/sandbox/force?"))
513:
514: (defun syd-disable-force ()
515: "Disable force sandboxing."
516: (syd--stat "/dev/syd/sandbox/force:off"))
517:
518: (defun syd-enabled-tpe ()
519: "Checks if TPE sandboxing is enabled."
520: (syd--stat "/dev/syd/sandbox/tpe?"))
521:
522: (defun syd-enable-tpe ()
523: "Enable TPE sandboxing."
524: (syd--stat "/dev/syd/sandbox/tpe:on"))
525:
526: (defun syd-disable-tpe ()
527: "Disable TPE sandboxing."
528: (syd--stat "/dev/syd/sandbox/tpe:off"))
529:
530: (defun syd-default-fs (action)
531: "Set default action for Filesystem sandboxing.
532: ACTION is a constant representing the sandboxing action."
533: (let ((action (cond
534: ((eq action :action-allow) "allow")
535: ((eq action :action-warn) "warn")
536: ((eq action :action-filter) "filter")
537: ((eq action :action-deny) "deny")
538: ((eq action :action-panic) "panic")
539: ((eq action :action-stop) "stop")
540: ((eq action :action-abort) "abort")
541: ((eq action :action-kill) "kill")
542: ((eq action :action-exit) "exit"))))
543: ; Only proceed if action is not nil
544: (when action
545: (let ((cmd (format "/dev/syd/default/fs:%s" action)))
546: ; Call syd--stat with the command
547: (syd--stat cmd)))))
548:
549: (defun syd-default-walk (action)
550: "Set default action for Walk sandboxing.
551: ACTION is a constant representing the sandboxing action."
552: (let ((action (cond
553: ((eq action :action-allow) "allow")
554: ((eq action :action-warn) "warn")
555: ((eq action :action-filter) "filter")
556: ((eq action :action-deny) "deny")
557: ((eq action :action-panic) "panic")
558: ((eq action :action-stop) "stop")
559: ((eq action :action-abort) "abort")
560: ((eq action :action-kill) "kill")
561: ((eq action :action-exit) "exit"))))
562: ; Only proceed if action is not nil
563: (when action
564: (let ((cmd (format "/dev/syd/default/walk:%s" action)))
565: ; Call syd--stat with the command
566: (syd--stat cmd)))))
567:
568: (defun syd-default-list (action)
569: "Set default action for List sandboxing.
570: ACTION is a constant representing the sandboxing action."
571: (let ((action (cond
572: ((eq action :action-allow) "allow")
573: ((eq action :action-warn) "warn")
574: ((eq action :action-filter) "filter")
575: ((eq action :action-deny) "deny")
576: ((eq action :action-panic) "panic")
577: ((eq action :action-stop) "stop")
578: ((eq action :action-abort) "abort")
579: ((eq action :action-kill) "kill")
580: ((eq action :action-exit) "exit"))))
581: ; Only proceed if action is not nil
582: (when action
583: (let ((cmd (format "/dev/syd/default/list:%s" action)))
584: ; Call syd--stat with the command
585: (syd--stat cmd)))))
586:
587: (defun syd-default-stat (action)
588: "Set default action for Stat sandboxing.
589: ACTION is a constant representing the sandboxing action."
590: (let ((action (cond
591: ((eq action :action-allow) "allow")
592: ((eq action :action-warn) "warn")
593: ((eq action :action-filter) "filter")
594: ((eq action :action-deny) "deny")
595: ((eq action :action-panic) "panic")
596: ((eq action :action-stop) "stop")
597: ((eq action :action-abort) "abort")
598: ((eq action :action-kill) "kill")
599: ((eq action :action-exit) "exit"))))
600: ; Only proceed if action is not nil
601: (when action
602: (let ((cmd (format "/dev/syd/default/stat:%s" action)))
603: ; Call syd--stat with the command
604: (syd--stat cmd)))))
605:
606: (defun syd-default-read (action)
607: "Set default action for Read sandboxing.
608: ACTION is a constant representing the sandboxing action."
609: (let ((action (cond
610: ((eq action :action-allow) "allow")
611: ((eq action :action-warn) "warn")
612: ((eq action :action-filter) "filter")
613: ((eq action :action-deny) "deny")
614: ((eq action :action-panic) "panic")
615: ((eq action :action-stop) "stop")
616: ((eq action :action-abort) "abort")
617: ((eq action :action-kill) "kill")
618: ((eq action :action-exit) "exit"))))
619: ; Only proceed if action is not nil
620: (when action
621: (let ((cmd (format "/dev/syd/default/read:%s" action)))
622: ; Call syd--stat with the command
623: (syd--stat cmd)))))
624:
625: (defun syd-default-write (action)
626: "Set default action for Write sandboxing.
627: ACTION is a constant representing the sandboxing action."
628: (let ((action (cond
629: ((eq action :action-allow) "allow")
630: ((eq action :action-warn) "warn")
631: ((eq action :action-filter) "filter")
632: ((eq action :action-deny) "deny")
633: ((eq action :action-panic) "panic")
634: ((eq action :action-stop) "stop")
635: ((eq action :action-abort) "abort")
636: ((eq action :action-kill) "kill")
637: ((eq action :action-exit) "exit"))))
638: ; Only proceed if action is not nil
639: (when action
640: (let ((cmd (format "/dev/syd/default/write:%s" action)))
641: ; Call syd--write with the command
642: (syd--stat cmd)))))
643:
644: (defun syd-default-exec (action)
645: "Set default action for Exec sandboxing.
646: ACTION is a constant representing the sandboxing action."
647: (let ((action (cond
648: ((eq action :action-allow) "allow")
649: ((eq action :action-warn) "warn")
650: ((eq action :action-filter) "filter")
651: ((eq action :action-deny) "deny")
652: ((eq action :action-panic) "panic")
653: ((eq action :action-stop) "stop")
654: ((eq action :action-abort) "abort")
655: ((eq action :action-kill) "kill")
656: ((eq action :action-exit) "exit"))))
657: ; Only proceed if action is not nil
658: (when action
659: (let ((cmd (format "/dev/syd/default/exec:%s" action)))
660: ; Call syd--exec with the command
661: (syd--stat cmd)))))
662:
663: (defun syd-default-ioctl (action)
664: "Set default action for Ioctl sandboxing.
665: ACTION is a constant representing the sandboxing action."
666: (let ((action (cond
667: ((eq action :action-allow) "allow")
668: ((eq action :action-warn) "warn")
669: ((eq action :action-filter) "filter")
670: ((eq action :action-deny) "deny")
671: ((eq action :action-panic) "panic")
672: ((eq action :action-stop) "stop")
673: ((eq action :action-abort) "abort")
674: ((eq action :action-kill) "kill")
675: ((eq action :action-exit) "exit"))))
676: ; Only proceed if action is not nil
677: (when action
678: (let ((cmd (format "/dev/syd/default/ioctl:%s" action)))
679: ; Call syd--ioctl with the command
680: (syd--stat cmd)))))
681:
682: (defun syd-default-create (action)
683: "Set default action for Create sandboxing.
684: ACTION is a constant representing the sandboxing action."
685: (let ((action (cond
686: ((eq action :action-allow) "allow")
687: ((eq action :action-warn) "warn")
688: ((eq action :action-filter) "filter")
689: ((eq action :action-deny) "deny")
690: ((eq action :action-panic) "panic")
691: ((eq action :action-stop) "stop")
692: ((eq action :action-abort) "abort")
693: ((eq action :action-kill) "kill")
694: ((eq action :action-exit) "exit"))))
695: ; Only proceed if action is not nil
696: (when action
697: (let ((cmd (format "/dev/syd/default/create:%s" action)))
698: ; Call syd--stat with the command
699: (syd--stat cmd)))))
700:
701: (defun syd-default-delete (action)
702: "Set default action for Delete sandboxing.
703: ACTION is a constant representing the sandboxing action."
704: (let ((action (cond
705: ((eq action :action-allow) "allow")
706: ((eq action :action-warn) "warn")
707: ((eq action :action-filter) "filter")
708: ((eq action :action-deny) "deny")
709: ((eq action :action-panic) "panic")
710: ((eq action :action-stop) "stop")
711: ((eq action :action-abort) "abort")
712: ((eq action :action-kill) "kill")
713: ((eq action :action-exit) "exit"))))
714: ; Only proceed if action is not nil
715: (when action
716: (let ((cmd (format "/dev/syd/default/delete:%s" action)))
717: ; Call syd--stat with the command
718: (syd--stat cmd)))))
719:
720: (defun syd-default-rename (action)
721: "Set default action for rename sandboxing.
722: ACTION is a constant representing the sandboxing action."
723: (let ((action (cond
724: ((eq action :action-allow) "allow")
725: ((eq action :action-warn) "warn")
726: ((eq action :action-filter) "filter")
727: ((eq action :action-deny) "deny")
728: ((eq action :action-panic) "panic")
729: ((eq action :action-stop) "stop")
730: ((eq action :action-abort) "abort")
731: ((eq action :action-kill) "kill")
732: ((eq action :action-exit) "exit"))))
733: ; Only proceed if action is not nil
734: (when action
735: (let ((cmd (format "/dev/syd/default/rename:%s" action)))
736: ; Call syd--stat with the command
737: (syd--stat cmd)))))
738:
739: (defun syd-default-readlink (action)
740: "Set default action for readlink sandboxing.
741: ACTION is a constant representing the sandboxing action."
742: (let ((action (cond
743: ((eq action :action-allow) "allow")
744: ((eq action :action-warn) "warn")
745: ((eq action :action-filter) "filter")
746: ((eq action :action-deny) "deny")
747: ((eq action :action-panic) "panic")
748: ((eq action :action-stop) "stop")
749: ((eq action :action-abort) "abort")
750: ((eq action :action-kill) "kill")
751: ((eq action :action-exit) "exit"))))
752: ; Only proceed if action is not nil
753: (when action
754: (let ((cmd (format "/dev/syd/default/readlink:%s" action)))
755: ; Call syd--stat with the command
756: (syd--stat cmd)))))
757:
758: (defun syd-default-symlink (action)
759: "Set default action for symlink sandboxing.
760: ACTION is a constant representing the sandboxing action."
761: (let ((action (cond
762: ((eq action :action-allow) "allow")
763: ((eq action :action-warn) "warn")
764: ((eq action :action-filter) "filter")
765: ((eq action :action-deny) "deny")
766: ((eq action :action-panic) "panic")
767: ((eq action :action-stop) "stop")
768: ((eq action :action-abort) "abort")
769: ((eq action :action-kill) "kill")
770: ((eq action :action-exit) "exit"))))
771: ; Only proceed if action is not nil
772: (when action
773: (let ((cmd (format "/dev/syd/default/symlink:%s" action)))
774: ; Call syd--stat with the command
775: (syd--stat cmd)))))
776:
777: (defun syd-default-truncate (action)
778: "Set default action for Truncate sandboxing.
779: ACTION is a constant representing the sandboxing action."
780: (let ((action (cond
781: ((eq action :action-allow) "allow")
782: ((eq action :action-warn) "warn")
783: ((eq action :action-filter) "filter")
784: ((eq action :action-deny) "deny")
785: ((eq action :action-panic) "panic")
786: ((eq action :action-stop) "stop")
787: ((eq action :action-abort) "abort")
788: ((eq action :action-kill) "kill")
789: ((eq action :action-exit) "exit"))))
790: ; Only proceed if action is not nil
791: (when action
792: (let ((cmd (format "/dev/syd/default/truncate:%s" action)))
793: ; Call syd--truncate with the command
794: (syd--stat cmd)))))
795:
796: (defun syd-default-chdir (action)
797: "Set default action for chdir sandboxing.
798: ACTION is a constant representing the sandboxing action."
799: (let ((action (cond
800: ((eq action :action-allow) "allow")
801: ((eq action :action-warn) "warn")
802: ((eq action :action-filter) "filter")
803: ((eq action :action-deny) "deny")
804: ((eq action :action-panic) "panic")
805: ((eq action :action-stop) "stop")
806: ((eq action :action-abort) "abort")
807: ((eq action :action-kill) "kill")
808: ((eq action :action-exit) "exit"))))
809: ; Only proceed if action is not nil
810: (when action
811: (let ((cmd (format "/dev/syd/default/chdir:%s" action)))
812: ; Call syd--chdir with the command
813: (syd--stat cmd)))))
814:
815: (defun syd-default-readdir (action)
816: "Set default action for readdir sandboxing.
817: ACTION is a constant representing the sandboxing action."
818: (let ((action (cond
819: ((eq action :action-allow) "allow")
820: ((eq action :action-warn) "warn")
821: ((eq action :action-filter) "filter")
822: ((eq action :action-deny) "deny")
823: ((eq action :action-panic) "panic")
824: ((eq action :action-stop) "stop")
825: ((eq action :action-abort) "abort")
826: ((eq action :action-kill) "kill")
827: ((eq action :action-exit) "exit"))))
828: ; Only proceed if action is not nil
829: (when action
830: (let ((cmd (format "/dev/syd/default/readdir:%s" action)))
831: ; Call syd--readdir with the command
832: (syd--stat cmd)))))
833:
834: (defun syd-default-mkdir (action)
835: "Set default action for mkdir sandboxing.
836: ACTION is a constant representing the sandboxing action."
837: (let ((action (cond
838: ((eq action :action-allow) "allow")
839: ((eq action :action-warn) "warn")
840: ((eq action :action-filter) "filter")
841: ((eq action :action-deny) "deny")
842: ((eq action :action-panic) "panic")
843: ((eq action :action-stop) "stop")
844: ((eq action :action-abort) "abort")
845: ((eq action :action-kill) "kill")
846: ((eq action :action-exit) "exit"))))
847: ; Only proceed if action is not nil
848: (when action
849: (let ((cmd (format "/dev/syd/default/mkdir:%s" action)))
850: ; Call syd--mkdir with the command
851: (syd--stat cmd)))))
852:
853: (defun syd-default-rmdir (action)
854: "Set default action for rmdir sandboxing.
855: ACTION is a constant representing the sandboxing action."
856: (let ((action (cond
857: ((eq action :action-allow) "allow")
858: ((eq action :action-warn) "warn")
859: ((eq action :action-filter) "filter")
860: ((eq action :action-deny) "deny")
861: ((eq action :action-panic) "panic")
862: ((eq action :action-stop) "stop")
863: ((eq action :action-abort) "abort")
864: ((eq action :action-kill) "kill")
865: ((eq action :action-exit) "exit"))))
866: ; Only proceed if action is not nil
867: (when action
868: (let ((cmd (format "/dev/syd/default/rmdir:%s" action)))
869: ; Call syd--rmdir with the command
870: (syd--stat cmd)))))
871:
872: (defun syd-default-chown (action)
873: "Set default action for Chown sandboxing.
874: ACTION is a constant representing the sandboxing action."
875: (let ((action (cond
876: ((eq action :action-allow) "allow")
877: ((eq action :action-warn) "warn")
878: ((eq action :action-filter) "filter")
879: ((eq action :action-deny) "deny")
880: ((eq action :action-panic) "panic")
881: ((eq action :action-stop) "stop")
882: ((eq action :action-abort) "abort")
883: ((eq action :action-kill) "kill")
884: ((eq action :action-exit) "exit"))))
885: ; Only proceed if action is not nil
886: (when action
887: (let ((cmd (format "/dev/syd/default/chown:%s" action)))
888: ; Call syd--stat with the command
889: (syd--stat cmd)))))
890:
891: (defun syd-default-chgrp (action)
892: "Set default action for Chgrp sandboxing.
893: ACTION is a constant representing the sandboxing action."
894: (let ((action (cond
895: ((eq action :action-allow) "allow")
896: ((eq action :action-warn) "warn")
897: ((eq action :action-filter) "filter")
898: ((eq action :action-deny) "deny")
899: ((eq action :action-panic) "panic")
900: ((eq action :action-stop) "stop")
901: ((eq action :action-abort) "abort")
902: ((eq action :action-kill) "kill")
903: ((eq action :action-exit) "exit"))))
904: ; Only proceed if action is not nil
905: (when action
906: (let ((cmd (format "/dev/syd/default/chgrp:%s" action)))
907: ; Call syd--stat with the command
908: (syd--stat cmd)))))
909:
910: (defun syd-default-chmod (action)
911: "Set default action for chmod sandboxing.
912: ACTION is a constant representing the sandboxing action."
913: (let ((action (cond
914: ((eq action :action-allow) "allow")
915: ((eq action :action-warn) "warn")
916: ((eq action :action-filter) "filter")
917: ((eq action :action-deny) "deny")
918: ((eq action :action-panic) "panic")
919: ((eq action :action-stop) "stop")
920: ((eq action :action-abort) "abort")
921: ((eq action :action-kill) "kill")
922: ((eq action :action-exit) "exit"))))
923: ; Only proceed if action is not nil
924: (when action
925: (let ((cmd (format "/dev/syd/default/chmod:%s" action)))
926: ; Call syd--stat with the command
927: (syd--stat cmd)))))
928:
929: (defun syd-default-chattr (action)
930: "Set default action for chattr sandboxing.
931: ACTION is a constant representing the sandboxing action."
932: (let ((action (cond
933: ((eq action :action-allow) "allow")
934: ((eq action :action-warn) "warn")
935: ((eq action :action-filter) "filter")
936: ((eq action :action-deny) "deny")
937: ((eq action :action-panic) "panic")
938: ((eq action :action-stop) "stop")
939: ((eq action :action-abort) "abort")
940: ((eq action :action-kill) "kill")
941: ((eq action :action-exit) "exit"))))
942: ; Only proceed if action is not nil
943: (when action
944: (let ((cmd (format "/dev/syd/default/chattr:%s" action)))
945: ; Call syd--stat with the command
946: (syd--stat cmd)))))
947:
948: (defun syd-default-chroot (action)
949: "Set default action for chroot sandboxing.
950: ACTION is a constant representing the sandboxing action."
951: (let ((action (cond
952: ((eq action :action-allow) "allow")
953: ((eq action :action-warn) "warn")
954: ((eq action :action-filter) "filter")
955: ((eq action :action-deny) "deny")
956: ((eq action :action-panic) "panic")
957: ((eq action :action-stop) "stop")
958: ((eq action :action-abort) "abort")
959: ((eq action :action-kill) "kill")
960: ((eq action :action-exit) "exit"))))
961: ; Only proceed if action is not nil
962: (when action
963: (let ((cmd (format "/dev/syd/default/chroot:%s" action)))
964: ; Call syd--stat with the command
965: (syd--stat cmd)))))
966:
967: (defun syd-default-notify (action)
968: "Set default action for notify sandboxing.
969: ACTION is a constant representing the sandboxing action."
970: (let ((action (cond
971: ((eq action :action-allow) "allow")
972: ((eq action :action-warn) "warn")
973: ((eq action :action-filter) "filter")
974: ((eq action :action-deny) "deny")
975: ((eq action :action-panic) "panic")
976: ((eq action :action-stop) "stop")
977: ((eq action :action-abort) "abort")
978: ((eq action :action-kill) "kill")
979: ((eq action :action-exit) "exit"))))
980: ; Only proceed if action is not nil
981: (when action
982: (let ((cmd (format "/dev/syd/default/notify:%s" action)))
983: ; Call syd--stat with the command
984: (syd--stat cmd)))))
985:
986: (defun syd-default-utime (action)
987: "Set default action for utime sandboxing.
988: ACTION is a constant representing the sandboxing action."
989: (let ((action (cond
990: ((eq action :action-allow) "allow")
991: ((eq action :action-warn) "warn")
992: ((eq action :action-filter) "filter")
993: ((eq action :action-deny) "deny")
994: ((eq action :action-panic) "panic")
995: ((eq action :action-stop) "stop")
996: ((eq action :action-abort) "abort")
997: ((eq action :action-kill) "kill")
998: ((eq action :action-exit) "exit"))))
999: ; Only proceed if action is not nil
1000: (when action
1001: (let ((cmd (format "/dev/syd/default/utime:%s" action)))
1002: ; Call syd--stat with the command
1003: (syd--stat cmd)))))
1004:
1005: (defun syd-default-mkbdev (action)
1006: "Set default action for mkbdev sandboxing.
1007: ACTION is a constant representing the sandboxing action."
1008: (let ((action (cond
1009: ((eq action :action-allow) "allow")
1010: ((eq action :action-warn) "warn")
1011: ((eq action :action-filter) "filter")
1012: ((eq action :action-deny) "deny")
1013: ((eq action :action-panic) "panic")
1014: ((eq action :action-stop) "stop")
1015: ((eq action :action-abort) "abort")
1016: ((eq action :action-kill) "kill")
1017: ((eq action :action-exit) "exit"))))
1018: ; Only proceed if action is not nil
1019: (when action
1020: (let ((cmd (format "/dev/syd/default/mkbdev:%s" action)))
1021: ; Call syd--stat with the command
1022: (syd--stat cmd)))))
1023:
1024: (defun syd-default-mkcdev (action)
1025: "Set default action for mkcdev sandboxing.
1026: ACTION is a constant representing the sandboxing action."
1027: (let ((action (cond
1028: ((eq action :action-allow) "allow")
1029: ((eq action :action-warn) "warn")
1030: ((eq action :action-filter) "filter")
1031: ((eq action :action-deny) "deny")
1032: ((eq action :action-panic) "panic")
1033: ((eq action :action-stop) "stop")
1034: ((eq action :action-abort) "abort")
1035: ((eq action :action-kill) "kill")
1036: ((eq action :action-exit) "exit"))))
1037: ; Only proceed if action is not nil
1038: (when action
1039: (let ((cmd (format "/dev/syd/default/mkcdev:%s" action)))
1040: ; Call syd--stat with the command
1041: (syd--stat cmd)))))
1042:
1043: (defun syd-default-mkfifo (action)
1044: "Set default action for mkfifo sandboxing.
1045: ACTION is a constant representing the sandboxing action."
1046: (let ((action (cond
1047: ((eq action :action-allow) "allow")
1048: ((eq action :action-warn) "warn")
1049: ((eq action :action-filter) "filter")
1050: ((eq action :action-deny) "deny")
1051: ((eq action :action-panic) "panic")
1052: ((eq action :action-stop) "stop")
1053: ((eq action :action-abort) "abort")
1054: ((eq action :action-kill) "kill")
1055: ((eq action :action-exit) "exit"))))
1056: ; Only proceed if action is not nil
1057: (when action
1058: (let ((cmd (format "/dev/syd/default/mkfifo:%s" action)))
1059: ; Call syd--stat with the command
1060: (syd--stat cmd)))))
1061:
1062: (defun syd-default-mktemp (action)
1063: "Set default action for mktemp sandboxing.
1064: ACTION is a constant representing the sandboxing action."
1065: (let ((action (cond
1066: ((eq action :action-allow) "allow")
1067: ((eq action :action-warn) "warn")
1068: ((eq action :action-filter) "filter")
1069: ((eq action :action-deny) "deny")
1070: ((eq action :action-panic) "panic")
1071: ((eq action :action-stop) "stop")
1072: ((eq action :action-abort) "abort")
1073: ((eq action :action-kill) "kill")
1074: ((eq action :action-exit) "exit"))))
1075: ; Only proceed if action is not nil
1076: (when action
1077: (let ((cmd (format "/dev/syd/default/mktemp:%s" action)))
1078: ; Call syd--stat with the command
1079: (syd--stat cmd)))))
1080:
1081: (defun syd-default-net (action)
1082: "Set default action for Network sandboxing.
1083: ACTION is a constant representing the sandboxing action."
1084: (let ((action (cond
1085: ((eq action :action-allow) "allow")
1086: ((eq action :action-warn) "warn")
1087: ((eq action :action-filter) "filter")
1088: ((eq action :action-deny) "deny")
1089: ((eq action :action-panic) "panic")
1090: ((eq action :action-stop) "stop")
1091: ((eq action :action-abort) "abort")
1092: ((eq action :action-kill) "kill")
1093: ((eq action :action-exit) "exit"))))
1094: ; Only proceed if action is not nil
1095: (when action
1096: (let ((cmd (format "/dev/syd/default/net:%s" action)))
1097: ; Call syd--net with the command
1098: (syd--stat cmd)))))
1099:
1100: ; TODO: syd-default-block!
1101:
1102: (defun syd-default-mem (action)
1103: "Set default action for Memory sandboxing.
1104: ACTION is a constant representing the sandboxing action."
1105: (let ((action (cond
1106: ((eq action :action-allow) "allow")
1107: ((eq action :action-warn) "warn")
1108: ((eq action :action-filter) "filter")
1109: ((eq action :action-deny) "deny")
1110: ((eq action :action-panic) "panic")
1111: ((eq action :action-stop) "stop")
1112: ((eq action :action-abort) "abort")
1113: ((eq action :action-kill) "kill")
1114: ((eq action :action-exit) "exit"))))
1115: ; Only proceed if action is not nil
1116: (when action
1117: (let ((cmd (format "/dev/syd/default/mem:%s" action)))
1118: ; Call syd--net with the command
1119: (syd--stat cmd)))))
1120:
1121: (defun syd-default-pid (action)
1122: "Set default action for PID sandboxing.
1123: ACTION is a constant representing the sandboxing action."
1124: (let ((action (cond
1125: ((eq action :action-allow) "allow")
1126: ((eq action :action-warn) "warn")
1127: ((eq action :action-filter) "filter")
1128: ((eq action :action-deny) "deny")
1129: ((eq action :action-panic) "panic")
1130: ((eq action :action-stop) "stop")
1131: ((eq action :action-abort) "abort")
1132: ((eq action :action-kill) "kill")
1133: ((eq action :action-exit) "exit"))))
1134: ; Only proceed if action is not nil
1135: (when action
1136: (let ((cmd (format "/dev/syd/default/pid:%s" action)))
1137: ; Call syd--net with the command
1138: (syd--stat cmd)))))
1139:
1140: (defun syd-default-force (action)
1141: "Set default action for Force sandboxing.
1142: ACTION is a constant representing the sandboxing action."
1143: (let ((action (cond
1144: ((eq action :action-allow) "allow")
1145: ((eq action :action-warn) "warn")
1146: ((eq action :action-filter) "filter")
1147: ((eq action :action-deny) "deny")
1148: ((eq action :action-panic) "panic")
1149: ((eq action :action-stop) "stop")
1150: ((eq action :action-abort) "abort")
1151: ((eq action :action-kill) "kill")
1152: ((eq action :action-exit) "exit"))))
1153: ; Only proceed if action is not nil
1154: (when action
1155: (let ((cmd (format "/dev/syd/default/force:%s" action)))
1156: ; Call syd--net with the command
1157: (syd--stat cmd)))))
1158:
1159: (defun syd-default-segvguard (action)
1160: "Set default action for SegvGuard.
1161: ACTION is a constant representing the sandboxing action."
1162: (let ((action (cond
1163: ((eq action :action-allow) "allow")
1164: ((eq action :action-warn) "warn")
1165: ((eq action :action-filter) "filter")
1166: ((eq action :action-deny) "deny")
1167: ((eq action :action-panic) "panic")
1168: ((eq action :action-stop) "stop")
1169: ((eq action :action-abort) "abort")
1170: ((eq action :action-kill) "kill")
1171: ((eq action :action-exit) "exit"))))
1172: ; Only proceed if action is not nil
1173: (when action
1174: (let ((cmd (format "/dev/syd/default/segvguard:%s" action)))
1175: ; Call syd--net with the command
1176: (syd--stat cmd)))))
1177:
1178: (defun syd-default-tpe (action)
1179: "Set default action for TPE sandboxing.
1180: ACTION is a constant representing the sandboxing action."
1181: (let ((action (cond
1182: ((eq action :action-allow) "allow")
1183: ((eq action :action-warn) "warn")
1184: ((eq action :action-filter) "filter")
1185: ((eq action :action-deny) "deny")
1186: ((eq action :action-panic) "panic")
1187: ((eq action :action-stop) "stop")
1188: ((eq action :action-abort) "abort")
1189: ((eq action :action-kill) "kill")
1190: ((eq action :action-exit) "exit"))))
1191: ; Only proceed if action is not nil
1192: (when action
1193: (let ((cmd (format "/dev/syd/default/tpe:%s" action)))
1194: ; Call syd--net with the command
1195: (syd--stat cmd)))))
1196:
1197: (defun syd-ioctl-deny (request)
1198: "Adds a request to the _ioctl_(2) denylist.
1199: REQUEST is the _ioctl_(2) request number to add to the denylist."
1200: (unless (numberp request)
1201: (error "Request must be a number"))
1202: (let ((path (format "/dev/syd/ioctl/deny+%d" request)))
1203: (syd--stat path)))
1204:
1205: (defun syd-fs-add (action glob)
1206: "Adds to the given actionlist of Filesystem sandboxing.
1207: ACTION is a constant representing the sandboxing action.
1208: GLOB is a string representing the glob pattern."
1209: (let ((action (cond
1210: ((eq action :action-allow) "allow")
1211: ((eq action :action-warn) "warn")
1212: ((eq action :action-filter) "filter")
1213: ((eq action :action-deny) "deny")
1214: ((eq action :action-panic) "panic")
1215: ((eq action :action-stop) "stop")
1216: ((eq action :action-abort) "abort")
1217: ((eq action :action-kill) "kill")
1218: ((eq action :action-exit) "exit"))))
1219: ; Only proceed if action is not nil
1220: (when action
1221: ; Create the command string
1222: (let ((cmd (format "%s/fs" action)))
1223: ; Call syd--stat with the command
1224: (syd--stat (syd--rule cmd glob ?+))))))
1225:
1226: (defun syd-fs-del (action glob)
1227: "Removes the first matching entry from the end of the given actionlist
1228: of Filesystem sandboxing.
1229: ACTION is a constant representing the sandboxing action.
1230: GLOB is a string representing the glob pattern."
1231: (let ((action (cond
1232: ((eq action :action-allow) "allow")
1233: ((eq action :action-warn) "warn")
1234: ((eq action :action-filter) "filter")
1235: ((eq action :action-deny) "deny")
1236: ((eq action :action-panic) "panic")
1237: ((eq action :action-stop) "stop")
1238: ((eq action :action-abort) "abort")
1239: ((eq action :action-kill) "kill")
1240: ((eq action :action-exit) "exit"))))
1241: ; Only proceed if action is not nil
1242: (when action
1243: ; Create the command string
1244: (let ((cmd (format "%s/fs" action)))
1245: ; Call syd--stat with the command
1246: (syd--stat (syd--rule cmd glob ?-))))))
1247:
1248: (defun syd-fs-rem (action glob)
1249: "Removes all matching entries from the given actionlist of Filesystem sandboxing.
1250: ACTION is a constant representing the sandboxing action.
1251: GLOB is a string representing the glob pattern."
1252: (let ((action (cond
1253: ((eq action :action-allow) "allow")
1254: ((eq action :action-warn) "warn")
1255: ((eq action :action-filter) "filter")
1256: ((eq action :action-deny) "deny")
1257: ((eq action :action-panic) "panic")
1258: ((eq action :action-stop) "stop")
1259: ((eq action :action-abort) "abort")
1260: ((eq action :action-kill) "kill")
1261: ((eq action :action-exit) "exit"))))
1262: ; Only proceed if action is not nil
1263: (when action
1264: ; Create the command string
1265: (let ((cmd (format "%s/fs" action)))
1266: ; Call syd--stat with the command
1267: (syd--stat (syd--rule cmd glob ?^))))))
1268:
1269: (defun syd-walk-add (action glob)
1270: "Adds to the given actionlist of walk sandboxing.
1271: ACTION is a constant representing the sandboxing action.
1272: GLOB is a string representing the glob pattern."
1273: (let ((action (cond
1274: ((eq action :action-allow) "allow")
1275: ((eq action :action-warn) "warn")
1276: ((eq action :action-filter) "filter")
1277: ((eq action :action-deny) "deny")
1278: ((eq action :action-panic) "panic")
1279: ((eq action :action-stop) "stop")
1280: ((eq action :action-abort) "abort")
1281: ((eq action :action-kill) "kill")
1282: ((eq action :action-exit) "exit"))))
1283: ; Only proceed if action is not nil
1284: (when action
1285: ; Create the command string
1286: (let ((cmd (format "%s/walk" action)))
1287: ; Call syd--stat with the command
1288: (syd--stat (syd--rule cmd glob ?+))))))
1289:
1290: (defun syd-walk-del (action glob)
1291: "Removes the first matching entry from the end of the given actionlist
1292: of walk sandboxing.
1293: ACTION is a constant representing the sandboxing action.
1294: GLOB is a string representing the glob pattern."
1295: (let ((action (cond
1296: ((eq action :action-allow) "allow")
1297: ((eq action :action-warn) "warn")
1298: ((eq action :action-filter) "filter")
1299: ((eq action :action-deny) "deny")
1300: ((eq action :action-panic) "panic")
1301: ((eq action :action-stop) "stop")
1302: ((eq action :action-abort) "abort")
1303: ((eq action :action-kill) "kill")
1304: ((eq action :action-exit) "exit"))))
1305: ; Only proceed if action is not nil
1306: (when action
1307: ; Create the command string
1308: (let ((cmd (format "%s/walk" action)))
1309: ; Call syd--stat with the command
1310: (syd--stat (syd--rule cmd glob ?-))))))
1311:
1312: (defun syd-walk-rem (action glob)
1313: "Removes all matching entries from the given actionlist of walk sandboxing.
1314: ACTION is a constant representing the sandboxing action.
1315: GLOB is a string representing the glob pattern."
1316: (let ((action (cond
1317: ((eq action :action-allow) "allow")
1318: ((eq action :action-warn) "warn")
1319: ((eq action :action-filter) "filter")
1320: ((eq action :action-deny) "deny")
1321: ((eq action :action-panic) "panic")
1322: ((eq action :action-stop) "stop")
1323: ((eq action :action-abort) "abort")
1324: ((eq action :action-kill) "kill")
1325: ((eq action :action-exit) "exit"))))
1326: ; Only proceed if action is not nil
1327: (when action
1328: ; Create the command string
1329: (let ((cmd (format "%s/walk" action)))
1330: ; Call syd--stat with the command
1331: (syd--stat (syd--rule cmd glob ?^))))))
1332:
1333: (defun syd-list-add (action glob)
1334: "Adds to the given actionlist of list sandboxing.
1335: ACTION is a constant representing the sandboxing action.
1336: GLOB is a string representing the glob pattern."
1337: (let ((action (cond
1338: ((eq action :action-allow) "allow")
1339: ((eq action :action-warn) "warn")
1340: ((eq action :action-filter) "filter")
1341: ((eq action :action-deny) "deny")
1342: ((eq action :action-panic) "panic")
1343: ((eq action :action-stop) "stop")
1344: ((eq action :action-abort) "abort")
1345: ((eq action :action-kill) "kill")
1346: ((eq action :action-exit) "exit"))))
1347: ; Only proceed if action is not nil
1348: (when action
1349: ; Create the command string
1350: (let ((cmd (format "%s/list" action)))
1351: ; Call syd--stat with the command
1352: (syd--stat (syd--rule cmd glob ?+))))))
1353:
1354: (defun syd-list-del (action glob)
1355: "Removes the first matching entry from the end of the given actionlist
1356: of list sandboxing.
1357: ACTION is a constant representing the sandboxing action.
1358: GLOB is a string representing the glob pattern."
1359: (let ((action (cond
1360: ((eq action :action-allow) "allow")
1361: ((eq action :action-warn) "warn")
1362: ((eq action :action-filter) "filter")
1363: ((eq action :action-deny) "deny")
1364: ((eq action :action-panic) "panic")
1365: ((eq action :action-stop) "stop")
1366: ((eq action :action-abort) "abort")
1367: ((eq action :action-kill) "kill")
1368: ((eq action :action-exit) "exit"))))
1369: ; Only proceed if action is not nil
1370: (when action
1371: ; Create the command string
1372: (let ((cmd (format "%s/list" action)))
1373: ; Call syd--stat with the command
1374: (syd--stat (syd--rule cmd glob ?-))))))
1375:
1376: (defun syd-list-rem (action glob)
1377: "Removes all matching entries from the given actionlist of list sandboxing.
1378: ACTION is a constant representing the sandboxing action.
1379: GLOB is a string representing the glob pattern."
1380: (let ((action (cond
1381: ((eq action :action-allow) "allow")
1382: ((eq action :action-warn) "warn")
1383: ((eq action :action-filter) "filter")
1384: ((eq action :action-deny) "deny")
1385: ((eq action :action-panic) "panic")
1386: ((eq action :action-stop) "stop")
1387: ((eq action :action-abort) "abort")
1388: ((eq action :action-kill) "kill")
1389: ((eq action :action-exit) "exit"))))
1390: ; Only proceed if action is not nil
1391: (when action
1392: ; Create the command string
1393: (let ((cmd (format "%s/list" action)))
1394: ; Call syd--stat with the command
1395: (syd--stat (syd--rule cmd glob ?^))))))
1396:
1397: (defun syd-stat-add (action glob)
1398: "Adds to the given actionlist of stat sandboxing.
1399: ACTION is a constant representing the sandboxing action.
1400: GLOB is a string representing the glob pattern."
1401: (let ((action (cond
1402: ((eq action :action-allow) "allow")
1403: ((eq action :action-warn) "warn")
1404: ((eq action :action-filter) "filter")
1405: ((eq action :action-deny) "deny")
1406: ((eq action :action-panic) "panic")
1407: ((eq action :action-stop) "stop")
1408: ((eq action :action-abort) "abort")
1409: ((eq action :action-kill) "kill")
1410: ((eq action :action-exit) "exit"))))
1411: ; Only proceed if action is not nil
1412: (when action
1413: ; Create the command string
1414: (let ((cmd (format "%s/stat" action)))
1415: ; Call syd--stat with the command
1416: (syd--stat (syd--rule cmd glob ?+))))))
1417:
1418: (defun syd-stat-del (action glob)
1419: "Removes the first matching entry from the end of the given actionlist
1420: of stat sandboxing.
1421: ACTION is a constant representing the sandboxing action.
1422: GLOB is a string representing the glob pattern."
1423: (let ((action (cond
1424: ((eq action :action-allow) "allow")
1425: ((eq action :action-warn) "warn")
1426: ((eq action :action-filter) "filter")
1427: ((eq action :action-deny) "deny")
1428: ((eq action :action-panic) "panic")
1429: ((eq action :action-stop) "stop")
1430: ((eq action :action-abort) "abort")
1431: ((eq action :action-kill) "kill")
1432: ((eq action :action-exit) "exit"))))
1433: ; Only proceed if action is not nil
1434: (when action
1435: ; Create the command string
1436: (let ((cmd (format "%s/stat" action)))
1437: ; Call syd--stat with the command
1438: (syd--stat (syd--rule cmd glob ?-))))))
1439:
1440: (defun syd-stat-rem (action glob)
1441: "Removes all matching entries from the given actionlist of stat sandboxing.
1442: ACTION is a constant representing the sandboxing action.
1443: GLOB is a string representing the glob pattern."
1444: (let ((action (cond
1445: ((eq action :action-allow) "allow")
1446: ((eq action :action-warn) "warn")
1447: ((eq action :action-filter) "filter")
1448: ((eq action :action-deny) "deny")
1449: ((eq action :action-panic) "panic")
1450: ((eq action :action-stop) "stop")
1451: ((eq action :action-abort) "abort")
1452: ((eq action :action-kill) "kill")
1453: ((eq action :action-exit) "exit"))))
1454: ; Only proceed if action is not nil
1455: (when action
1456: ; Create the command string
1457: (let ((cmd (format "%s/stat" action)))
1458: ; Call syd--stat with the command
1459: (syd--stat (syd--rule cmd glob ?^))))))
1460:
1461: (defun syd-read-add (action glob)
1462: "Adds to the given actionlist of read sandboxing.
1463: ACTION is a constant representing the sandboxing action.
1464: GLOB is a string representing the glob pattern."
1465: (let ((action (cond
1466: ((eq action :action-allow) "allow")
1467: ((eq action :action-warn) "warn")
1468: ((eq action :action-filter) "filter")
1469: ((eq action :action-deny) "deny")
1470: ((eq action :action-panic) "panic")
1471: ((eq action :action-stop) "stop")
1472: ((eq action :action-abort) "abort")
1473: ((eq action :action-kill) "kill")
1474: ((eq action :action-exit) "exit"))))
1475: ; Only proceed if action is not nil
1476: (when action
1477: ; Create the command string
1478: (let ((cmd (format "%s/read" action)))
1479: ; Call syd--stat with the command
1480: (syd--stat (syd--rule cmd glob ?+))))))
1481:
1482: (defun syd-read-del (action glob)
1483: "Removes the first matching entry from the end of the given actionlist
1484: of read sandboxing.
1485: ACTION is a constant representing the sandboxing action.
1486: GLOB is a string representing the glob pattern."
1487: (let ((action (cond
1488: ((eq action :action-allow) "allow")
1489: ((eq action :action-warn) "warn")
1490: ((eq action :action-filter) "filter")
1491: ((eq action :action-deny) "deny")
1492: ((eq action :action-panic) "panic")
1493: ((eq action :action-stop) "stop")
1494: ((eq action :action-abort) "abort")
1495: ((eq action :action-kill) "kill")
1496: ((eq action :action-exit) "exit"))))
1497: ; Only proceed if action is not nil
1498: (when action
1499: ; Create the command string
1500: (let ((cmd (format "%s/read" action)))
1501: ; Call syd--stat with the command
1502: (syd--stat (syd--rule cmd glob ?-))))))
1503:
1504: (defun syd-read-rem (action glob)
1505: "Removes all matching entries from the given actionlist of read sandboxing.
1506: ACTION is a constant representing the sandboxing action.
1507: GLOB is a string representing the glob pattern."
1508: (let ((action (cond
1509: ((eq action :action-allow) "allow")
1510: ((eq action :action-warn) "warn")
1511: ((eq action :action-filter) "filter")
1512: ((eq action :action-deny) "deny")
1513: ((eq action :action-panic) "panic")
1514: ((eq action :action-stop) "stop")
1515: ((eq action :action-abort) "abort")
1516: ((eq action :action-kill) "kill")
1517: ((eq action :action-exit) "exit"))))
1518: ; Only proceed if action is not nil
1519: (when action
1520: ; Create the command string
1521: (let ((cmd (format "%s/read" action)))
1522: ; Call syd--stat with the command
1523: (syd--stat (syd--rule cmd glob ?^))))))
1524:
1525: (defun syd-write-add (action glob)
1526: "Adds to the given actionlist of write sandboxing.
1527: ACTION is a constant representing the sandboxing action.
1528: GLOB is a string representing the glob pattern."
1529: (let ((action (cond
1530: ((eq action :action-allow) "allow")
1531: ((eq action :action-warn) "warn")
1532: ((eq action :action-filter) "filter")
1533: ((eq action :action-deny) "deny")
1534: ((eq action :action-panic) "panic")
1535: ((eq action :action-stop) "stop")
1536: ((eq action :action-abort) "abort")
1537: ((eq action :action-kill) "kill")
1538: ((eq action :action-exit) "exit"))))
1539: ; Only proceed if action is not nil
1540: (when action
1541: ; Create the command string
1542: (let ((cmd (format "%s/write" action)))
1543: ; Call syd--stat with the command
1544: (syd--stat (syd--rule cmd glob ?+))))))
1545:
1546: (defun syd-write-del (action glob)
1547: "Removes the first matching entry from the end of the given actionlist
1548: of write sandboxing.
1549: ACTION is a constant representing the sandboxing action.
1550: GLOB is a string representing the glob pattern."
1551: (let ((action (cond
1552: ((eq action :action-allow) "allow")
1553: ((eq action :action-warn) "warn")
1554: ((eq action :action-filter) "filter")
1555: ((eq action :action-deny) "deny")
1556: ((eq action :action-panic) "panic")
1557: ((eq action :action-stop) "stop")
1558: ((eq action :action-abort) "abort")
1559: ((eq action :action-kill) "kill")
1560: ((eq action :action-exit) "exit"))))
1561: ; Only proceed if action is not nil
1562: (when action
1563: ; Create the command string
1564: (let ((cmd (format "%s/write" action)))
1565: ; Call syd--stat with the command
1566: (syd--stat (syd--rule cmd glob ?-))))))
1567:
1568: (defun syd-write-rem (action glob)
1569: "Removes all matching entries from the given actionlist of write sandboxing.
1570: ACTION is a constant representing the sandboxing action.
1571: GLOB is a string representing the glob pattern."
1572: (let ((action (cond
1573: ((eq action :action-allow) "allow")
1574: ((eq action :action-warn) "warn")
1575: ((eq action :action-filter) "filter")
1576: ((eq action :action-deny) "deny")
1577: ((eq action :action-panic) "panic")
1578: ((eq action :action-stop) "stop")
1579: ((eq action :action-abort) "abort")
1580: ((eq action :action-kill) "kill")
1581: ((eq action :action-exit) "exit"))))
1582: ; Only proceed if action is not nil
1583: (when action
1584: ; Create the command string
1585: (let ((cmd (format "%s/write" action)))
1586: ; Call syd--stat with the command
1587: (syd--stat (syd--rule cmd glob ?^))))))
1588:
1589: (defun syd-exec-add (action glob)
1590: "Adds to the given actionlist of exec sandboxing.
1591: ACTION is a constant representing the sandboxing action.
1592: GLOB is a string representing the glob pattern."
1593: (let ((action (cond
1594: ((eq action :action-allow) "allow")
1595: ((eq action :action-warn) "warn")
1596: ((eq action :action-filter) "filter")
1597: ((eq action :action-deny) "deny")
1598: ((eq action :action-panic) "panic")
1599: ((eq action :action-stop) "stop")
1600: ((eq action :action-abort) "abort")
1601: ((eq action :action-kill) "kill")
1602: ((eq action :action-exit) "exit"))))
1603: ; Only proceed if action is not nil
1604: (when action
1605: ; Create the command string
1606: (let ((cmd (format "%s/exec" action)))
1607: ; Call syd--stat with the command
1608: (syd--stat (syd--rule cmd glob ?+))))))
1609:
1610: (defun syd-exec-del (action glob)
1611: "Removes the first matching entry from the end of the given actionlist
1612: of exec sandboxing.
1613: ACTION is a constant representing the sandboxing action.
1614: GLOB is a string representing the glob pattern."
1615: (let ((action (cond
1616: ((eq action :action-allow) "allow")
1617: ((eq action :action-warn) "warn")
1618: ((eq action :action-filter) "filter")
1619: ((eq action :action-deny) "deny")
1620: ((eq action :action-panic) "panic")
1621: ((eq action :action-stop) "stop")
1622: ((eq action :action-abort) "abort")
1623: ((eq action :action-kill) "kill")
1624: ((eq action :action-exit) "exit"))))
1625: ; Only proceed if action is not nil
1626: (when action
1627: ; Create the command string
1628: (let ((cmd (format "%s/exec" action)))
1629: ; Call syd--stat with the command
1630: (syd--stat (syd--rule cmd glob ?-))))))
1631:
1632: (defun syd-exec-rem (action glob)
1633: "Removes all matching entries from the given actionlist of exec sandboxing.
1634: ACTION is a constant representing the sandboxing action.
1635: GLOB is a string representing the glob pattern."
1636: (let ((action (cond
1637: ((eq action :action-allow) "allow")
1638: ((eq action :action-warn) "warn")
1639: ((eq action :action-filter) "filter")
1640: ((eq action :action-deny) "deny")
1641: ((eq action :action-panic) "panic")
1642: ((eq action :action-stop) "stop")
1643: ((eq action :action-abort) "abort")
1644: ((eq action :action-kill) "kill")
1645: ((eq action :action-exit) "exit"))))
1646: ; Only proceed if action is not nil
1647: (when action
1648: ; Create the command string
1649: (let ((cmd (format "%s/exec" action)))
1650: ; Call syd--stat with the command
1651: (syd--stat (syd--rule cmd glob ?^))))))
1652:
1653: (defun syd-ioctl-add (action glob)
1654: "Adds to the given actionlist of ioctl sandboxing.
1655: ACTION is a constant representing the sandboxing action.
1656: GLOB is a string representing the glob pattern."
1657: (let ((action (cond
1658: ((eq action :action-allow) "allow")
1659: ((eq action :action-warn) "warn")
1660: ((eq action :action-filter) "filter")
1661: ((eq action :action-deny) "deny")
1662: ((eq action :action-panic) "panic")
1663: ((eq action :action-stop) "stop")
1664: ((eq action :action-abort) "abort")
1665: ((eq action :action-kill) "kill")
1666: ((eq action :action-exit) "exit"))))
1667: ; Only proceed if action is not nil
1668: (when action
1669: ; Create the command string
1670: (let ((cmd (format "%s/ioctl" action)))
1671: ; Call syd--stat with the command
1672: (syd--stat (syd--rule cmd glob ?+))))))
1673:
1674: (defun syd-ioctl-del (action glob)
1675: "Removes the first matching entry from the end of the given actionlist
1676: of ioctl sandboxing.
1677: ACTION is a constant representing the sandboxing action.
1678: GLOB is a string representing the glob pattern."
1679: (let ((action (cond
1680: ((eq action :action-allow) "allow")
1681: ((eq action :action-warn) "warn")
1682: ((eq action :action-filter) "filter")
1683: ((eq action :action-deny) "deny")
1684: ((eq action :action-panic) "panic")
1685: ((eq action :action-stop) "stop")
1686: ((eq action :action-abort) "abort")
1687: ((eq action :action-kill) "kill")
1688: ((eq action :action-exit) "exit"))))
1689: ; Only proceed if action is not nil
1690: (when action
1691: ; Create the command string
1692: (let ((cmd (format "%s/ioctl" action)))
1693: ; Call syd--stat with the command
1694: (syd--stat (syd--rule cmd glob ?-))))))
1695:
1696: (defun syd-ioctl-rem (action glob)
1697: "Removes all matching entries from the given actionlist of ioctl sandboxing.
1698: ACTION is a constant representing the sandboxing action.
1699: GLOB is a string representing the glob pattern."
1700: (let ((action (cond
1701: ((eq action :action-allow) "allow")
1702: ((eq action :action-warn) "warn")
1703: ((eq action :action-filter) "filter")
1704: ((eq action :action-deny) "deny")
1705: ((eq action :action-panic) "panic")
1706: ((eq action :action-stop) "stop")
1707: ((eq action :action-abort) "abort")
1708: ((eq action :action-kill) "kill")
1709: ((eq action :action-exit) "exit"))))
1710: ; Only proceed if action is not nil
1711: (when action
1712: ; Create the command string
1713: (let ((cmd (format "%s/ioctl" action)))
1714: ; Call syd--stat with the command
1715: (syd--stat (syd--rule cmd glob ?^))))))
1716:
1717: (defun syd-create-add (action glob)
1718: "Adds to the given actionlist of create sandboxing.
1719: ACTION is a constant representing the sandboxing action.
1720: GLOB is a string representing the glob pattern."
1721: (let ((action (cond
1722: ((eq action :action-allow) "allow")
1723: ((eq action :action-warn) "warn")
1724: ((eq action :action-filter) "filter")
1725: ((eq action :action-deny) "deny")
1726: ((eq action :action-panic) "panic")
1727: ((eq action :action-stop) "stop")
1728: ((eq action :action-abort) "abort")
1729: ((eq action :action-kill) "kill")
1730: ((eq action :action-exit) "exit"))))
1731: ; Only proceed if action is not nil
1732: (when action
1733: ; Create the command string
1734: (let ((cmd (format "%s/create" action)))
1735: ; Call syd--stat with the command
1736: (syd--stat (syd--rule cmd glob ?+))))))
1737:
1738: (defun syd-create-del (action glob)
1739: "Removes the first matching entry from the end of the given actionlist
1740: of create sandboxing.
1741: ACTION is a constant representing the sandboxing action.
1742: GLOB is a string representing the glob pattern."
1743: (let ((action (cond
1744: ((eq action :action-allow) "allow")
1745: ((eq action :action-warn) "warn")
1746: ((eq action :action-filter) "filter")
1747: ((eq action :action-deny) "deny")
1748: ((eq action :action-panic) "panic")
1749: ((eq action :action-stop) "stop")
1750: ((eq action :action-abort) "abort")
1751: ((eq action :action-kill) "kill")
1752: ((eq action :action-exit) "exit"))))
1753: ; Only proceed if action is not nil
1754: (when action
1755: ; Create the command string
1756: (let ((cmd (format "%s/create" action)))
1757: ; Call syd--stat with the command
1758: (syd--stat (syd--rule cmd glob ?-))))))
1759:
1760: (defun syd-create-rem (action glob)
1761: "Removes all matching entries from the given actionlist of create sandboxing.
1762: ACTION is a constant representing the sandboxing action.
1763: GLOB is a string representing the glob pattern."
1764: (let ((action (cond
1765: ((eq action :action-allow) "allow")
1766: ((eq action :action-warn) "warn")
1767: ((eq action :action-filter) "filter")
1768: ((eq action :action-deny) "deny")
1769: ((eq action :action-panic) "panic")
1770: ((eq action :action-stop) "stop")
1771: ((eq action :action-abort) "abort")
1772: ((eq action :action-kill) "kill")
1773: ((eq action :action-exit) "exit"))))
1774: ; Only proceed if action is not nil
1775: (when action
1776: ; Create the command string
1777: (let ((cmd (format "%s/create" action)))
1778: ; Call syd--stat with the command
1779: (syd--stat (syd--rule cmd glob ?^))))))
1780:
1781: (defun syd-delete-add (action glob)
1782: "Adds to the given actionlist of delete sandboxing.
1783: ACTION is a constant representing the sandboxing action.
1784: GLOB is a string representing the glob pattern."
1785: (let ((action (cond
1786: ((eq action :action-allow) "allow")
1787: ((eq action :action-warn) "warn")
1788: ((eq action :action-filter) "filter")
1789: ((eq action :action-deny) "deny")
1790: ((eq action :action-panic) "panic")
1791: ((eq action :action-stop) "stop")
1792: ((eq action :action-abort) "abort")
1793: ((eq action :action-kill) "kill")
1794: ((eq action :action-exit) "exit"))))
1795: ; Only proceed if action is not nil
1796: (when action
1797: ; delete the command string
1798: (let ((cmd (format "%s/delete" action)))
1799: ; Call syd--stat with the command
1800: (syd--stat (syd--rule cmd glob ?+))))))
1801:
1802: (defun syd-delete-del (action glob)
1803: "Removes the first matching entry from the end of the given actionlist
1804: of delete sandboxing.
1805: ACTION is a constant representing the sandboxing action.
1806: GLOB is a string representing the glob pattern."
1807: (let ((action (cond
1808: ((eq action :action-allow) "allow")
1809: ((eq action :action-warn) "warn")
1810: ((eq action :action-filter) "filter")
1811: ((eq action :action-deny) "deny")
1812: ((eq action :action-panic) "panic")
1813: ((eq action :action-stop) "stop")
1814: ((eq action :action-abort) "abort")
1815: ((eq action :action-kill) "kill")
1816: ((eq action :action-exit) "exit"))))
1817: ; Only proceed if action is not nil
1818: (when action
1819: ; delete the command string
1820: (let ((cmd (format "%s/delete" action)))
1821: ; Call syd--stat with the command
1822: (syd--stat (syd--rule cmd glob ?-))))))
1823:
1824: (defun syd-delete-rem (action glob)
1825: "Removes all matching entries from the given actionlist of delete sandboxing.
1826: ACTION is a constant representing the sandboxing action.
1827: GLOB is a string representing the glob pattern."
1828: (let ((action (cond
1829: ((eq action :action-allow) "allow")
1830: ((eq action :action-warn) "warn")
1831: ((eq action :action-filter) "filter")
1832: ((eq action :action-deny) "deny")
1833: ((eq action :action-panic) "panic")
1834: ((eq action :action-stop) "stop")
1835: ((eq action :action-abort) "abort")
1836: ((eq action :action-kill) "kill")
1837: ((eq action :action-exit) "exit"))))
1838: ; Only proceed if action is not nil
1839: (when action
1840: ; delete the command string
1841: (let ((cmd (format "%s/delete" action)))
1842: ; Call syd--stat with the command
1843: (syd--stat (syd--rule cmd glob ?^))))))
1844:
1845: (defun syd-rename-add (action glob)
1846: "Adds to the given actionlist of rename sandboxing.
1847: ACTION is a constant representing the sandboxing action.
1848: GLOB is a string representing the glob pattern."
1849: (let ((action (cond
1850: ((eq action :action-allow) "allow")
1851: ((eq action :action-warn) "warn")
1852: ((eq action :action-filter) "filter")
1853: ((eq action :action-deny) "deny")
1854: ((eq action :action-panic) "panic")
1855: ((eq action :action-stop) "stop")
1856: ((eq action :action-abort) "abort")
1857: ((eq action :action-kill) "kill")
1858: ((eq action :action-exit) "exit"))))
1859: ; Only proceed if action is not nil
1860: (when action
1861: ; rename the command string
1862: (let ((cmd (format "%s/rename" action)))
1863: ; Call syd--stat with the command
1864: (syd--stat (syd--rule cmd glob ?+))))))
1865:
1866: (defun syd-rename-del (action glob)
1867: "Removes the first matching entry from the end of the given actionlist
1868: of rename sandboxing.
1869: ACTION is a constant representing the sandboxing action.
1870: GLOB is a string representing the glob pattern."
1871: (let ((action (cond
1872: ((eq action :action-allow) "allow")
1873: ((eq action :action-warn) "warn")
1874: ((eq action :action-filter) "filter")
1875: ((eq action :action-deny) "deny")
1876: ((eq action :action-panic) "panic")
1877: ((eq action :action-stop) "stop")
1878: ((eq action :action-abort) "abort")
1879: ((eq action :action-kill) "kill")
1880: ((eq action :action-exit) "exit"))))
1881: ; Only proceed if action is not nil
1882: (when action
1883: ; rename the command string
1884: (let ((cmd (format "%s/rename" action)))
1885: ; Call syd--stat with the command
1886: (syd--stat (syd--rule cmd glob ?-))))))
1887:
1888: (defun syd-rename-rem (action glob)
1889: "Removes all matching entries from the given actionlist of rename sandboxing.
1890: ACTION is a constant representing the sandboxing action.
1891: GLOB is a string representing the glob pattern."
1892: (let ((action (cond
1893: ((eq action :action-allow) "allow")
1894: ((eq action :action-warn) "warn")
1895: ((eq action :action-filter) "filter")
1896: ((eq action :action-deny) "deny")
1897: ((eq action :action-panic) "panic")
1898: ((eq action :action-stop) "stop")
1899: ((eq action :action-abort) "abort")
1900: ((eq action :action-kill) "kill")
1901: ((eq action :action-exit) "exit"))))
1902: ; Only proceed if action is not nil
1903: (when action
1904: ; rename the command string
1905: (let ((cmd (format "%s/rename" action)))
1906: ; Call syd--stat with the command
1907: (syd--stat (syd--rule cmd glob ?^))))))
1908:
1909: (defun syd-readlink-add (action glob)
1910: "Adds to the given actionlist of readlink sandboxing.
1911: ACTION is a constant representing the sandboxing action.
1912: GLOB is a string representing the glob pattern."
1913: (let ((action (cond
1914: ((eq action :action-allow) "allow")
1915: ((eq action :action-warn) "warn")
1916: ((eq action :action-filter) "filter")
1917: ((eq action :action-deny) "deny")
1918: ((eq action :action-panic) "panic")
1919: ((eq action :action-stop) "stop")
1920: ((eq action :action-abort) "abort")
1921: ((eq action :action-kill) "kill")
1922: ((eq action :action-exit) "exit"))))
1923: ; Only proceed if action is not nil
1924: (when action
1925: ; readlink the command string
1926: (let ((cmd (format "%s/readlink" action)))
1927: ; Call syd--stat with the command
1928: (syd--stat (syd--rule cmd glob ?+))))))
1929:
1930: (defun syd-readlink-del (action glob)
1931: "Removes the first matching entry from the end of the given actionlist
1932: of readlink sandboxing.
1933: ACTION is a constant representing the sandboxing action.
1934: GLOB is a string representing the glob pattern."
1935: (let ((action (cond
1936: ((eq action :action-allow) "allow")
1937: ((eq action :action-warn) "warn")
1938: ((eq action :action-filter) "filter")
1939: ((eq action :action-deny) "deny")
1940: ((eq action :action-panic) "panic")
1941: ((eq action :action-stop) "stop")
1942: ((eq action :action-abort) "abort")
1943: ((eq action :action-kill) "kill")
1944: ((eq action :action-exit) "exit"))))
1945: ; Only proceed if action is not nil
1946: (when action
1947: ; readlink the command string
1948: (let ((cmd (format "%s/readlink" action)))
1949: ; Call syd--stat with the command
1950: (syd--stat (syd--rule cmd glob ?-))))))
1951:
1952: (defun syd-readlink-rem (action glob)
1953: "Removes all matching entries from the given actionlist of readlink sandboxing.
1954: ACTION is a constant representing the sandboxing action.
1955: GLOB is a string representing the glob pattern."
1956: (let ((action (cond
1957: ((eq action :action-allow) "allow")
1958: ((eq action :action-warn) "warn")
1959: ((eq action :action-filter) "filter")
1960: ((eq action :action-deny) "deny")
1961: ((eq action :action-panic) "panic")
1962: ((eq action :action-stop) "stop")
1963: ((eq action :action-abort) "abort")
1964: ((eq action :action-kill) "kill")
1965: ((eq action :action-exit) "exit"))))
1966: ; Only proceed if action is not nil
1967: (when action
1968: ; readlink the command string
1969: (let ((cmd (format "%s/readlink" action)))
1970: ; Call syd--stat with the command
1971: (syd--stat (syd--rule cmd glob ?^))))))
1972:
1973: (defun syd-symlink-add (action glob)
1974: "Adds to the given actionlist of symlink sandboxing.
1975: ACTION is a constant representing the sandboxing action.
1976: GLOB is a string representing the glob pattern."
1977: (let ((action (cond
1978: ((eq action :action-allow) "allow")
1979: ((eq action :action-warn) "warn")
1980: ((eq action :action-filter) "filter")
1981: ((eq action :action-deny) "deny")
1982: ((eq action :action-panic) "panic")
1983: ((eq action :action-stop) "stop")
1984: ((eq action :action-abort) "abort")
1985: ((eq action :action-kill) "kill")
1986: ((eq action :action-exit) "exit"))))
1987: ; Only proceed if action is not nil
1988: (when action
1989: ; symlink the command string
1990: (let ((cmd (format "%s/symlink" action)))
1991: ; Call syd--stat with the command
1992: (syd--stat (syd--rule cmd glob ?+))))))
1993:
1994: (defun syd-symlink-del (action glob)
1995: "Removes the first matching entry from the end of the given actionlist
1996: of symlink sandboxing.
1997: ACTION is a constant representing the sandboxing action.
1998: GLOB is a string representing the glob pattern."
1999: (let ((action (cond
2000: ((eq action :action-allow) "allow")
2001: ((eq action :action-warn) "warn")
2002: ((eq action :action-filter) "filter")
2003: ((eq action :action-deny) "deny")
2004: ((eq action :action-panic) "panic")
2005: ((eq action :action-stop) "stop")
2006: ((eq action :action-abort) "abort")
2007: ((eq action :action-kill) "kill")
2008: ((eq action :action-exit) "exit"))))
2009: ; Only proceed if action is not nil
2010: (when action
2011: ; symlink the command string
2012: (let ((cmd (format "%s/symlink" action)))
2013: ; Call syd--stat with the command
2014: (syd--stat (syd--rule cmd glob ?-))))))
2015:
2016: (defun syd-symlink-rem (action glob)
2017: "Removes all matching entries from the given actionlist of symlink sandboxing.
2018: ACTION is a constant representing the sandboxing action.
2019: GLOB is a string representing the glob pattern."
2020: (let ((action (cond
2021: ((eq action :action-allow) "allow")
2022: ((eq action :action-warn) "warn")
2023: ((eq action :action-filter) "filter")
2024: ((eq action :action-deny) "deny")
2025: ((eq action :action-panic) "panic")
2026: ((eq action :action-stop) "stop")
2027: ((eq action :action-abort) "abort")
2028: ((eq action :action-kill) "kill")
2029: ((eq action :action-exit) "exit"))))
2030: ; Only proceed if action is not nil
2031: (when action
2032: ; symlink the command string
2033: (let ((cmd (format "%s/symlink" action)))
2034: ; Call syd--stat with the command
2035: (syd--stat (syd--rule cmd glob ?^))))))
2036:
2037: (defun syd-truncate-add (action glob)
2038: "Adds to the given actionlist of truncate sandboxing.
2039: ACTION is a constant representing the sandboxing action.
2040: GLOB is a string representing the glob pattern."
2041: (let ((action (cond
2042: ((eq action :action-allow) "allow")
2043: ((eq action :action-warn) "warn")
2044: ((eq action :action-filter) "filter")
2045: ((eq action :action-deny) "deny")
2046: ((eq action :action-panic) "panic")
2047: ((eq action :action-stop) "stop")
2048: ((eq action :action-abort) "abort")
2049: ((eq action :action-kill) "kill")
2050: ((eq action :action-exit) "exit"))))
2051: ; Only proceed if action is not nil
2052: (when action
2053: ; truncate the command string
2054: (let ((cmd (format "%s/truncate" action)))
2055: ; Call syd--stat with the command
2056: (syd--stat (syd--rule cmd glob ?+))))))
2057:
2058: (defun syd-truncate-del (action glob)
2059: "Removes the first matching entry from the end of the given actionlist
2060: of truncate sandboxing.
2061: ACTION is a constant representing the sandboxing action.
2062: GLOB is a string representing the glob pattern."
2063: (let ((action (cond
2064: ((eq action :action-allow) "allow")
2065: ((eq action :action-warn) "warn")
2066: ((eq action :action-filter) "filter")
2067: ((eq action :action-deny) "deny")
2068: ((eq action :action-panic) "panic")
2069: ((eq action :action-stop) "stop")
2070: ((eq action :action-abort) "abort")
2071: ((eq action :action-kill) "kill")
2072: ((eq action :action-exit) "exit"))))
2073: ; Only proceed if action is not nil
2074: (when action
2075: ; truncate the command string
2076: (let ((cmd (format "%s/truncate" action)))
2077: ; Call syd--stat with the command
2078: (syd--stat (syd--rule cmd glob ?-))))))
2079:
2080: (defun syd-truncate-rem (action glob)
2081: "Removes all matching entries from the given actionlist of truncate sandboxing.
2082: ACTION is a constant representing the sandboxing action.
2083: GLOB is a string representing the glob pattern."
2084: (let ((action (cond
2085: ((eq action :action-allow) "allow")
2086: ((eq action :action-warn) "warn")
2087: ((eq action :action-filter) "filter")
2088: ((eq action :action-deny) "deny")
2089: ((eq action :action-panic) "panic")
2090: ((eq action :action-stop) "stop")
2091: ((eq action :action-abort) "abort")
2092: ((eq action :action-kill) "kill")
2093: ((eq action :action-exit) "exit"))))
2094: ; Only proceed if action is not nil
2095: (when action
2096: ; truncate the command string
2097: (let ((cmd (format "%s/truncate" action)))
2098: ; Call syd--stat with the command
2099: (syd--stat (syd--rule cmd glob ?^))))))
2100:
2101: (defun syd-chdir-add (action glob)
2102: "Adds to the given actionlist of chdir sandboxing.
2103: ACTION is a constant representing the sandboxing action.
2104: GLOB is a string representing the glob pattern."
2105: (let ((action (cond
2106: ((eq action :action-allow) "allow")
2107: ((eq action :action-warn) "warn")
2108: ((eq action :action-filter) "filter")
2109: ((eq action :action-deny) "deny")
2110: ((eq action :action-panic) "panic")
2111: ((eq action :action-stop) "stop")
2112: ((eq action :action-abort) "abort")
2113: ((eq action :action-kill) "kill")
2114: ((eq action :action-exit) "exit"))))
2115: ; Only proceed if action is not nil
2116: (when action
2117: ; chdir the command string
2118: (let ((cmd (format "%s/chdir" action)))
2119: ; Call syd--stat with the command
2120: (syd--stat (syd--rule cmd glob ?+))))))
2121:
2122: (defun syd-chdir-del (action glob)
2123: "Removes the first matching entry from the end of the given actionlist
2124: of chdir sandboxing.
2125: ACTION is a constant representing the sandboxing action.
2126: GLOB is a string representing the glob pattern."
2127: (let ((action (cond
2128: ((eq action :action-allow) "allow")
2129: ((eq action :action-warn) "warn")
2130: ((eq action :action-filter) "filter")
2131: ((eq action :action-deny) "deny")
2132: ((eq action :action-panic) "panic")
2133: ((eq action :action-stop) "stop")
2134: ((eq action :action-abort) "abort")
2135: ((eq action :action-kill) "kill")
2136: ((eq action :action-exit) "exit"))))
2137: ; Only proceed if action is not nil
2138: (when action
2139: ; chdir the command string
2140: (let ((cmd (format "%s/chdir" action)))
2141: ; Call syd--stat with the command
2142: (syd--stat (syd--rule cmd glob ?-))))))
2143:
2144: (defun syd-chdir-rem (action glob)
2145: "Removes all matching entries from the given actionlist of chdir sandboxing.
2146: ACTION is a constant representing the sandboxing action.
2147: GLOB is a string representing the glob pattern."
2148: (let ((action (cond
2149: ((eq action :action-allow) "allow")
2150: ((eq action :action-warn) "warn")
2151: ((eq action :action-filter) "filter")
2152: ((eq action :action-deny) "deny")
2153: ((eq action :action-panic) "panic")
2154: ((eq action :action-stop) "stop")
2155: ((eq action :action-abort) "abort")
2156: ((eq action :action-kill) "kill")
2157: ((eq action :action-exit) "exit"))))
2158: ; Only proceed if action is not nil
2159: (when action
2160: ; chdir the command string
2161: (let ((cmd (format "%s/chdir" action)))
2162: ; Call syd--stat with the command
2163: (syd--stat (syd--rule cmd glob ?^))))))
2164:
2165: (defun syd-readdir-add (action glob)
2166: "Adds to the given actionlist of readdir sandboxing.
2167: ACTION is a constant representing the sandboxing action.
2168: GLOB is a string representing the glob pattern."
2169: (let ((action (cond
2170: ((eq action :action-allow) "allow")
2171: ((eq action :action-warn) "warn")
2172: ((eq action :action-filter) "filter")
2173: ((eq action :action-deny) "deny")
2174: ((eq action :action-panic) "panic")
2175: ((eq action :action-stop) "stop")
2176: ((eq action :action-abort) "abort")
2177: ((eq action :action-kill) "kill")
2178: ((eq action :action-exit) "exit"))))
2179: ; Only proceed if action is not nil
2180: (when action
2181: ; readdir the command string
2182: (let ((cmd (format "%s/readdir" action)))
2183: ; Call syd--stat with the command
2184: (syd--stat (syd--rule cmd glob ?+))))))
2185:
2186: (defun syd-readdir-del (action glob)
2187: "Removes the first matching entry from the end of the given actionlist
2188: of readdir sandboxing.
2189: ACTION is a constant representing the sandboxing action.
2190: GLOB is a string representing the glob pattern."
2191: (let ((action (cond
2192: ((eq action :action-allow) "allow")
2193: ((eq action :action-warn) "warn")
2194: ((eq action :action-filter) "filter")
2195: ((eq action :action-deny) "deny")
2196: ((eq action :action-panic) "panic")
2197: ((eq action :action-stop) "stop")
2198: ((eq action :action-abort) "abort")
2199: ((eq action :action-kill) "kill")
2200: ((eq action :action-exit) "exit"))))
2201: ; Only proceed if action is not nil
2202: (when action
2203: ; readdir the command string
2204: (let ((cmd (format "%s/readdir" action)))
2205: ; Call syd--stat with the command
2206: (syd--stat (syd--rule cmd glob ?-))))))
2207:
2208: (defun syd-readdir-rem (action glob)
2209: "Removes all matching entries from the given actionlist of readdir sandboxing.
2210: ACTION is a constant representing the sandboxing action.
2211: GLOB is a string representing the glob pattern."
2212: (let ((action (cond
2213: ((eq action :action-allow) "allow")
2214: ((eq action :action-warn) "warn")
2215: ((eq action :action-filter) "filter")
2216: ((eq action :action-deny) "deny")
2217: ((eq action :action-panic) "panic")
2218: ((eq action :action-stop) "stop")
2219: ((eq action :action-abort) "abort")
2220: ((eq action :action-kill) "kill")
2221: ((eq action :action-exit) "exit"))))
2222: ; Only proceed if action is not nil
2223: (when action
2224: ; readdir the command string
2225: (let ((cmd (format "%s/readdir" action)))
2226: ; Call syd--stat with the command
2227: (syd--stat (syd--rule cmd glob ?^))))))
2228:
2229: (defun syd-readdir-add (action glob)
2230: "Adds to the given actionlist of readdir sandboxing.
2231: ACTION is a constant representing the sandboxing action.
2232: GLOB is a string representing the glob pattern."
2233: (let ((action (cond
2234: ((eq action :action-allow) "allow")
2235: ((eq action :action-warn) "warn")
2236: ((eq action :action-filter) "filter")
2237: ((eq action :action-deny) "deny")
2238: ((eq action :action-panic) "panic")
2239: ((eq action :action-stop) "stop")
2240: ((eq action :action-abort) "abort")
2241: ((eq action :action-kill) "kill")
2242: ((eq action :action-exit) "exit"))))
2243: ; Only proceed if action is not nil
2244: (when action
2245: ; readdir the command string
2246: (let ((cmd (format "%s/readdir" action)))
2247: ; Call syd--stat with the command
2248: (syd--stat (syd--rule cmd glob ?+))))))
2249:
2250: (defun syd-readdir-del (action glob)
2251: "Removes the first matching entry from the end of the given actionlist
2252: of readdir sandboxing.
2253: ACTION is a constant representing the sandboxing action.
2254: GLOB is a string representing the glob pattern."
2255: (let ((action (cond
2256: ((eq action :action-allow) "allow")
2257: ((eq action :action-warn) "warn")
2258: ((eq action :action-filter) "filter")
2259: ((eq action :action-deny) "deny")
2260: ((eq action :action-panic) "panic")
2261: ((eq action :action-stop) "stop")
2262: ((eq action :action-abort) "abort")
2263: ((eq action :action-kill) "kill")
2264: ((eq action :action-exit) "exit"))))
2265: ; Only proceed if action is not nil
2266: (when action
2267: ; readdir the command string
2268: (let ((cmd (format "%s/readdir" action)))
2269: ; Call syd--stat with the command
2270: (syd--stat (syd--rule cmd glob ?-))))))
2271:
2272: (defun syd-readdir-rem (action glob)
2273: "Removes all matching entries from the given actionlist of readdir sandboxing.
2274: ACTION is a constant representing the sandboxing action.
2275: GLOB is a string representing the glob pattern."
2276: (let ((action (cond
2277: ((eq action :action-allow) "allow")
2278: ((eq action :action-warn) "warn")
2279: ((eq action :action-filter) "filter")
2280: ((eq action :action-deny) "deny")
2281: ((eq action :action-panic) "panic")
2282: ((eq action :action-stop) "stop")
2283: ((eq action :action-abort) "abort")
2284: ((eq action :action-kill) "kill")
2285: ((eq action :action-exit) "exit"))))
2286: ; Only proceed if action is not nil
2287: (when action
2288: ; readdir the command string
2289: (let ((cmd (format "%s/readdir" action)))
2290: ; Call syd--stat with the command
2291: (syd--stat (syd--rule cmd glob ?^))))))
2292:
2293: (defun syd-mkdir-add (action glob)
2294: "Adds to the given actionlist of mkdir sandboxing.
2295: ACTION is a constant representing the sandboxing action.
2296: GLOB is a string representing the glob pattern."
2297: (let ((action (cond
2298: ((eq action :action-allow) "allow")
2299: ((eq action :action-warn) "warn")
2300: ((eq action :action-filter) "filter")
2301: ((eq action :action-deny) "deny")
2302: ((eq action :action-panic) "panic")
2303: ((eq action :action-stop) "stop")
2304: ((eq action :action-abort) "abort")
2305: ((eq action :action-kill) "kill")
2306: ((eq action :action-exit) "exit"))))
2307: ; Only proceed if action is not nil
2308: (when action
2309: ; mkdir the command string
2310: (let ((cmd (format "%s/mkdir" action)))
2311: ; Call syd--stat with the command
2312: (syd--stat (syd--rule cmd glob ?+))))))
2313:
2314: (defun syd-mkdir-del (action glob)
2315: "Removes the first matching entry from the end of the given actionlist
2316: of mkdir sandboxing.
2317: ACTION is a constant representing the sandboxing action.
2318: GLOB is a string representing the glob pattern."
2319: (let ((action (cond
2320: ((eq action :action-allow) "allow")
2321: ((eq action :action-warn) "warn")
2322: ((eq action :action-filter) "filter")
2323: ((eq action :action-deny) "deny")
2324: ((eq action :action-panic) "panic")
2325: ((eq action :action-stop) "stop")
2326: ((eq action :action-abort) "abort")
2327: ((eq action :action-kill) "kill")
2328: ((eq action :action-exit) "exit"))))
2329: ; Only proceed if action is not nil
2330: (when action
2331: ; mkdir the command string
2332: (let ((cmd (format "%s/mkdir" action)))
2333: ; Call syd--stat with the command
2334: (syd--stat (syd--rule cmd glob ?-))))))
2335:
2336: (defun syd-mkdir-rem (action glob)
2337: "Removes all matching entries from the given actionlist of mkdir sandboxing.
2338: ACTION is a constant representing the sandboxing action.
2339: GLOB is a string representing the glob pattern."
2340: (let ((action (cond
2341: ((eq action :action-allow) "allow")
2342: ((eq action :action-warn) "warn")
2343: ((eq action :action-filter) "filter")
2344: ((eq action :action-deny) "deny")
2345: ((eq action :action-panic) "panic")
2346: ((eq action :action-stop) "stop")
2347: ((eq action :action-abort) "abort")
2348: ((eq action :action-kill) "kill")
2349: ((eq action :action-exit) "exit"))))
2350: ; Only proceed if action is not nil
2351: (when action
2352: ; mkdir the command string
2353: (let ((cmd (format "%s/mkdir" action)))
2354: ; Call syd--stat with the command
2355: (syd--stat (syd--rule cmd glob ?^))))))
2356:
2357: (defun syd-rmdir-add (action glob)
2358: "Adds to the given actionlist of rmdir sandboxing.
2359: ACTION is a constant representing the sandboxing action.
2360: GLOB is a string representing the glob pattern."
2361: (let ((action (cond
2362: ((eq action :action-allow) "allow")
2363: ((eq action :action-warn) "warn")
2364: ((eq action :action-filter) "filter")
2365: ((eq action :action-deny) "deny")
2366: ((eq action :action-panic) "panic")
2367: ((eq action :action-stop) "stop")
2368: ((eq action :action-abort) "abort")
2369: ((eq action :action-kill) "kill")
2370: ((eq action :action-exit) "exit"))))
2371: ; Only proceed if action is not nil
2372: (when action
2373: ; rmdir the command string
2374: (let ((cmd (format "%s/rmdir" action)))
2375: ; Call syd--stat with the command
2376: (syd--stat (syd--rule cmd glob ?+))))))
2377:
2378: (defun syd-rmdir-del (action glob)
2379: "Removes the first matching entry from the end of the given actionlist
2380: of rmdir sandboxing.
2381: ACTION is a constant representing the sandboxing action.
2382: GLOB is a string representing the glob pattern."
2383: (let ((action (cond
2384: ((eq action :action-allow) "allow")
2385: ((eq action :action-warn) "warn")
2386: ((eq action :action-filter) "filter")
2387: ((eq action :action-deny) "deny")
2388: ((eq action :action-panic) "panic")
2389: ((eq action :action-stop) "stop")
2390: ((eq action :action-abort) "abort")
2391: ((eq action :action-kill) "kill")
2392: ((eq action :action-exit) "exit"))))
2393: ; Only proceed if action is not nil
2394: (when action
2395: ; rmdir the command string
2396: (let ((cmd (format "%s/rmdir" action)))
2397: ; Call syd--stat with the command
2398: (syd--stat (syd--rule cmd glob ?-))))))
2399:
2400: (defun syd-rmdir-rem (action glob)
2401: "Removes all matching entries from the given actionlist of rmdir sandboxing.
2402: ACTION is a constant representing the sandboxing action.
2403: GLOB is a string representing the glob pattern."
2404: (let ((action (cond
2405: ((eq action :action-allow) "allow")
2406: ((eq action :action-warn) "warn")
2407: ((eq action :action-filter) "filter")
2408: ((eq action :action-deny) "deny")
2409: ((eq action :action-panic) "panic")
2410: ((eq action :action-stop) "stop")
2411: ((eq action :action-abort) "abort")
2412: ((eq action :action-kill) "kill")
2413: ((eq action :action-exit) "exit"))))
2414: ; Only proceed if action is not nil
2415: (when action
2416: ; rmdir the command string
2417: (let ((cmd (format "%s/rmdir" action)))
2418: ; Call syd--stat with the command
2419: (syd--stat (syd--rule cmd glob ?^))))))
2420:
2421: (defun syd-chown-add (action glob)
2422: "Adds to the given actionlist of chown sandboxing.
2423: ACTION is a constant representing the sandboxing action.
2424: GLOB is a string representing the glob pattern."
2425: (let ((action (cond
2426: ((eq action :action-allow) "allow")
2427: ((eq action :action-warn) "warn")
2428: ((eq action :action-filter) "filter")
2429: ((eq action :action-deny) "deny")
2430: ((eq action :action-panic) "panic")
2431: ((eq action :action-stop) "stop")
2432: ((eq action :action-abort) "abort")
2433: ((eq action :action-kill) "kill")
2434: ((eq action :action-exit) "exit"))))
2435: ; Only proceed if action is not nil
2436: (when action
2437: ; Create the command string
2438: (let ((cmd (format "%s/chown" action)))
2439: ; Call syd--stat with the command
2440: (syd--stat (syd--rule cmd glob ?+))))))
2441:
2442: (defun syd-chown-del (action glob)
2443: "Removes the first matching entry from the end of the given actionlist
2444: of chown sandboxing.
2445: ACTION is a constant representing the sandboxing action.
2446: GLOB is a string representing the glob pattern."
2447: (let ((action (cond
2448: ((eq action :action-allow) "allow")
2449: ((eq action :action-warn) "warn")
2450: ((eq action :action-filter) "filter")
2451: ((eq action :action-deny) "deny")
2452: ((eq action :action-panic) "panic")
2453: ((eq action :action-stop) "stop")
2454: ((eq action :action-abort) "abort")
2455: ((eq action :action-kill) "kill")
2456: ((eq action :action-exit) "exit"))))
2457: ; Only proceed if action is not nil
2458: (when action
2459: ; Create the command string
2460: (let ((cmd (format "%s/chown" action)))
2461: ; Call syd--stat with the command
2462: (syd--stat (syd--rule cmd glob ?-))))))
2463:
2464: (defun syd-chown-rem (action glob)
2465: "Removes all matching entries from the given actionlist of chown sandboxing.
2466: ACTION is a constant representing the sandboxing action.
2467: GLOB is a string representing the glob pattern."
2468: (let ((action (cond
2469: ((eq action :action-allow) "allow")
2470: ((eq action :action-warn) "warn")
2471: ((eq action :action-filter) "filter")
2472: ((eq action :action-deny) "deny")
2473: ((eq action :action-panic) "panic")
2474: ((eq action :action-stop) "stop")
2475: ((eq action :action-abort) "abort")
2476: ((eq action :action-kill) "kill")
2477: ((eq action :action-exit) "exit"))))
2478: ; Only proceed if action is not nil
2479: (when action
2480: ; Create the command string
2481: (let ((cmd (format "%s/chown" action)))
2482: ; Call syd--stat with the command
2483: (syd--stat (syd--rule cmd glob ?^))))))
2484:
2485: (defun syd-chgrp-add (action glob)
2486: "Adds to the given actionlist of chgrp sandboxing.
2487: ACTION is a constant representing the sandboxing action.
2488: GLOB is a string representing the glob pattern."
2489: (let ((action (cond
2490: ((eq action :action-allow) "allow")
2491: ((eq action :action-warn) "warn")
2492: ((eq action :action-filter) "filter")
2493: ((eq action :action-deny) "deny")
2494: ((eq action :action-panic) "panic")
2495: ((eq action :action-stop) "stop")
2496: ((eq action :action-abort) "abort")
2497: ((eq action :action-kill) "kill")
2498: ((eq action :action-exit) "exit"))))
2499: ; Only proceed if action is not nil
2500: (when action
2501: ; Create the command string
2502: (let ((cmd (format "%s/chgrp" action)))
2503: ; Call syd--stat with the command
2504: (syd--stat (syd--rule cmd glob ?+))))))
2505:
2506: (defun syd-chgrp-del (action glob)
2507: "Removes the first matching entry from the end of the given actionlist
2508: of chgrp sandboxing.
2509: ACTION is a constant representing the sandboxing action.
2510: GLOB is a string representing the glob pattern."
2511: (let ((action (cond
2512: ((eq action :action-allow) "allow")
2513: ((eq action :action-warn) "warn")
2514: ((eq action :action-filter) "filter")
2515: ((eq action :action-deny) "deny")
2516: ((eq action :action-panic) "panic")
2517: ((eq action :action-stop) "stop")
2518: ((eq action :action-abort) "abort")
2519: ((eq action :action-kill) "kill")
2520: ((eq action :action-exit) "exit"))))
2521: ; Only proceed if action is not nil
2522: (when action
2523: ; Create the command string
2524: (let ((cmd (format "%s/chgrp" action)))
2525: ; Call syd--stat with the command
2526: (syd--stat (syd--rule cmd glob ?-))))))
2527:
2528: (defun syd-chgrp-rem (action glob)
2529: "Removes all matching entries from the given actionlist of chgrp sandboxing.
2530: ACTION is a constant representing the sandboxing action.
2531: GLOB is a string representing the glob pattern."
2532: (let ((action (cond
2533: ((eq action :action-allow) "allow")
2534: ((eq action :action-warn) "warn")
2535: ((eq action :action-filter) "filter")
2536: ((eq action :action-deny) "deny")
2537: ((eq action :action-panic) "panic")
2538: ((eq action :action-stop) "stop")
2539: ((eq action :action-abort) "abort")
2540: ((eq action :action-kill) "kill")
2541: ((eq action :action-exit) "exit"))))
2542: ; Only proceed if action is not nil
2543: (when action
2544: ; Create the command string
2545: (let ((cmd (format "%s/chgrp" action)))
2546: ; Call syd--stat with the command
2547: (syd--stat (syd--rule cmd glob ?^))))))
2548:
2549: (defun syd-chmod-add (action glob)
2550: "Adds to the given actionlist of chmod sandboxing.
2551: ACTION is a constant representing the sandboxing action.
2552: GLOB is a string representing the glob pattern."
2553: (let ((action (cond
2554: ((eq action :action-allow) "allow")
2555: ((eq action :action-warn) "warn")
2556: ((eq action :action-filter) "filter")
2557: ((eq action :action-deny) "deny")
2558: ((eq action :action-panic) "panic")
2559: ((eq action :action-stop) "stop")
2560: ((eq action :action-abort) "abort")
2561: ((eq action :action-kill) "kill")
2562: ((eq action :action-exit) "exit"))))
2563: ; Only proceed if action is not nil
2564: (when action
2565: ; Create the command string
2566: (let ((cmd (format "%s/chmod" action)))
2567: ; Call syd--stat with the command
2568: (syd--stat (syd--rule cmd glob ?+))))))
2569:
2570: (defun syd-chmod-del (action glob)
2571: "Removes the first matching entry from the end of the given actionlist
2572: of chmod sandboxing.
2573: ACTION is a constant representing the sandboxing action.
2574: GLOB is a string representing the glob pattern."
2575: (let ((action (cond
2576: ((eq action :action-allow) "allow")
2577: ((eq action :action-warn) "warn")
2578: ((eq action :action-filter) "filter")
2579: ((eq action :action-deny) "deny")
2580: ((eq action :action-panic) "panic")
2581: ((eq action :action-stop) "stop")
2582: ((eq action :action-abort) "abort")
2583: ((eq action :action-kill) "kill")
2584: ((eq action :action-exit) "exit"))))
2585: ; Only proceed if action is not nil
2586: (when action
2587: ; Create the command string
2588: (let ((cmd (format "%s/chmod" action)))
2589: ; Call syd--stat with the command
2590: (syd--stat (syd--rule cmd glob ?-))))))
2591:
2592: (defun syd-chmod-rem (action glob)
2593: "Removes all matching entries from the given actionlist of chmod sandboxing.
2594: ACTION is a constant representing the sandboxing action.
2595: GLOB is a string representing the glob pattern."
2596: (let ((action (cond
2597: ((eq action :action-allow) "allow")
2598: ((eq action :action-warn) "warn")
2599: ((eq action :action-filter) "filter")
2600: ((eq action :action-deny) "deny")
2601: ((eq action :action-panic) "panic")
2602: ((eq action :action-stop) "stop")
2603: ((eq action :action-abort) "abort")
2604: ((eq action :action-kill) "kill")
2605: ((eq action :action-exit) "exit"))))
2606: ; Only proceed if action is not nil
2607: (when action
2608: ; Create the command string
2609: (let ((cmd (format "%s/chmod" action)))
2610: ; Call syd--stat with the command
2611: (syd--stat (syd--rule cmd glob ?^))))))
2612:
2613: (defun syd-chattr-add (action glob)
2614: "Adds to the given actionlist of chattr sandboxing.
2615: ACTION is a constant representing the sandboxing action.
2616: GLOB is a string representing the glob pattern."
2617: (let ((action (cond
2618: ((eq action :action-allow) "allow")
2619: ((eq action :action-warn) "warn")
2620: ((eq action :action-filter) "filter")
2621: ((eq action :action-deny) "deny")
2622: ((eq action :action-panic) "panic")
2623: ((eq action :action-stop) "stop")
2624: ((eq action :action-abort) "abort")
2625: ((eq action :action-kill) "kill")
2626: ((eq action :action-exit) "exit"))))
2627: ; Only proceed if action is not nil
2628: (when action
2629: ; Create the command string
2630: (let ((cmd (format "%s/chattr" action)))
2631: ; Call syd--stat with the command
2632: (syd--stat (syd--rule cmd glob ?+))))))
2633:
2634: (defun syd-chattr-del (action glob)
2635: "Removes the first matching entry from the end of the given actionlist
2636: of chattr sandboxing.
2637: ACTION is a constant representing the sandboxing action.
2638: GLOB is a string representing the glob pattern."
2639: (let ((action (cond
2640: ((eq action :action-allow) "allow")
2641: ((eq action :action-warn) "warn")
2642: ((eq action :action-filter) "filter")
2643: ((eq action :action-deny) "deny")
2644: ((eq action :action-panic) "panic")
2645: ((eq action :action-stop) "stop")
2646: ((eq action :action-abort) "abort")
2647: ((eq action :action-kill) "kill")
2648: ((eq action :action-exit) "exit"))))
2649: ; Only proceed if action is not nil
2650: (when action
2651: ; Create the command string
2652: (let ((cmd (format "%s/chattr" action)))
2653: ; Call syd--stat with the command
2654: (syd--stat (syd--rule cmd glob ?-))))))
2655:
2656: (defun syd-chattr-rem (action glob)
2657: "Removes all matching entries from the given actionlist of chattr sandboxing.
2658: ACTION is a constant representing the sandboxing action.
2659: GLOB is a string representing the glob pattern."
2660: (let ((action (cond
2661: ((eq action :action-allow) "allow")
2662: ((eq action :action-warn) "warn")
2663: ((eq action :action-filter) "filter")
2664: ((eq action :action-deny) "deny")
2665: ((eq action :action-panic) "panic")
2666: ((eq action :action-stop) "stop")
2667: ((eq action :action-abort) "abort")
2668: ((eq action :action-kill) "kill")
2669: ((eq action :action-exit) "exit"))))
2670: ; Only proceed if action is not nil
2671: (when action
2672: ; Create the command string
2673: (let ((cmd (format "%s/chattr" action)))
2674: ; Call syd--stat with the command
2675: (syd--stat (syd--rule cmd glob ?^))))))
2676:
2677: (defun syd-chroot-add (action glob)
2678: "Adds to the given actionlist of chroot sandboxing.
2679: ACTION is a constant representing the sandboxing action.
2680: GLOB is a string representing the glob pattern."
2681: (let ((action (cond
2682: ((eq action :action-allow) "allow")
2683: ((eq action :action-warn) "warn")
2684: ((eq action :action-filter) "filter")
2685: ((eq action :action-deny) "deny")
2686: ((eq action :action-panic) "panic")
2687: ((eq action :action-stop) "stop")
2688: ((eq action :action-abort) "abort")
2689: ((eq action :action-kill) "kill")
2690: ((eq action :action-exit) "exit"))))
2691: ; Only proceed if action is not nil
2692: (when action
2693: ; Create the command string
2694: (let ((cmd (format "%s/chroot" action)))
2695: ; Call syd--stat with the command
2696: (syd--stat (syd--rule cmd glob ?+))))))
2697:
2698: (defun syd-chroot-del (action glob)
2699: "Removes the first matching entry from the end of the given actionlist
2700: of chroot sandboxing.
2701: ACTION is a constant representing the sandboxing action.
2702: GLOB is a string representing the glob pattern."
2703: (let ((action (cond
2704: ((eq action :action-allow) "allow")
2705: ((eq action :action-warn) "warn")
2706: ((eq action :action-filter) "filter")
2707: ((eq action :action-deny) "deny")
2708: ((eq action :action-panic) "panic")
2709: ((eq action :action-stop) "stop")
2710: ((eq action :action-abort) "abort")
2711: ((eq action :action-kill) "kill")
2712: ((eq action :action-exit) "exit"))))
2713: ; Only proceed if action is not nil
2714: (when action
2715: ; Create the command string
2716: (let ((cmd (format "%s/chroot" action)))
2717: ; Call syd--stat with the command
2718: (syd--stat (syd--rule cmd glob ?-))))))
2719:
2720: (defun syd-chroot-rem (action glob)
2721: "Removes all matching entries from the given actionlist of chroot sandboxing.
2722: ACTION is a constant representing the sandboxing action.
2723: GLOB is a string representing the glob pattern."
2724: (let ((action (cond
2725: ((eq action :action-allow) "allow")
2726: ((eq action :action-warn) "warn")
2727: ((eq action :action-filter) "filter")
2728: ((eq action :action-deny) "deny")
2729: ((eq action :action-panic) "panic")
2730: ((eq action :action-stop) "stop")
2731: ((eq action :action-abort) "abort")
2732: ((eq action :action-kill) "kill")
2733: ((eq action :action-exit) "exit"))))
2734: ; Only proceed if action is not nil
2735: (when action
2736: ; Create the command string
2737: (let ((cmd (format "%s/chroot" action)))
2738: ; Call syd--stat with the command
2739: (syd--stat (syd--rule cmd glob ?^))))))
2740:
2741: (defun syd-notify-add (action glob)
2742: "Adds to the given actionlist of notify sandboxing.
2743: ACTION is a constant representing the sandboxing action.
2744: GLOB is a string representing the glob pattern."
2745: (let ((action (cond
2746: ((eq action :action-allow) "allow")
2747: ((eq action :action-warn) "warn")
2748: ((eq action :action-filter) "filter")
2749: ((eq action :action-deny) "deny")
2750: ((eq action :action-panic) "panic")
2751: ((eq action :action-stop) "stop")
2752: ((eq action :action-abort) "abort")
2753: ((eq action :action-kill) "kill")
2754: ((eq action :action-exit) "exit"))))
2755: ; Only proceed if action is not nil
2756: (when action
2757: ; Create the command string
2758: (let ((cmd (format "%s/notify" action)))
2759: ; Call syd--stat with the command
2760: (syd--stat (syd--rule cmd glob ?+))))))
2761:
2762: (defun syd-notify-del (action glob)
2763: "Removes the first matching entry from the end of the given actionlist
2764: of notify sandboxing.
2765: ACTION is a constant representing the sandboxing action.
2766: GLOB is a string representing the glob pattern."
2767: (let ((action (cond
2768: ((eq action :action-allow) "allow")
2769: ((eq action :action-warn) "warn")
2770: ((eq action :action-filter) "filter")
2771: ((eq action :action-deny) "deny")
2772: ((eq action :action-panic) "panic")
2773: ((eq action :action-stop) "stop")
2774: ((eq action :action-abort) "abort")
2775: ((eq action :action-kill) "kill")
2776: ((eq action :action-exit) "exit"))))
2777: ; Only proceed if action is not nil
2778: (when action
2779: ; Create the command string
2780: (let ((cmd (format "%s/notify" action)))
2781: ; Call syd--stat with the command
2782: (syd--stat (syd--rule cmd glob ?-))))))
2783:
2784: (defun syd-notify-rem (action glob)
2785: "Removes all matching entries from the given actionlist of notify sandboxing.
2786: ACTION is a constant representing the sandboxing action.
2787: GLOB is a string representing the glob pattern."
2788: (let ((action (cond
2789: ((eq action :action-allow) "allow")
2790: ((eq action :action-warn) "warn")
2791: ((eq action :action-filter) "filter")
2792: ((eq action :action-deny) "deny")
2793: ((eq action :action-panic) "panic")
2794: ((eq action :action-stop) "stop")
2795: ((eq action :action-abort) "abort")
2796: ((eq action :action-kill) "kill")
2797: ((eq action :action-exit) "exit"))))
2798: ; Only proceed if action is not nil
2799: (when action
2800: ; Create the command string
2801: (let ((cmd (format "%s/notify" action)))
2802: ; Call syd--stat with the command
2803: (syd--stat (syd--rule cmd glob ?^))))))
2804:
2805: (defun syd-utime-add (action glob)
2806: "Adds to the given actionlist of utime sandboxing.
2807: ACTION is a constant representing the sandboxing action.
2808: GLOB is a string representing the glob pattern."
2809: (let ((action (cond
2810: ((eq action :action-allow) "allow")
2811: ((eq action :action-warn) "warn")
2812: ((eq action :action-filter) "filter")
2813: ((eq action :action-deny) "deny")
2814: ((eq action :action-panic) "panic")
2815: ((eq action :action-stop) "stop")
2816: ((eq action :action-abort) "abort")
2817: ((eq action :action-kill) "kill")
2818: ((eq action :action-exit) "exit"))))
2819: ; Only proceed if action is not nil
2820: (when action
2821: ; Create the command string
2822: (let ((cmd (format "%s/utime" action)))
2823: ; Call syd--stat with the command
2824: (syd--stat (syd--rule cmd glob ?+))))))
2825:
2826: (defun syd-utime-del (action glob)
2827: "Removes the first matching entry from the end of the given actionlist
2828: of utime sandboxing.
2829: ACTION is a constant representing the sandboxing action.
2830: GLOB is a string representing the glob pattern."
2831: (let ((action (cond
2832: ((eq action :action-allow) "allow")
2833: ((eq action :action-warn) "warn")
2834: ((eq action :action-filter) "filter")
2835: ((eq action :action-deny) "deny")
2836: ((eq action :action-panic) "panic")
2837: ((eq action :action-stop) "stop")
2838: ((eq action :action-abort) "abort")
2839: ((eq action :action-kill) "kill")
2840: ((eq action :action-exit) "exit"))))
2841: ; Only proceed if action is not nil
2842: (when action
2843: ; Create the command string
2844: (let ((cmd (format "%s/utime" action)))
2845: ; Call syd--stat with the command
2846: (syd--stat (syd--rule cmd glob ?-))))))
2847:
2848: (defun syd-utime-rem (action glob)
2849: "Removes all matching entries from the given actionlist of utime sandboxing.
2850: ACTION is a constant representing the sandboxing action.
2851: GLOB is a string representing the glob pattern."
2852: (let ((action (cond
2853: ((eq action :action-allow) "allow")
2854: ((eq action :action-warn) "warn")
2855: ((eq action :action-filter) "filter")
2856: ((eq action :action-deny) "deny")
2857: ((eq action :action-panic) "panic")
2858: ((eq action :action-stop) "stop")
2859: ((eq action :action-abort) "abort")
2860: ((eq action :action-kill) "kill")
2861: ((eq action :action-exit) "exit"))))
2862: ; Only proceed if action is not nil
2863: (when action
2864: ; Create the command string
2865: (let ((cmd (format "%s/utime" action)))
2866: ; Call syd--stat with the command
2867: (syd--stat (syd--rule cmd glob ?^))))))
2868:
2869: (defun syd-mkbdev-add (action glob)
2870: "Adds to the given actionlist of mkbdev sandboxing.
2871: ACTION is a constant representing the sandboxing action.
2872: GLOB is a string representing the glob pattern."
2873: (let ((action (cond
2874: ((eq action :action-allow) "allow")
2875: ((eq action :action-warn) "warn")
2876: ((eq action :action-filter) "filter")
2877: ((eq action :action-deny) "deny")
2878: ((eq action :action-panic) "panic")
2879: ((eq action :action-stop) "stop")
2880: ((eq action :action-abort) "abort")
2881: ((eq action :action-kill) "kill")
2882: ((eq action :action-exit) "exit"))))
2883: ; Only proceed if action is not nil
2884: (when action
2885: ; Create the command string
2886: (let ((cmd (format "%s/mkbdev" action)))
2887: ; Call syd--stat with the command
2888: (syd--stat (syd--rule cmd glob ?+))))))
2889:
2890: (defun syd-mkbdev-del (action glob)
2891: "Removes the first matching entry from the end of the given actionlist
2892: of mkbdev sandboxing.
2893: ACTION is a constant representing the sandboxing action.
2894: GLOB is a string representing the glob pattern."
2895: (let ((action (cond
2896: ((eq action :action-allow) "allow")
2897: ((eq action :action-warn) "warn")
2898: ((eq action :action-filter) "filter")
2899: ((eq action :action-deny) "deny")
2900: ((eq action :action-panic) "panic")
2901: ((eq action :action-stop) "stop")
2902: ((eq action :action-abort) "abort")
2903: ((eq action :action-kill) "kill")
2904: ((eq action :action-exit) "exit"))))
2905: ; Only proceed if action is not nil
2906: (when action
2907: ; Create the command string
2908: (let ((cmd (format "%s/mkbdev" action)))
2909: ; Call syd--stat with the command
2910: (syd--stat (syd--rule cmd glob ?-))))))
2911:
2912: (defun syd-mkbdev-rem (action glob)
2913: "Removes all matching entries from the given actionlist of mkbdev sandboxing.
2914: ACTION is a constant representing the sandboxing action.
2915: GLOB is a string representing the glob pattern."
2916: (let ((action (cond
2917: ((eq action :action-allow) "allow")
2918: ((eq action :action-warn) "warn")
2919: ((eq action :action-filter) "filter")
2920: ((eq action :action-deny) "deny")
2921: ((eq action :action-panic) "panic")
2922: ((eq action :action-stop) "stop")
2923: ((eq action :action-abort) "abort")
2924: ((eq action :action-kill) "kill")
2925: ((eq action :action-exit) "exit"))))
2926: ; Only proceed if action is not nil
2927: (when action
2928: ; Create the command string
2929: (let ((cmd (format "%s/mkbdev" action)))
2930: ; Call syd--stat with the command
2931: (syd--stat (syd--rule cmd glob ?^))))))
2932:
2933: (defun syd-mkcdev-add (action glob)
2934: "Adds to the given actionlist of mkcdev sandboxing.
2935: ACTION is a constant representing the sandboxing action.
2936: GLOB is a string representing the glob pattern."
2937: (let ((action (cond
2938: ((eq action :action-allow) "allow")
2939: ((eq action :action-warn) "warn")
2940: ((eq action :action-filter) "filter")
2941: ((eq action :action-deny) "deny")
2942: ((eq action :action-panic) "panic")
2943: ((eq action :action-stop) "stop")
2944: ((eq action :action-abort) "abort")
2945: ((eq action :action-kill) "kill")
2946: ((eq action :action-exit) "exit"))))
2947: ; Only proceed if action is not nil
2948: (when action
2949: ; Create the command string
2950: (let ((cmd (format "%s/mkcdev" action)))
2951: ; Call syd--stat with the command
2952: (syd--stat (syd--rule cmd glob ?+))))))
2953:
2954: (defun syd-mkcdev-del (action glob)
2955: "Removes the first matching entry from the end of the given actionlist
2956: of mkcdev sandboxing.
2957: ACTION is a constant representing the sandboxing action.
2958: GLOB is a string representing the glob pattern."
2959: (let ((action (cond
2960: ((eq action :action-allow) "allow")
2961: ((eq action :action-warn) "warn")
2962: ((eq action :action-filter) "filter")
2963: ((eq action :action-deny) "deny")
2964: ((eq action :action-panic) "panic")
2965: ((eq action :action-stop) "stop")
2966: ((eq action :action-abort) "abort")
2967: ((eq action :action-kill) "kill")
2968: ((eq action :action-exit) "exit"))))
2969: ; Only proceed if action is not nil
2970: (when action
2971: ; Create the command string
2972: (let ((cmd (format "%s/mkcdev" action)))
2973: ; Call syd--stat with the command
2974: (syd--stat (syd--rule cmd glob ?-))))))
2975:
2976: (defun syd-mkcdev-rem (action glob)
2977: "Removes all matching entries from the given actionlist of mkcdev sandboxing.
2978: ACTION is a constant representing the sandboxing action.
2979: GLOB is a string representing the glob pattern."
2980: (let ((action (cond
2981: ((eq action :action-allow) "allow")
2982: ((eq action :action-warn) "warn")
2983: ((eq action :action-filter) "filter")
2984: ((eq action :action-deny) "deny")
2985: ((eq action :action-panic) "panic")
2986: ((eq action :action-stop) "stop")
2987: ((eq action :action-abort) "abort")
2988: ((eq action :action-kill) "kill")
2989: ((eq action :action-exit) "exit"))))
2990: ; Only proceed if action is not nil
2991: (when action
2992: ; Create the command string
2993: (let ((cmd (format "%s/mkcdev" action)))
2994: ; Call syd--stat with the command
2995: (syd--stat (syd--rule cmd glob ?^))))))
2996:
2997: (defun syd-mkfifo-add (action glob)
2998: "Adds to the given actionlist of mkfifo sandboxing.
2999: ACTION is a constant representing the sandboxing action.
3000: GLOB is a string representing the glob pattern."
3001: (let ((action (cond
3002: ((eq action :action-allow) "allow")
3003: ((eq action :action-warn) "warn")
3004: ((eq action :action-filter) "filter")
3005: ((eq action :action-deny) "deny")
3006: ((eq action :action-panic) "panic")
3007: ((eq action :action-stop) "stop")
3008: ((eq action :action-abort) "abort")
3009: ((eq action :action-kill) "kill")
3010: ((eq action :action-exit) "exit"))))
3011: ; Only proceed if action is not nil
3012: (when action
3013: ; Create the command string
3014: (let ((cmd (format "%s/mkfifo" action)))
3015: ; Call syd--stat with the command
3016: (syd--stat (syd--rule cmd glob ?+))))))
3017:
3018: (defun syd-mkfifo-del (action glob)
3019: "Removes the first matching entry from the end of the given actionlist
3020: of mkfifo sandboxing.
3021: ACTION is a constant representing the sandboxing action.
3022: GLOB is a string representing the glob pattern."
3023: (let ((action (cond
3024: ((eq action :action-allow) "allow")
3025: ((eq action :action-warn) "warn")
3026: ((eq action :action-filter) "filter")
3027: ((eq action :action-deny) "deny")
3028: ((eq action :action-panic) "panic")
3029: ((eq action :action-stop) "stop")
3030: ((eq action :action-abort) "abort")
3031: ((eq action :action-kill) "kill")
3032: ((eq action :action-exit) "exit"))))
3033: ; Only proceed if action is not nil
3034: (when action
3035: ; Create the command string
3036: (let ((cmd (format "%s/mkfifo" action)))
3037: ; Call syd--stat with the command
3038: (syd--stat (syd--rule cmd glob ?-))))))
3039:
3040: (defun syd-mkfifo-rem (action glob)
3041: "Removes all matching entries from the given actionlist of mkfifo sandboxing.
3042: ACTION is a constant representing the sandboxing action.
3043: GLOB is a string representing the glob pattern."
3044: (let ((action (cond
3045: ((eq action :action-allow) "allow")
3046: ((eq action :action-warn) "warn")
3047: ((eq action :action-filter) "filter")
3048: ((eq action :action-deny) "deny")
3049: ((eq action :action-panic) "panic")
3050: ((eq action :action-stop) "stop")
3051: ((eq action :action-abort) "abort")
3052: ((eq action :action-kill) "kill")
3053: ((eq action :action-exit) "exit"))))
3054: ; Only proceed if action is not nil
3055: (when action
3056: ; Create the command string
3057: (let ((cmd (format "%s/mkfifo" action)))
3058: ; Call syd--stat with the command
3059: (syd--stat (syd--rule cmd glob ?^))))))
3060:
3061: (defun syd-mktemp-add (action glob)
3062: "Adds to the given actionlist of mktemp sandboxing.
3063: ACTION is a constant representing the sandboxing action.
3064: GLOB is a string representing the glob pattern."
3065: (let ((action (cond
3066: ((eq action :action-allow) "allow")
3067: ((eq action :action-warn) "warn")
3068: ((eq action :action-filter) "filter")
3069: ((eq action :action-deny) "deny")
3070: ((eq action :action-panic) "panic")
3071: ((eq action :action-stop) "stop")
3072: ((eq action :action-abort) "abort")
3073: ((eq action :action-kill) "kill")
3074: ((eq action :action-exit) "exit"))))
3075: ; Only proceed if action is not nil
3076: (when action
3077: ; Create the command string
3078: (let ((cmd (format "%s/mktemp" action)))
3079: ; Call syd--stat with the command
3080: (syd--stat (syd--rule cmd glob ?+))))))
3081:
3082: (defun syd-mktemp-del (action glob)
3083: "Removes the first matching entry from the end of the given actionlist
3084: of mktemp sandboxing.
3085: ACTION is a constant representing the sandboxing action.
3086: GLOB is a string representing the glob pattern."
3087: (let ((action (cond
3088: ((eq action :action-allow) "allow")
3089: ((eq action :action-warn) "warn")
3090: ((eq action :action-filter) "filter")
3091: ((eq action :action-deny) "deny")
3092: ((eq action :action-panic) "panic")
3093: ((eq action :action-stop) "stop")
3094: ((eq action :action-abort) "abort")
3095: ((eq action :action-kill) "kill")
3096: ((eq action :action-exit) "exit"))))
3097: ; Only proceed if action is not nil
3098: (when action
3099: ; Create the command string
3100: (let ((cmd (format "%s/mktemp" action)))
3101: ; Call syd--stat with the command
3102: (syd--stat (syd--rule cmd glob ?-))))))
3103:
3104: (defun syd-mktemp-rem (action glob)
3105: "Removes all matching entries from the given actionlist of mktemp sandboxing.
3106: ACTION is a constant representing the sandboxing action.
3107: GLOB is a string representing the glob pattern."
3108: (let ((action (cond
3109: ((eq action :action-allow) "allow")
3110: ((eq action :action-warn) "warn")
3111: ((eq action :action-filter) "filter")
3112: ((eq action :action-deny) "deny")
3113: ((eq action :action-panic) "panic")
3114: ((eq action :action-stop) "stop")
3115: ((eq action :action-abort) "abort")
3116: ((eq action :action-kill) "kill")
3117: ((eq action :action-exit) "exit"))))
3118: ; Only proceed if action is not nil
3119: (when action
3120: ; Create the command string
3121: (let ((cmd (format "%s/mktemp" action)))
3122: ; Call syd--stat with the command
3123: (syd--stat (syd--rule cmd glob ?^))))))
3124:
3125: (defun syd-net-bind-add (action addr)
3126: "Adds to the given actionlist of net/bind sandboxing.
3127: ACTION is a constant representing the sandboxing action.
3128: ADDR is a string representing the address pattern."
3129: (let ((action (cond
3130: ((eq action :action-allow) "allow")
3131: ((eq action :action-warn) "warn")
3132: ((eq action :action-filter) "filter")
3133: ((eq action :action-deny) "deny")
3134: ((eq action :action-panic) "panic")
3135: ((eq action :action-stop) "stop")
3136: ((eq action :action-abort) "abort")
3137: ((eq action :action-kill) "kill")
3138: ((eq action :action-exit) "exit"))))
3139: ; Only proceed if action is not nil
3140: (when action
3141: ; Create the command string
3142: (let ((cmd (format "%s/net/bind" action)))
3143: ; Call syd--stat with the command
3144: (syd--stat (syd--rule cmd addr ?+))))))
3145:
3146: (defun syd-net-bind-del (action addr)
3147: "Removes the first matching entry from the end of the given actionlist
3148: of net/bind sandboxing.
3149: ACTION is a constant representing the sandboxing action.
3150: ADDR is a string representing the address pattern."
3151: (let ((action (cond
3152: ((eq action :action-allow) "allow")
3153: ((eq action :action-warn) "warn")
3154: ((eq action :action-filter) "filter")
3155: ((eq action :action-deny) "deny")
3156: ((eq action :action-panic) "panic")
3157: ((eq action :action-stop) "stop")
3158: ((eq action :action-abort) "abort")
3159: ((eq action :action-kill) "kill")
3160: ((eq action :action-exit) "exit"))))
3161: ; Only proceed if action is not nil
3162: (when action
3163: ; Create the command string
3164: (let ((cmd (format "%s/net/bind" action)))
3165: ; Call syd--stat with the command
3166: (syd--stat (syd--rule cmd addr ?-))))))
3167:
3168: (defun syd-net-bind-rem (action addr)
3169: "Removes all matching entries from the given actionlist of net/bind sandboxing.
3170: ACTION is a constant representing the sandboxing action.
3171: ADDR is a string representing the address pattern."
3172: (let ((action (cond
3173: ((eq action :action-allow) "allow")
3174: ((eq action :action-warn) "warn")
3175: ((eq action :action-filter) "filter")
3176: ((eq action :action-deny) "deny")
3177: ((eq action :action-panic) "panic")
3178: ((eq action :action-stop) "stop")
3179: ((eq action :action-abort) "abort")
3180: ((eq action :action-kill) "kill")
3181: ((eq action :action-exit) "exit"))))
3182: ; Only proceed if action is not nil
3183: (when action
3184: ; Create the command string
3185: (let ((cmd (format "%s/net/bind" action)))
3186: ; Call syd--stat with the command
3187: (syd--stat (syd--rule cmd addr ?^))))))
3188:
3189: (defun syd-net-connect-add (action addr)
3190: "Adds to the given actionlist of net/connect sandboxing.
3191: ACTION is a constant representing the sandboxing action.
3192: ADDR is a string representing the address pattern."
3193: (let ((action (cond
3194: ((eq action :action-allow) "allow")
3195: ((eq action :action-warn) "warn")
3196: ((eq action :action-filter) "filter")
3197: ((eq action :action-deny) "deny")
3198: ((eq action :action-panic) "panic")
3199: ((eq action :action-stop) "stop")
3200: ((eq action :action-abort) "abort")
3201: ((eq action :action-kill) "kill")
3202: ((eq action :action-exit) "exit"))))
3203: ; Only proceed if action is not nil
3204: (when action
3205: ; Create the command string
3206: (let ((cmd (format "%s/net/connect" action)))
3207: ; Call syd--stat with the command
3208: (syd--stat (syd--rule cmd addr ?+))))))
3209:
3210: (defun syd-net-connect-del (action addr)
3211: "Removes the first matching entry from the end of the given actionlist
3212: of net/connect sandboxing.
3213: ACTION is a constant representing the sandboxing action.
3214: ADDR is a string representing the address pattern."
3215: (let ((action (cond
3216: ((eq action :action-allow) "allow")
3217: ((eq action :action-warn) "warn")
3218: ((eq action :action-filter) "filter")
3219: ((eq action :action-deny) "deny")
3220: ((eq action :action-panic) "panic")
3221: ((eq action :action-stop) "stop")
3222: ((eq action :action-abort) "abort")
3223: ((eq action :action-kill) "kill")
3224: ((eq action :action-exit) "exit"))))
3225: ; Only proceed if action is not nil
3226: (when action
3227: ; Create the command string
3228: (let ((cmd (format "%s/net/connect" action)))
3229: ; Call syd--stat with the command
3230: (syd--stat (syd--rule cmd addr ?-))))))
3231:
3232: (defun syd-net-connect-rem (action addr)
3233: "Removes all matching entries from the given actionlist of net/connect
3234: sandboxing.
3235: ACTION is a constant representing the sandboxing action.
3236: ADDR is a string representing the address pattern."
3237: (let ((action (cond
3238: ((eq action :action-allow) "allow")
3239: ((eq action :action-warn) "warn")
3240: ((eq action :action-filter) "filter")
3241: ((eq action :action-deny) "deny")
3242: ((eq action :action-panic) "panic")
3243: ((eq action :action-stop) "stop")
3244: ((eq action :action-abort) "abort")
3245: ((eq action :action-kill) "kill")
3246: ((eq action :action-exit) "exit"))))
3247: ; Only proceed if action is not nil
3248: (when action
3249: ; Create the command string
3250: (let ((cmd (format "%s/net/connect" action)))
3251: ; Call syd--stat with the command
3252: (syd--stat (syd--rule cmd addr ?^))))))
3253:
3254: (defun syd-net-sendfd-add (action addr)
3255: "Adds to the given actionlist of net/sendfd sandboxing.
3256: ACTION is a constant representing the sandboxing action.
3257: ADDR is a string representing the address pattern."
3258: (let ((action (cond
3259: ((eq action :action-allow) "allow")
3260: ((eq action :action-warn) "warn")
3261: ((eq action :action-filter) "filter")
3262: ((eq action :action-deny) "deny")
3263: ((eq action :action-panic) "panic")
3264: ((eq action :action-stop) "stop")
3265: ((eq action :action-abort) "abort")
3266: ((eq action :action-kill) "kill")
3267: ((eq action :action-exit) "exit"))))
3268: ; Only proceed if action is not nil
3269: (when action
3270: ; Create the command string
3271: (let ((cmd (format "%s/net/sendfd" action)))
3272: ; Call syd--stat with the command
3273: (syd--stat (syd--rule cmd addr ?+))))))
3274:
3275: (defun syd-net-sendfd-del (action addr)
3276: "Removes the first matching entry from the end of the given actionlist
3277: of net/sendfd sandboxing.
3278: ACTION is a constant representing the sandboxing action.
3279: ADDR is a string representing the address pattern."
3280: (let ((action (cond
3281: ((eq action :action-allow) "allow")
3282: ((eq action :action-warn) "warn")
3283: ((eq action :action-filter) "filter")
3284: ((eq action :action-deny) "deny")
3285: ((eq action :action-panic) "panic")
3286: ((eq action :action-stop) "stop")
3287: ((eq action :action-abort) "abort")
3288: ((eq action :action-kill) "kill")
3289: ((eq action :action-exit) "exit"))))
3290: ; Only proceed if action is not nil
3291: (when action
3292: ; Create the command string
3293: (let ((cmd (format "%s/net/sendfd" action)))
3294: ; Call syd--stat with the command
3295: (syd--stat (syd--rule cmd addr ?-))))))
3296:
3297: (defun syd-net-sendfd-rem (action addr)
3298: "Removes all matching entries from the given actionlist of net/sendfd sandboxing.
3299: ACTION is a constant representing the sandboxing action.
3300: ADDR is a string representing the address pattern."
3301: (let ((action (cond
3302: ((eq action :action-allow) "allow")
3303: ((eq action :action-warn) "warn")
3304: ((eq action :action-filter) "filter")
3305: ((eq action :action-deny) "deny")
3306: ((eq action :action-panic) "panic")
3307: ((eq action :action-stop) "stop")
3308: ((eq action :action-abort) "abort")
3309: ((eq action :action-kill) "kill")
3310: ((eq action :action-exit) "exit"))))
3311: ; Only proceed if action is not nil
3312: (when action
3313: ; Create the command string
3314: (let ((cmd (format "%s/net/sendfd" action)))
3315: ; Call syd--stat with the command
3316: (syd--stat (syd--rule cmd addr ?^))))))
3317:
3318: (defun syd-net-link-add (action addr)
3319: "Adds to the given actionlist of net/link sandboxing.
3320: ACTION is a constant representing the sandboxing action.
3321: ADDR is a string representing the address pattern."
3322: (let ((action (cond
3323: ((eq action :action-allow) "allow")
3324: ((eq action :action-warn) "warn")
3325: ((eq action :action-filter) "filter")
3326: ((eq action :action-deny) "deny")
3327: ((eq action :action-panic) "panic")
3328: ((eq action :action-stop) "stop")
3329: ((eq action :action-abort) "abort")
3330: ((eq action :action-kill) "kill")
3331: ((eq action :action-exit) "exit"))))
3332: ; Only proceed if action is not nil
3333: (when action
3334: ; Create the command string
3335: (let ((cmd (format "%s/net/link" action)))
3336: ; Call syd--stat with the command
3337: (syd--stat (syd--rule cmd addr ?+))))))
3338:
3339: (defun syd-net-link-del (action addr)
3340: "Removes the first matching entry from the end of the given actionlist
3341: of net/link sandboxing.
3342: ACTION is a constant representing the sandboxing action.
3343: ADDR is a string representing the address pattern."
3344: (let ((action (cond
3345: ((eq action :action-allow) "allow")
3346: ((eq action :action-warn) "warn")
3347: ((eq action :action-filter) "filter")
3348: ((eq action :action-deny) "deny")
3349: ((eq action :action-panic) "panic")
3350: ((eq action :action-stop) "stop")
3351: ((eq action :action-abort) "abort")
3352: ((eq action :action-kill) "kill")
3353: ((eq action :action-exit) "exit"))))
3354: ; Only proceed if action is not nil
3355: (when action
3356: ; Create the command string
3357: (let ((cmd (format "%s/net/link" action)))
3358: ; Call syd--stat with the command
3359: (syd--stat (syd--rule cmd addr ?-))))))
3360:
3361: (defun syd-net-link-rem (action addr)
3362: "Removes all matching entries from the given actionlist of net/link sandboxing.
3363: ACTION is a constant representing the sandboxing action.
3364: ADDR is a string representing the address pattern."
3365: (let ((action (cond
3366: ((eq action :action-allow) "allow")
3367: ((eq action :action-warn) "warn")
3368: ((eq action :action-filter) "filter")
3369: ((eq action :action-deny) "deny")
3370: ((eq action :action-panic) "panic")
3371: ((eq action :action-stop) "stop")
3372: ((eq action :action-abort) "abort")
3373: ((eq action :action-kill) "kill")
3374: ((eq action :action-exit) "exit"))))
3375: ; Only proceed if action is not nil
3376: (when action
3377: ; Create the command string
3378: (let ((cmd (format "%s/net/link" action)))
3379: ; Call syd--stat with the command
3380: (syd--stat (syd--rule cmd addr ?^))))))
3381:
3382: (defun syd-force-add (path alg hash action)
3383: "Adds an entry to the Integrity Force map for Force Sandboxing.
3384: PATH is a fully-qualified file name.
3385: ALG is the hash algorithm (e.g. \"sha256\").
3386: HASH is a hexadecimal encoded checksum.
3387: ACTION is one of :action-warn, :action-filter, :action-deny, :action-panic, :action-stop, :action-abort, :action-kill, or :action-exit."
3388: (let ((action (cond ((eq action :action-warn) "warn")
3389: ((eq action :action-filter) "filter")
3390: ((eq action :action-deny) "deny")
3391: ((eq action :action-panic) "panic")
3392: ((eq action :action-stop) "stop")
3393: ((eq action :action-abort) "abort")
3394: ((eq action :action-kill) "kill")
3395: ((eq action :action-exit) "exit"))))
3396: ; Only proceed if action is not nil
3397: (when action
3398: ; Create the command string
3399: (let ((cmd (format "/dev/syd/force+%s:%s:%s:%s" path alg hash action)))
3400: ; Call syd--stat with the command
3401: (syd--stat cmd)))))
3402:
3403: (defun syd-force-del (path)
3404: "Removes an entry from the Integrity Force map for Force Sandboxing.
3405: PATH is a fully-qualified file name."
3406: ; Create the command string
3407: (let ((cmd (format "/dev/syd/force-%s" path)))
3408: ; Call syd--stat with the command
3409: (syd--stat cmd)))
3410:
3411: (defun syd-force-clr ()
3412: "Clears the Integrity Force map for Force Sandboxing."
3413: (syd--stat "/dev/syd/force^"))
3414:
3415: (defun syd-mem-max (size)
3416: "Set syd maximum per-process memory usage limit.
3417: SIZE can be an integer or a string representing the memory limit."
3418: (let ((size-str (cond ((integerp size) (number-to-string size))
3419: ((stringp size) size)
3420: (t (error "Size must be an integer or a string")))))
3421: (syd--stat (syd--rule "mem/max" size-str ?:))))
3422:
3423: (defun syd-mem-vm-max (size)
3424: "Set syd maximum per-process virtual memory usage limit.
3425: SIZE can be an integer or a string representing the memory limit."
3426: (let ((size-str (cond ((integerp size) (number-to-string size))
3427: ((stringp size) size)
3428: (t (error "Size must be an integer or a string")))))
3429: (syd--stat (syd--rule "mem/vm_max" size-str ?:))))
3430:
3431: (defun syd-pid-max (size)
3432: "Set syd maximum process ID limit for PID sandboxing.
3433: SIZE is a number representing the PID limit."
3434: (unless (numberp size)
3435: (error "Size must be a number"))
3436: (let ((path (format "/dev/syd/pid/max:%d" size)))
3437: (syd--stat path)))
3438:
3439: (defun syd-segvguard-expiry (timeout)
3440: "Specify SegvGuard entry expiry timeout in seconds.
3441: Setting this timeout to 0 effectively disables SegvGuard.
3442: TIMEOUT is a number representing the timeout in seconds."
3443: (unless (numberp timeout)
3444: (error "Timeout must be a number"))
3445: (let ((path (format "/dev/syd/segvguard/expiry:%d" timeout)))
3446: (syd--stat path)))
3447:
3448: (defun syd-segvguard-suspension (timeout)
3449: "Specify SegvGuard entry suspension timeout in seconds.
3450: TIMEOUT is a number representing the timeout in seconds."
3451: (unless (numberp timeout)
3452: (error "Timeout must be a number"))
3453: (let ((path (format "/dev/syd/segvguard/suspension:%d" timeout)))
3454: (syd--stat path)))
3455:
3456: (defun syd-segvguard-maxcrashes (limit)
3457: "Specify SegvGuard max number of crashes before suspension.
3458: LIMIT is a number representing the crash limit."
3459: (unless (numberp limit)
3460: (error "Limit must be a number"))
3461: (let ((path (format "/dev/syd/segvguard/maxcrashes:%d" limit)))
3462: (syd--stat path)))
3463:
3464: (defun syd-exec (file argv)
3465: "Execute a command outside the sandbox without sandboxing.
3466: FILE is the file path of the command as a string.
3467: ARGV is a list of strings representing the arguments to the command."
3468: (unless (stringp file)
3469: (error "File must be a string"))
3470: (let ((all-strings t))
3471: (dolist (arg argv)
3472: (unless (stringp arg)
3473: (setq all-strings nil)))
3474: (unless all-strings
3475: (error "All elements in ARGV must be strings")))
3476:
3477: (let ((cmd (mapconcat 'identity (cons file argv) "\x1F")))
3478: (syd--stat (concat "/dev/syd/cmd/exec!" cmd))))
3479:
3480: (defun syd--rule (rule elem op)
3481: "Helper function to construct a path for syd operations.
3482: RULE is a string representing the rule.
3483: ELEM is a string representing the element.
3484: OP is a character representing the operation."
3485: (unless (member op '(?+ ?- ?^ ?:))
3486: (error "Invalid operation"))
3487: (when (string-empty-p elem)
3488: (error "Element cannot be empty"))
3489: (concat "/dev/syd/" rule (char-to-string op) elem))
3490:
3491: (defun syd--stat (path)
3492: "Check if the file at PATH exists using `file-modes'."
3493: (condition-case nil
3494: (not (null (file-modes path)))
3495: (error nil))) ; On error, return nil
3496:
3497: (provide 'syd)
3498: ; syd.el ends here
3499:
02/05/2026 15:26:56, src/syd.el, Ali Polatel