Skip to content

Commit

Permalink
Work on aisap-zig sockets
Browse files Browse the repository at this point in the history
My current plan is to no longer hard code permissions flags.
Instead, they will all be defined in JSON, which will be easier to
maintain and hopefully allow others to more easily utilize aisap in
other projects
  • Loading branch information
mgord9518 committed Jul 1, 2024
1 parent 5b529f4 commit 2ac5894
Show file tree
Hide file tree
Showing 6 changed files with 420 additions and 531 deletions.
161 changes: 0 additions & 161 deletions permissions/sockets.json

This file was deleted.

6 changes: 3 additions & 3 deletions zig/build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.{
.name = "aisap",
.version = "0.10.11-alpha",
.version = "0.10.1-alpha",
.paths = [][]const u8 {""},
.dependencies = .{
.squashfuse = .{
Expand All @@ -12,8 +12,8 @@
.hash = "12205592f7dc4b4c7256abd657a50bd9784459a0e9b8bfe8b0d1bbcc153a6d0f650a",
},
.known_folders = .{
.url = "https://github.com/ziglibs/known-folders/archive/0ad514dcfb7525e32ae349b9acc0a53976f3a9fa.tar.gz",
.hash = "12209cde192558f8b3dc098ac2330fc2a14fdd211c5433afd33085af75caa9183147",
.url = "https://github.com/ziglibs/known-folders/archive/cdcc6137ed2e92096b27d394db917d1861f156b3.tar.gz",
.hash = "1220863f0fc3e97cfd47a8edb28c7a3d109c42143235042fb513207b5c5a032fb93f",
},
},
}
2 changes: 1 addition & 1 deletion zig/examples/build.zig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const std = @import("std");
const aisap = @import("aisap/zig/build.zig");
//const aisap = @import("aisap/zig/build.zig");

pub fn build(b: *std.Build) void {
// Standard target options allows the person running `zig build` to choose
Expand Down
15 changes: 10 additions & 5 deletions zig/examples/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub fn main() !void {

var md5_buf: [33]u8 = undefined;

const permissions = try ai.permissions(
var permissions = try ai.permissions(
allocator,
) orelse {
std.debug.print("no permissions found\n", .{});
Expand All @@ -85,6 +85,9 @@ pub fn main() !void {
std.debug.print("[]\n", .{});
}

permissions.level = 3;
try AppImage.SocketPermissions.initDatabase(allocator);

std.debug.print("{s}\n", .{ai.name});
std.debug.print("desktop: {s}\n", .{ai.desktop_entry});
std.debug.print("type: {}\n", .{ai.kind});
Expand All @@ -93,12 +96,14 @@ pub fn main() !void {
try ai.md5(&md5_buf),
});

try ai.mount(.{});
try ai.mount(.{
.foreground = false,
});

const wrapArgs = try ai.wrapArgs(allocator);
printWrapArgs(wrapArgs);
//const wrapArgs = try ai.wrapArgs(allocator, permissions);
//printWrapArgs(wrapArgs);

try ai.sandbox(.{
try ai.sandbox(permissions, .{
//.args = &[_][]const u8{"build"},
});
}
Expand Down
Loading

0 comments on commit 2ac5894

Please sign in to comment.