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

Doesn't seem to compile #21

Closed
rgpublic opened this issue Jul 3, 2019 · 10 comments
Closed

Doesn't seem to compile #21

rgpublic opened this issue Jul 3, 2019 · 10 comments

Comments

@rgpublic
Copy link

rgpublic commented Jul 3, 2019

checking for getsubopt... yes
checking for gettimeofday... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
./configure: line 4351: syntax error near unexpected token `uev,'
./configure: line 4351: `PKG_CHECK_MODULES(uev,  libuev >= 2.2.0)'

I did a clone of all 3 projects and then did this:

#!/bin/bash

cd libuev
./autogen.sh
./configure
make
make install
cd ..

cd libite
./autogen.sh
./configure
make
make install
cd ..

cd uftpd
./autogen.sh
./configure
make
make install
cd ..
@troglobit
Copy link
Owner

troglobit commented Jul 3, 2019

What system did you try to build it on? There are some caveats for non-Debian/Ubuntu Linux based systems.

Update: I just pushed a minor update to the README, detailing the requirement on the pkg-config tool. Hopefully that's the root cause of your problems.

troglobit added a commit that referenced this issue Jul 3, 2019
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
@rgpublic
Copy link
Author

rgpublic commented Jul 3, 2019

Ubuntu Disco. I'm compiling inside a docker container. My ultimate goal BTW is to create a static build which I can then transfer to our real server and use there without creating a mess there with all the build packages.

@rgpublic
Copy link
Author

rgpublic commented Jul 3, 2019

Ah. Hooray. Brilliant. Your pkg-config tip was the right one. I hadn't installed this package. Thanks a lot!

@rgpublic rgpublic closed this as completed Jul 3, 2019
@troglobit
Copy link
Owner

Great! I'll add a check + warning to the configure script :-)

troglobit added a commit that referenced this issue Jul 3, 2019
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
@rgpublic
Copy link
Author

rgpublic commented Jul 3, 2019

Wow, this is really cool. I'm so happy I discovered this tool. If anyone else is interested: You can very simply create a static build with (perhaps you'd also want to mention this in the README, @troglobit):
./configure --LDFLAGS=-static
This flag is only needed for uftpd, not for the libuev/libite libraries. Voilà, an only 1.4 MB sized complete FTP server you can take anywhere you want. Amazing! No more terrible VSFTPd confusing you with hundreds of crazy options.

@rgpublic
Copy link
Author

rgpublic commented Jul 3, 2019

Ah, unfortunately, there's still some remaining problem: Everything seems to work but I just cannot authenticate. No matter which credentials (user/password) I try, uftpd always says: "Guest login OK" and then I'm in an empty folder. I wonder if it's due to these messages here during static build:

/usr/bin/ld: uftpd-common.o: in function `new_session':
/usr/src/uftpd/src/common.c:252: warning: Using 'initgroups' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: uftpd-uftpd.o: in function `init':
/usr/src/uftpd/src/uftpd.c:171: warning: Using 'getpwnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: uftpd-uftpd.o: in function `find_port':
/usr/src/uftpd/src/uftpd.c:131: warning: Using 'getservbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

Although all shared libraries should be available, because it's the same distro... Hmmm. Scratches head. And I wonder why any credentials are accepted. Shouldn't only the user "ftp" and corresponding UNIX password be allowed?

@rgpublic
Copy link
Author

rgpublic commented Jul 3, 2019

Suddenly it works. I can list files. But even worse: Any password is accepted. Is this normal?

@troglobit
Copy link
Owner

troglobit commented Jul 4, 2019

Yup, there is no user or password handling at all. That is one of the things that make uftpd really small.

uftpd/src/ftpcmd.c

Lines 257 to 266 in 04ea51c

static int check_user_pass(ctrl_t *ctrl)
{
if (!ctrl->name[0])
return -1;
if (!strcmp("anonymous", ctrl->name))
return 1;
return 0;
}

Patches welcome ;-)

@rgpublic
Copy link
Author

rgpublic commented Jul 4, 2019

Ah, I see. I thought at least the FTP user's password is checked. A bit sad, because I think it rules out a lot of use-cases like mine where I just wanted to give someone temporary access to our server to fix some specific problem. Although I'm not only a C novice and this language always frightens me a bit, I tried to be brave and add this feature. I thought I got pretty close, but now it just hangs after receiving the username. Hmmm :-(

rgpublic@936f1fc

Any hints on what may be wrong are very welcome :-)

@troglobit
Copy link
Owner

Yeah C can be a bit frightening, but I think you made a good job of it! :)

I posted a comment in the patch, I hope I'm not completely off base. For an official feature it needs a bit more work, but otherwise it looks good.

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