From: xieziyao <xieziyao@huawei.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v4] syscalls/chown: Rewrite chown/chown03.c with the new api
Date: Thu, 22 Apr 2021 02:51:40 +0000 [thread overview]
Message-ID: <c13fc2e2339e43f7908fb2d3f53cf745@huawei.com> (raw)
In-Reply-To: <YIATWfAJEvFhvZ77@yuki>
Hi,
Thanks, I just made changes on your suggestions.
Please see: https://patchwork.ozlabs.org/project/ltp/patch/20210422024410.175538-1-xieziyao@huawei.com/
Best Regards,
Ziyao
-----Original Message-----
From: Cyril Hrubis [mailto:chrubis@suse.cz]
Sent: Wednesday, April 21, 2021 7:58 PM
To: xieziyao <xieziyao@huawei.com>
Cc: ltp@lists.linux.it; alexey.kodanev@oracle.com
Subject: Re: [LTP][PATCH v4] syscalls/chown: Rewrite chown/chown03.c with the new api
Hi!
> + SAFE_SETEUID(0);
> + SAFE_CHOWN(FILENAME, -1, 0);
> + SAFE_CHMOD(FILENAME, NEW_PERMS);
> + SAFE_SETEUID(ltpuser->pw_uid);
> +
> + uid_t uid;
> + gid_t gid;
> + UID16_CHECK((uid = geteuid()), "chown");
> + GID16_CHECK((gid = getegid()), "chown");
> +
> + struct stat stat_buf;
> + SAFE_STAT(FILENAME, &stat_buf);
> + check_owner(&stat_buf, uid, 0);
We should check that the S_ISUID and S_ISGID bits are set here as well.
Otherwise it looks good to me.
--
Cyril Hrubis
chrubis@suse.cz
prev parent reply other threads:[~2021-04-22 2:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-19 1:34 [LTP] [PATCH v3] syscalls/chown: Rewrite chown/chown03.c with the new api Xie Ziyao
2021-04-19 14:55 ` Cyril Hrubis
2021-04-20 6:30 ` xieziyao
2021-04-19 16:09 ` Alexey Kodanev
2021-04-20 6:28 ` xieziyao
2021-04-20 6:19 ` [LTP] [PATCH v4] " Xie Ziyao
2021-04-21 11:58 ` Cyril Hrubis
2021-04-22 2:51 ` xieziyao [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c13fc2e2339e43f7908fb2d3f53cf745@huawei.com \
--to=xieziyao@huawei.com \
--cc=ltp@lists.linux.it \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.