From 42e8f4102d1ddcfcae600b27641bf80989a0b175 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 24 Aug 2000 19:48:31 +0000 Subject: Modified to use sid_to_uid and sid_to_gid. Now ready for POSIX ACL code.... Jeremy. (This used to be commit 28586c1dee18d99e0e0999ab1a945a33ce33c371) --- source3/smbd/unix_acls.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'source3/smbd') diff --git a/source3/smbd/unix_acls.c b/source3/smbd/unix_acls.c index 46c57af5de..7ab448e6a3 100644 --- a/source3/smbd/unix_acls.c +++ b/source3/smbd/unix_acls.c @@ -151,6 +151,7 @@ static BOOL unpack_nt_permissions(SMB_STRUCT_STAT *psbuf, uid_t *puser, gid_t *p SEC_ACL *dacl = psd->dacl; BOOL all_aces_are_inherit_only = (is_directory ? True : False); int i; + enum SID_NAME_USE sid_type; *pmode = 0; *puser = (uid_t)-1; @@ -184,20 +185,20 @@ static BOOL unpack_nt_permissions(SMB_STRUCT_STAT *psbuf, uid_t *puser, gid_t *p * This may be a group chown only set. */ - if(!validate_unix_sid( &owner_sid, &owner_rid, psd->owner_sid)) - DEBUG(3,("unpack_nt_permissions: unable to validate owner sid.\n")); - else if(security_info_sent & OWNER_SECURITY_INFORMATION) - *puser = pdb_user_rid_to_uid(owner_rid); + if (security_info_sent & OWNER_SECURITY_INFORMATION) { + if (!sid_to_uid( &owner_sid, puser, &sid_type)) + DEBUG(3,("unpack_nt_permissions: unable to validate owner sid.\n")); + } /* * Don't immediately fail if the group sid cannot be validated. * This may be an owner chown only set. */ - if(!validate_unix_sid( &grp_sid, &grp_rid, psd->grp_sid)) - DEBUG(3,("unpack_nt_permissions: unable to validate group sid.\n")); - else if(security_info_sent & GROUP_SECURITY_INFORMATION) - *pgrp = pdb_user_rid_to_gid(grp_rid); + if (security_info_sent & GROUP_SECURITY_INFORMATION) { + if (!sid_to_gid( &grp_sid, pgrp, &sid_type)) + DEBUG(3,("unpack_nt_permissions: unable to validate group sid.\n")); + } /* * If no DACL then this is a chown only security descriptor. -- cgit