[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] trans/fakeroot: override fshelp_isowner
From: |
Samuel Thibault |
Subject: |
Re: [PATCH] trans/fakeroot: override fshelp_isowner |
Date: |
Tue, 20 May 2014 09:50:46 +0200 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Tue 20 May 2014 09:46:02 +0200, a écrit :
> As of recently, fakeroot would fail to create symlinks:
>
> % fakeroot-hurd ln -s foo a
> ln: failed to create symbolic link ‘a’: Operation not permitted
>
> Fix this by overriding fshelp_isowner.
>
> Various netfs functions will call fshelp_isowner to check whether USER
> is allowed to do some operation. As fakeroot is not running within
> the fakeauth'ed environment, USER contains the real user.
>
> I have no explanation why this ever worked.
Ack.
> * trans/fakeroot.c (fshelp_isowner): New function.
> ---
> trans/fakeroot.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/trans/fakeroot.c b/trans/fakeroot.c
> index d3addc1..32a34ec 100644
> --- a/trans/fakeroot.c
> +++ b/trans/fakeroot.c
> @@ -469,6 +469,16 @@ netfs_validate_stat (struct node *np, struct iouser
> *cred)
> return 0;
> }
>
> +/* Various netfs functions will call fshelp_isowner to check whether
> + USER is allowed to do some operation. As fakeroot is not running
> + within the fakeauth'ed environment, USER contains the real
> + user. Hence, we override this check. */
> +error_t
> +fshelp_isowner (struct stat *st, struct iouser *user)
> +{
> + return 0;
> +}
> +
> error_t
> netfs_attempt_chown (struct iouser *cred, struct node *np,
> uid_t uid, uid_t gid)
> --
> 2.0.0.rc2
>
--
Samuel
"...very few phenomena can pull someone out of Deep Hack Mode, with two
noted exceptions: being struck by lightning, or worse, your *computer*
being struck by lightning."
(By Matt Welsh)