Quantcast

thread impersonation

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

thread impersonation

Gonzalo
Hello guys.

I'm new in freeBSD and I'm looking a way to impersonate threads in FreeBSD.
In Linux I did that with setfsuid, but that only work in linux and is not
portable :(

I saw that in FreeBSD there is Jails, that could work? Is possible to create
a Jail for every new thread and "impersonate the Jail"? Maybe I'm saying
things without sense :(

Thanks in advance ;)
Gonzalo
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: thread impersonation

Tijl Coosemans-3
On Monday 12 September 2011 21:31:03 Gonzalo wrote:
> I'm new in freeBSD and I'm looking a way to impersonate threads in FreeBSD.
> In Linux I did that with setfsuid, but that only work in linux and is not
> portable :(

There's seteuid(2) or setuid(2) which are portable. They change the uid of
the entire process though, not per thread.

> I saw that in FreeBSD there is Jails, that could work? Is possible to create
> a Jail for every new thread and "impersonate the Jail"? Maybe I'm saying
> things without sense :(

A jail is a form of virtualisation. It's not related to what you're trying
to do. You can read more about jails in the handbook:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails-intro.html

signature.asc (235 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: thread impersonation

Gonzalo
So, as a imagined, is not possible a thread impersonation on FreeBSD?

2011/9/17 Tijl Coosemans <[hidden email]>

> On Monday 12 September 2011 21:31:03 Gonzalo wrote:
> > I'm new in freeBSD and I'm looking a way to impersonate threads in
> FreeBSD.
> > In Linux I did that with setfsuid, but that only work in linux and is not
> > portable :(
>
> There's seteuid(2) or setuid(2) which are portable. They change the uid of
> the entire process though, not per thread.
>
> > I saw that in FreeBSD there is Jails, that could work? Is possible to
> create
> > a Jail for every new thread and "impersonate the Jail"? Maybe I'm saying
> > things without sense :(
>
> A jail is a form of virtualisation. It's not related to what you're trying
> to do. You can read more about jails in the handbook:
> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails-intro.html
>
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: thread impersonation

Julian Elischer-5
On 9/17/11 11:51 AM, Gonzalo wrote:
> So, as a imagined, is not possible a thread impersonation on FreeBSD?
>
> 2011/9/17 Tijl Coosemans<[hidden email]>
I'm not quite sure what you are trying to achieve, and why.
each thread DOES have its own credentials but the kernel/unix spec
defines them to all be the same user..
It MIGHT be possible for a thread spawned before a seteuid() to keep
some of the credentials of the prior  ID
but I haven't looked.. Nor do I know how that would be used..  usually
UID tests are made on the PROCESS
credentials and not the thread credentials (which exist for other
reasons).

>> On Monday 12 September 2011 21:31:03 Gonzalo wrote:
>>> I'm new in freeBSD and I'm looking a way to impersonate threads in
>> FreeBSD.
>>> In Linux I did that with setfsuid, but that only work in linux and is not
>>> portable :(
>> There's seteuid(2) or setuid(2) which are portable. They change the uid of
>> the entire process though, not per thread.
>>
>>> I saw that in FreeBSD there is Jails, that could work? Is possible to
>> create
>>> a Jail for every new thread and "impersonate the Jail"? Maybe I'm saying
>>> things without sense :(
>> A jail is a form of virtualisation. It's not related to what you're trying
>> to do. You can read more about jails in the handbook:
>> http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails-intro.html
>>
> _______________________________________________
> [hidden email] mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-threads
> To unsubscribe, send any mail to "[hidden email]"
>

_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: thread impersonation

Gonzalo
What i'm trying to achieve is a program like NFS. Users will connect to this
program and navigate the virtual filesystem. Each connection is a thread,
and I need to impersonate them for the user associated to each connection,
if I use setuid, all thread in the process would be impersonated. In Linux I
achieved that using "setfsid" but that doesn't exists here in FreeBSD

Thanks
Gonzalo

2011/9/17 Julian Elischer <[hidden email]>

> On 9/17/11 11:51 AM, Gonzalo wrote:
>
>> So, as a imagined, is not possible a thread impersonation on FreeBSD?
>>
>> 2011/9/17 Tijl Coosemans<[hidden email]>
>>
> I'm not quite sure what you are trying to achieve, and why.
> each thread DOES have its own credentials but the kernel/unix spec defines
> them to all be the same user..
> It MIGHT be possible for a thread spawned before a seteuid() to keep some
> of the credentials of the prior  ID
> but I haven't looked.. Nor do I know how that would be used..  usually UID
> tests are made on the PROCESS
> credentials and not the thread credentials (which exist for other reasons).
>
>> On Monday 12 September 2011 21:31:03 Gonzalo wrote:
>>>
>>>> I'm new in freeBSD and I'm looking a way to impersonate threads in
>>>>
>>> FreeBSD.
>>>
>>>> In Linux I did that with setfsuid, but that only work in linux and is
>>>> not
>>>> portable :(
>>>>
>>> There's seteuid(2) or setuid(2) which are portable. They change the uid
>>> of
>>> the entire process though, not per thread.
>>>
>>>  I saw that in FreeBSD there is Jails, that could work? Is possible to
>>>>
>>> create
>>>
>>>> a Jail for every new thread and "impersonate the Jail"? Maybe I'm saying
>>>> things without sense :(
>>>>
>>> A jail is a form of virtualisation. It's not related to what you're
>>> trying
>>> to do. You can read more about jails in the handbook:
>>> http://www.freebsd.org/doc/en_**US.ISO8859-1/books/handbook/**
>>> jails-intro.html<http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails-intro.html>
>>>
>>>  ______________________________**_________________
>> [hidden email] mailing list
>> http://lists.freebsd.org/**mailman/listinfo/freebsd-**threads<http://lists.freebsd.org/mailman/listinfo/freebsd-threads>
>> To unsubscribe, send any mail to "freebsd-threads-unsubscribe@**
>> freebsd.org <[hidden email]>"
>>
>>
>
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: thread impersonation

John Baldwin
On Monday, September 19, 2011 7:50:04 am Gonzalo wrote:
> What i'm trying to achieve is a program like NFS. Users will connect to this
> program and navigate the virtual filesystem. Each connection is a thread,
> and I need to impersonate them for the user associated to each connection,
> if I use setuid, all thread in the process would be impersonated. In Linux I
> achieved that using "setfsid" but that doesn't exists here in FreeBSD

Yes, per-thread credentials don't exist yet.  You can try asking
[hidden email] as he was planning to work on that, but I don't know if he has
a patch available.  rwatson@ is another good person to ask about this.

--
John Baldwin
_______________________________________________
[hidden email] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-threads
To unsubscribe, send any mail to "[hidden email]"
Loading...