troglobit / uftpd

FTP/TFTP server for Linux that just works™
https://troglobit.com/projects/uftpd/
ISC License
182 stars 32 forks source link

Doesn't seem to compile #21

Closed rgpublic closed 5 years ago

rgpublic commented 5 years ago
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 commented 5 years ago

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.

rgpublic commented 5 years ago

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 commented 5 years ago

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

troglobit commented 5 years ago

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

rgpublic commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

troglobit commented 5 years ago

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

https://github.com/troglobit/uftpd/blob/04ea51c7fba5bdffc9cd5e89d0201ac7a40d3b5b/src/ftpcmd.c#L257-L266

Patches welcome ;-)

rgpublic commented 5 years ago

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 :-(

https://github.com/rgpublic/uftpd/commit/936f1fcc204ba0152b0cf217919e5963c097a7ea

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

troglobit commented 5 years ago

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.