Introduce sidfromuid and sidfromgid

* pwdgrp.h (sidfromuid): New inline function.
	(sidfromgid): Ditto.
	* fhandler_disk_file.cc (fhandler_disk_file::fchown): Use sidfromuid.
	* quotactl.cc (quotactl): Use sidfromuid and sidfromgid.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2015-04-08 11:00:08 +02:00
parent 0411e86216
commit 0f4510230a
4 changed files with 30 additions and 14 deletions

View File

@ -989,10 +989,10 @@ fhandler_disk_file::fchown (uid_t uid, gid_t gid)
the standard UNIX accounts, we're faking success. */
if (res == -1 && pc.fs_is_samba ())
{
cygsid sid;
PSID sid;
if (old_uid == ILLEGAL_UID
|| (sid.getfrompw (internal_getpwuid (old_uid))
|| ((sid = sidfromuid (old_uid, NULL)) != NO_SID
&& RtlEqualPrefixSid (sid,
well_known_samba_unix_user_fake_sid)))
{