Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag functions from std and other crates? #1

Closed
dckc opened this issue Nov 23, 2016 · 5 comments
Closed

tag functions from std and other crates? #1

dckc opened this issue Nov 23, 2016 · 5 comments

Comments

@dckc
Copy link

dckc commented Nov 23, 2016

I'd like to use this tag_unsafe lint to enforce object capability discipline. To do this, I need to be able to tag existing functions from std and other crates... a sort of taming database.

Does that seem feasible?

I'm willing to code up the feature, given a little guidance.

@thepowersgang
Copy link
Owner

That would be a good idea - I'm starting on a redesign of this crate to properly specify its behaviour (and hopefully include external crate handling).

I'm not sure how easy an external database will be, but hopefully it shouldn't be too difficult.

@dckc
Copy link
Author

dckc commented Nov 24, 2016

"database" might give the wrong impression... a csv or .toml file would be fine. And it need not be dynamic. Baking it in at build time would work.

@dckc
Copy link
Author

dckc commented Nov 26, 2016

I think my preferred form of database might be rust source:

#[tag_unsafe(ocap)]
use std::fs::File::open;

@thepowersgang
Copy link
Owner

I've drafted up a rewrite of the plugin (See the redesign branch) that both cleans up some of the logic, and can parse a list of safe/unsafe functions from a linked file. (Just a simple list of function names as pretty-printed by the compiler)

#[tagged_safe(ocap="tagsafe_std_ocap.txt")]
extern crate std as _std;

@dckc
Copy link
Author

dckc commented Sep 4, 2017

I see this was fix Nov 25, 2016 in 09c2c25
with documentation in d66a166

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants