Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Consultation】getservbyname alaways return NULL #41

Open
ZhongYi-LinuxDriverDev opened this issue Dec 10, 2022 · 1 comment
Open

Comments

@ZhongYi-LinuxDriverDev
Copy link

I'm having some problems with the ftplib library and would like to ask you for advice.
I failed to call Connect() in initramfs to log in to the FTP server.
I checked the code of ftplib.cpp and found that getservbyname() returned a failure.

if ((pse = getservbyname("ftp","tcp")) == NULL)
	{
		perror("getservbyname");
		free(lhost);
		return 0;
	}

However,Connect in romfs can successfully login to the ftp server
I tried to copy /etc/services from romfs to initramfs , but it still failed to log in.
I do not know what is wrong, Can you give me some suggestions?

@mkulke
Copy link
Owner

mkulke commented Jun 15, 2023

in initramfs there might not be a libc implementation to resolve the hostname?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants