diff options
author | Volker Lendecke <vl@samba.org> | 2018-12-10 13:04:11 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-12-20 23:40:24 +0100 |
commit | 444fc0bfcc83a911a7ceeac3d3a24af9254d6bd6 (patch) | |
tree | 2e4380dd6e36959e4f42242ffb239fca5ea67fde | |
parent | 69a3b899f1190a5517be0218068532430c7e7077 (diff) | |
download | samba-444fc0bfcc83a911a7ceeac3d3a24af9254d6bd6.tar.gz |
smbd: Use dom_sid_str_buf
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
-rw-r--r-- | source3/smbd/ntquotas.c | 13 | ||||
-rw-r--r-- | source3/smbd/nttrans.c | 3 | ||||
-rw-r--r-- | source3/smbd/posix_acls.c | 43 | ||||
-rw-r--r-- | source3/smbd/service.c | 3 |
4 files changed, 40 insertions, 22 deletions
diff --git a/source3/smbd/ntquotas.c b/source3/smbd/ntquotas.c index 7e2c0363696..5622f1023a8 100644 --- a/source3/smbd/ntquotas.c +++ b/source3/smbd/ntquotas.c @@ -23,6 +23,7 @@ #include "system/passwd.h" #include "passdb/lookup_sid.h" #include "libsmb/libsmb.h" +#include "libcli/security/dom_sid.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_QUOTA @@ -88,8 +89,9 @@ NTSTATUS vfs_get_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, id.uid = -1; if (psid && !sid_to_uid(psid, &id.uid)) { + struct dom_sid_buf buf; DEBUG(0,("sid_to_uid: failed, SID[%s]\n", - sid_string_dbg(psid))); + dom_sid_str_buf(psid, &buf))); return NT_STATUS_NO_SUCH_USER; } @@ -148,8 +150,9 @@ int vfs_set_ntquota(files_struct *fsp, enum SMB_QUOTA_TYPE qtype, struct dom_sid D.ihardlimit = limit_blk2inodes(D.hardlimit); if (psid && !sid_to_uid(psid, &id.uid)) { + struct dom_sid_buf buf; DEBUG(0,("sid_to_uid: failed, SID[%s]\n", - sid_string_dbg(psid))); + dom_sid_str_buf(psid, &buf))); } ret = SMB_VFS_SET_QUOTA(fsp->conn, qtype, id, &D); @@ -193,6 +196,7 @@ int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list) SMB_NTQUOTA_STRUCT tmp_qt; SMB_NTQUOTA_LIST *tmp_list_ent; struct dom_sid sid; + struct dom_sid_buf buf; NTSTATUS status; ZERO_STRUCT(tmp_qt); @@ -213,13 +217,14 @@ int vfs_get_user_ntquota_list(files_struct *fsp, SMB_NTQUOTA_LIST **qt_list) } if (tmp_qt.softlim == 0 && tmp_qt.hardlim == 0) { DEBUG(5,("no quota entry for sid[%s] path[%s]\n", - sid_string_dbg(&sid), + dom_sid_str_buf(&sid, &buf), fsp->conn->connectpath)); continue; } DEBUG(15,("quota entry for id[%s] path[%s]\n", - sid_string_dbg(&sid), fsp->conn->connectpath)); + dom_sid_str_buf(&sid, &buf), + fsp->conn->connectpath)); if ((tmp_list_ent=talloc_zero(mem_ctx,SMB_NTQUOTA_LIST))==NULL) { DEBUG(0,("TALLOC_ZERO() failed\n")); diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index e7991c051c1..7ebd802109f 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -2472,10 +2472,11 @@ static enum ndr_err_code extract_sids_from_buf(TALLOC_CTX *mem_ctx, *num = i; for (iter = sid_list, i = 0; iter; iter = iter->next, i++) { + struct dom_sid_buf buf; (*sids)[i] = iter->sid; DBG_DEBUG("quota SID[%u] %s\n", (unsigned int)i, - sid_string_dbg(&iter->sid)); + dom_sid_str_buf(&iter->sid, &buf)); } } err = NDR_ERR_SUCCESS; diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index f1148f2af8c..59cd020dbed 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -800,8 +800,9 @@ static canon_ace *dup_canon_ace( canon_ace *src_ace) static void print_canon_ace(canon_ace *pace, int num) { + struct dom_sid_buf buf; dbgtext( "canon_ace index %d. Type = %s ", num, pace->attr == ALLOW_ACE ? "allow" : "deny" ); - dbgtext( "SID = %s ", sid_string_dbg(&pace->trustee)); + dbgtext( "SID = %s ", dom_sid_str_buf(&pace->trustee, &buf)); if (pace->owner_type == UID_ACE) { dbgtext( "uid %u ", (unsigned int)pace->unix_ug.id); } else if (pace->owner_type == GID_ACE) { @@ -1193,9 +1194,11 @@ NTSTATUS unpack_nt_owners(struct connection_struct *conn, * reasonably */ *puser = get_current_uid(conn); } else { - DEBUG(3,("unpack_nt_owners: unable to validate" - " owner sid for %s\n", - sid_string_dbg(psd->owner_sid))); + struct dom_sid_buf buf; + DBG_NOTICE("unable to validate" + " owner sid for %s\n", + dom_sid_str_buf(psd->owner_sid, + &buf)); return NT_STATUS_INVALID_OWNER; } } @@ -1990,12 +1993,14 @@ static bool create_canon_ace_lists(files_struct *fsp, struct unixid unixid; if (!sids_to_unixids(¤t_ace->trustee, 1, &unixid)) { + struct dom_sid_buf buf; free_canon_ace_list(file_ace); free_canon_ace_list(dir_ace); TALLOC_FREE(current_ace); - DEBUG(0, ("create_canon_ace_lists: sids_to_unixids " - "failed for %s (allocation failure)\n", - sid_string_dbg(¤t_ace->trustee))); + DBG_ERR("sids_to_unixids failed for %s " + "(allocation failure)\n", + dom_sid_str_buf(¤t_ace->trustee, + &buf)); return false; } @@ -2080,31 +2085,37 @@ static bool create_canon_ace_lists(files_struct *fsp, current_ace->type = SMB_ACL_GROUP; } } else { + struct dom_sid_buf buf; /* * Silently ignore map failures in non-mappable SIDs (NT Authority, BUILTIN etc). */ if (non_mappable_sid(&psa->trustee)) { - DEBUG(10, ("create_canon_ace_lists: ignoring " - "non-mappable SID %s\n", - sid_string_dbg(&psa->trustee))); + DBG_DEBUG("ignoring " + "non-mappable SID %s\n", + dom_sid_str_buf( + &psa->trustee, + &buf)); TALLOC_FREE(current_ace); continue; } if (lp_force_unknown_acl_user(SNUM(fsp->conn))) { - DEBUG(10, ("create_canon_ace_lists: ignoring " - "unknown or foreign SID %s\n", - sid_string_dbg(&psa->trustee))); + DBG_DEBUG("ignoring unknown or " + "foreign SID %s\n", + dom_sid_str_buf( + &psa->trustee, + &buf)); TALLOC_FREE(current_ace); continue; } free_canon_ace_list(file_ace); free_canon_ace_list(dir_ace); - DEBUG(0, ("create_canon_ace_lists: unable to map SID " - "%s to uid or gid.\n", - sid_string_dbg(¤t_ace->trustee))); + DBG_ERR("unable to map SID %s to uid or " + "gid.\n", + dom_sid_str_buf(¤t_ace->trustee, + &buf)); TALLOC_FREE(current_ace); return false; } diff --git a/source3/smbd/service.c b/source3/smbd/service.c index a19b9734246..d7c85d8b6ca 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -284,8 +284,9 @@ static NTSTATUS find_forced_group(bool force_user, } if (!sid_to_gid(&group_sid, &gid)) { + struct dom_sid_buf buf; DEBUG(10, ("sid_to_gid(%s) for %s failed\n", - sid_string_dbg(&group_sid), groupname)); + dom_sid_str_buf(&group_sid, &buf), groupname)); goto done; } |