Conversation
905a4c1
to
b8eb5a2
Compare
Waiting for an answer in naegelejd/go-acl#1 |
b8eb5a2
to
c5c9a38
Compare
at the request of @iaguis for rkt/rkt#1963 closes #1
The author answered saying that the license will be MIT, which should be compatible with our Apache. Also, added an acknowledgement. EDIT: There's a LICENSE file now :) |
Do we want this for 1.0? cc @jonboulle |
I think it would be great - what's left to do? |
Make sure we include the appropriate license text/files and a review. On Tue, Jan 26, 2016, 17:38 Jonathan Boulle notifications@github.com
|
c5c9a38
to
a4b7776
Compare
Rebased and added the MIT license to LICENSE |
// { | ||
// acl_t (*acl_from_text)(const char *buf_p); | ||
// | ||
// acl_from_text = (acl_t (*)(const char *))f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the casts from a void pointer needed?
This package is a wrapper over libacl that, instead of being linked to it, it dlopens it so we can check if it's present on the system. It's not meant to be complete, we just implement the functions needed by rkt at the moment. It is based on https://github.com/naegelejd/go-acl
We're not linking to libacl.so, but we dlopen it.
bb3ec1f
to
bfb3b82
Compare
sym := C.CString(symbol) | ||
defer C.free(unsafe.Pointer(sym)) | ||
|
||
p := C.dlsym(handle, sym) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to manual, the proper way of loading symbols is to call dlerror()
to clear an error message, then dlsym
and then dlerror
again to check if there was an error in dlsym
. So I guess something like follows would cut it:
C.dlerror()
p := C.dlsym(…)
e := C.dlerror()
if e != nil {
return nil, errwrap(fmt.Errorf("error resolving symbol %q", symbol), errors.New(C.GoString(e))
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. I guess I'll wrap all the errors then.
BTW, we should also do this in go-systemd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That calls for a new package! :P
Updated, I think I addressed everything. PTAL |
LGTM, this is tested right? :D |
Natürlich! It works on my machine (TM) |
Also works on my machine. LFAD. |
This package is a wrapper over libacl that, instead of being linked to
it, it dlopens it so we can check if it's present on the system.
It's not meant to be complete, we just implement the functions needed by
rkt at the moment.
It is based on https://github.com/naegelejd/go-acl
Fixes #1961