mailing list of musl libc
 help / color / mirror / code / Atom feed
* Implementation of sys/capabilities.h
@ 2012-08-27  9:16 Igmar Palsenberg
  2012-08-27 10:18 ` Justin Cormack
  0 siblings, 1 reply; 5+ messages in thread
From: Igmar Palsenberg @ 2012-08-27  9:16 UTC (permalink / raw)
  To: musl

Hi,

I'm in the works of implementing capability support within musl. This we need to implement if you ask me : 

cap_init()
cap_free()
cap_dup()
cap_get_flag()
cap_set_flag()
cap_clear()
cap_get_proc()
cap_set_proc()

Things we should not implemented : 

cap_get_fd()
cap_get_file()
cap_set_fd()
cap_set_file()

This is due their extreme limited use case (see the glibc manual pages)

To ugly to even consider : 

cap_from_text()
cap_to_text()


Any thoughts on this ?


Regards,



	Igmar

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Implementation of sys/capabilities.h
  2012-08-27  9:16 Implementation of sys/capabilities.h Igmar Palsenberg
@ 2012-08-27 10:18 ` Justin Cormack
  2012-08-27 10:23   ` Igmar Palsenberg
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Cormack @ 2012-08-27 10:18 UTC (permalink / raw)
  To: musl

On Mon, Aug 27, 2012 at 10:16 AM, Igmar Palsenberg <musl@palsenberg.com> wrote:
> Hi,
>
> I'm in the works of implementing capability support within musl. This we need to implement if you ask me :
>
> cap_init()
> cap_free()
> cap_dup()
> cap_get_flag()
> cap_set_flag()
> cap_clear()
> cap_get_proc()
> cap_set_proc()

Why in Musl out of interest? They are not in other libc's, and people
expect to link to libcap for them surely. And some people argue that
the interfaces are not very well designed (indeed libcap seems to be
adding extra ones not in the withdrawn posix draft), eg see
http://people.redhat.com/sgrubb/libcap-ng/

Justin


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Implementation of sys/capabilities.h
  2012-08-27 10:18 ` Justin Cormack
@ 2012-08-27 10:23   ` Igmar Palsenberg
  2012-08-27 11:26     ` Justin Cormack
  0 siblings, 1 reply; 5+ messages in thread
From: Igmar Palsenberg @ 2012-08-27 10:23 UTC (permalink / raw)
  To: musl



>> I'm in the works of implementing capability support within musl. This we need to implement if you ask me :
>> 
>> cap_init()
>> cap_free()
>> cap_dup()
>> cap_get_flag()
>> cap_set_flag()
>> cap_clear()
>> cap_get_proc()
>> cap_set_proc()
> 
> Why in Musl out of interest? They are not in other libc's, and people
> expect to link to libcap for them surely. And some people argue that
> the interfaces are not very well designed (indeed libcap seems to be
> adding extra ones not in the withdrawn posix draft), eg see
> http://people.redhat.com/sgrubb/libcap-ng/

It's open for debate. The syscalls need to be there (including the structs the kernel uses), and I've got those in a patch.

I agree the interface is shit : Way to complicated, while only need some simple functions, with a bitmap to represent them. Why implement it ?
It's the only thing we got, and programs assume it's POSIX, so it should be present. Yes, it's broken, but capabilities are a needed feature if you ask me.




	Igmar

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Implementation of sys/capabilities.h
  2012-08-27 10:23   ` Igmar Palsenberg
@ 2012-08-27 11:26     ` Justin Cormack
  2012-08-27 11:38       ` Igmar Palsenberg
  0 siblings, 1 reply; 5+ messages in thread
From: Justin Cormack @ 2012-08-27 11:26 UTC (permalink / raw)
  To: musl

On Mon, Aug 27, 2012 at 11:23 AM, Igmar Palsenberg <igmar@palsenberg.com> wrote:
>> Why in Musl out of interest? They are not in other libc's, and people
>> expect to link to libcap for them surely. And some people argue that
>> the interfaces are not very well designed (indeed libcap seems to be
>> adding extra ones not in the withdrawn posix draft), eg see
>> http://people.redhat.com/sgrubb/libcap-ng/
>
> It's open for debate. The syscalls need to be there (including the structs the kernel uses), and I've got those in a patch.
>
> I agree the interface is shit : Way to complicated, while only need some simple functions, with a bitmap to represent them. Why implement it ?
> It's the only thing we got, and programs assume it's POSIX, so it should be present. Yes, it's broken, but capabilities are a needed feature if you ask me.
>

Definitely add the syscalls, anyway, regardless.

I am just not sure that "programs assume it's POSIX, so it should be
present", I would assume they would expect to have to link against
external libcap, which would be an explicit dependency, not assumed
part of libc. They are part of the draft POSIX 1e, but it is only a
suggestion and not a standard, and really needed more work.

It is a difficult one, as the kernel API is a bit unpleasant. But
including a partial implementation is asking for trouble too. Perhaps
another option is a posix 1e companion library that implements the
other parts? Not sure...

Justin


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Implementation of sys/capabilities.h
  2012-08-27 11:26     ` Justin Cormack
@ 2012-08-27 11:38       ` Igmar Palsenberg
  0 siblings, 0 replies; 5+ messages in thread
From: Igmar Palsenberg @ 2012-08-27 11:38 UTC (permalink / raw)
  To: musl

> On Mon, Aug 27, 2012 at 11:23 AM, Igmar Palsenberg <igmar@palsenberg.com> wrote:
>>> Why in Musl out of interest? They are not in other libc's, and people
>>> expect to link to libcap for them surely. And some people argue that
>>> the interfaces are not very well designed (indeed libcap seems to be
>>> adding extra ones not in the withdrawn posix draft), eg see
>>> http://people.redhat.com/sgrubb/libcap-ng/
>> 
>> It's open for debate. The syscalls need to be there (including the structs the kernel uses), and I've got those in a patch.
>> 
>> I agree the interface is shit : Way to complicated, while only need some simple functions, with a bitmap to represent them. Why implement it ?
>> It's the only thing we got, and programs assume it's POSIX, so it should be present. Yes, it's broken, but capabilities are a needed feature if you ask me.
>> 
> 
> Definitely add the syscalls, anyway, regardless.

I'll submit a patch for that. Rich, can you handle pull request, or you want the patch on the ML ?

> I am just not sure that "programs assume it's POSIX, so it should be
> present", I would assume they would expect to have to link against
> external libcap, which would be an explicit dependency, not assumed
> part of libc. They are part of the draft POSIX 1e, but it is only a
> suggestion and not a standard, and really needed more work.
> 
> It is a difficult one, as the kernel API is a bit unpleasant. But
> including a partial implementation is asking for trouble too. Perhaps
> another option is a posix 1e companion library that implements the
> other parts? Not sure...

I prefer the kernel API over libcap any time. Kernel is one header struct (2 fields), and a struct with 3 bitfields. Can't get any easier if you ask me.
I'll submit a patch for the kernel ABI, the rest if I look at it again, doesn't belong in musl.



	Igmar



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-08-27 11:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-27  9:16 Implementation of sys/capabilities.h Igmar Palsenberg
2012-08-27 10:18 ` Justin Cormack
2012-08-27 10:23   ` Igmar Palsenberg
2012-08-27 11:26     ` Justin Cormack
2012-08-27 11:38       ` Igmar Palsenberg

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).