Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
for (i = 0; i < elems; i++) {
SMB_NTQUOTA_STRUCT qt;
SMB_NTQUOTA_LIST *list_item;
for (i = 0; i < elems; i++) {
SMB_NTQUOTA_STRUCT qt;
SMB_NTQUOTA_LIST *list_item;
if (!NT_STATUS_IS_OK(vfs_get_ntquota(fsp,
SMB_USER_QUOTA_TYPE,
if (!NT_STATUS_IS_OK(vfs_get_ntquota(fsp,
SMB_USER_QUOTA_TYPE,
- sid_to_uid(&sids[i], &list_item->uid);
+ ok = sid_to_uid(&sids[i], &list_item->uid);
+ if (!ok) {
+ char buf[DOM_SID_STR_BUFLEN];
+ dom_sid_string_buf(&sids[i], buf, sizeof(buf));
+ DBG_WARNING("Could not convert SID %s to uid\n", buf);
+ /* No idea what to return here... */
+ return NDR_ERR_INVALID_POINTER;
+ }
+
list_item->quotas = talloc_zero(list_item, SMB_NTQUOTA_STRUCT);
if (list_item->quotas == NULL) {
DBG_ERR("failed to allocate\n");
list_item->quotas = talloc_zero(list_item, SMB_NTQUOTA_STRUCT);
if (list_item->quotas == NULL) {
DBG_ERR("failed to allocate\n");