Bug 15901 - smbclient allinfo returns NT_STATUS_OBJECT_NAME_NOT_FOUND
Summary: smbclient allinfo returns NT_STATUS_OBJECT_NAME_NOT_FOUND
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: libsmbclient (show other bugs)
Version: unspecified
Hardware: All All
: P5 regression (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-31 18:42 UTC by Nadeem Arif
Modified: 2025-08-31 18:42 UTC (History)
0 users

See Also:


Attachments
Before ignoring the NT_STATUS_OBJECT_NAME_NOT_FOUND - allinfo fails on Altname and returns,, instead of ignoring if we dont have altname as per the comment. (757 bytes, text/plain)
2025-08-31 18:42 UTC, Nadeem Arif
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nadeem Arif 2025-08-31 18:42:20 UTC
Created attachment 18698 [details]
Before ignoring the NT_STATUS_OBJECT_NAME_NOT_FOUND - allinfo fails on Altname and returns,, instead of  ignoring if we dont have altname as per the comment.

It appears that if the altname (8dot3name) is not set for the file for which this information is fetched, smbclient simply returns the error NT_STATUS_OBJECT_NAME_NOT_FOUND instead of ignoring if the altname is not available. 
I have gone through the allinfo method in source code and there's comment reflecting that this should be the case i.e. the altname should be ignored if not found.

Following is a snippet I'm referring to.

if (!NT_STATUS_IS_OK(status)) {
		d_printf("%s getting alt name for %s\n", nt_errstr(status),
			 name);
		/*
		 * Ignore not supported or not implemented, it does not
		 * hurt if we can't list alternate names.
		 */
		if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED) ||
		    NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED)) {
			altname[0] = '\0';
		} else {
			return false;
		}
	}

I tried ignoring the NT_STATUS_OBJECT_NAME_NOT_FOUND error just like the other two statuses and it seem to work find. I will attach the output for before and after change. 

Updated code looks like this 
if (!NT_STATUS_IS_OK(status)) {
		d_printf("%s getting alt name for %s\n", nt_errstr(status),
			 name);
		/*
		 * Ignore not supported or not implemented or object name not 
                 * found, it does not hurt if we can't list alternate names.
		 */
		if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_SUPPORTED) || 
		    NT_STATUS_EQUAL(status, NT_STATUS_NOT_IMPLEMENTED) ||
NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
			altname[0] = '\0';
		} else {
			return false;
		}
	}