A warning is issued at make. Is it because of this part?
C If you compile and run a source, the local time (KST) will be displayed normally.
Here is the test source.
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int main(){
time_t _time;
struct tm *ptm;
char* chrtime;
_time = time((time_t *)0);
printf("time() : %ld\n",_time);
ptm = gmtime(&_time);
printf("gmtime() : %d.%d.%d %d:%d:%d\n",ptm->tm_year,ptm->tm_mon+1,ptm->tm_mday,ptm->tm_hour,ptm->tm_min,ptm->tm_sec);
ptm = localtime(&_time);
printf("localtime() : %d.%d.%d %d:%d:%d\n",ptm->tm_year,ptm->tm_mon+1,ptm->tm_mday,ptm->tm_hour,ptm->tm_min,ptm->tm_sec);
_time = mktime(ptm);
printf("mktime() : %ld\n",_time);
chrtime = asctime(ptm);
printf("asctime() : %s",chrtime);
chrtime = ctime(&_time);
printf("ctime() : %s",chrtime);
return 0;
}
=======================================================
smbftpd source compile....
# ./configure --with-iconv
O_EXLOCK.............. [NO]
FD_COPY............... [NO]
TCP Wrapper........... [YES]
Have printflike....... [NO]
pw_expire............. [NO]
bsd glob.............. [NO]
user_from_uid......... [NO]
Shadow passowd........ [YES]
Linux sendfile........ [YES]
Use PAM............... [YES]
Check setproctitle.... [NO]
Check sin_len......... [NO]
Check IPv6 support.... [YES]
Check iconv support .. [YES]
Finished configure.
# make
===> auth
make -C auth
make[1]: Entering directory `/root/smbftpd-2.7/auth'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/auth'
<=== auth
===> restrict
make -C restrict
make[1]: Entering directory `/root/smbftpd-2.7/restrict'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/restrict'
<=== restrict
===> cmd
make -C cmd
make[1]: Entering directory `/root/smbftpd-2.7/cmd'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/cmd'
<=== cmd
===> ssl
make -C ssl
make[1]: Entering directory `/root/smbftpd-2.7/ssl'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/ssl'
<=== ssl
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c -o misc.o misc.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c -o param.o param.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c -o reply.o reply.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c -o log.o log.c
log.c: In function ‘smbftpd_logwtmp’:
log.c:163:2: warning: passing argument 1 of ‘gettimeofday’ from incompatible pointer type [enabled by default]
gettimeofday(&ut.ut_tv, NULL);
^
In file included from /usr/include/utmpx.h:22:0,
from log.c:15:
/usr/include/sys/time.h:72:12: note: expected ‘struct timeval * __restrict__’ but argument is of type ‘struct <anonymous> *’
extern int gettimeofday (struct timeval *__restrict __tv,
^
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c -o proctitle.o proctitle.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c -o share.o share.c
cc -c -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include ftpcmd.c
ftpcmd.c:96:25: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls]
#else
^
ftpcmd.c:116:12: note: in expansion of macro ‘YYPARSE_DECL’
^
In file included from ftpcmd.y:76:0:
./include/smbftpd.h:219:5: note: previous declaration of ‘yyparse’ was here
int yyparse(void);
^
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c -o main.o main.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c -o pwcache.o pwcache.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c -o oob.o oob.c
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c -o unicode.o unicode.c
unicode.c: In function ‘smbftpd_codepage2unicode’:
unicode.c:90:2: warning: passing argument 2 of ‘iconv’ from incompatible pointer type [enabled by default]
if (-1 == iconv(codepage2unicode, &inbuf, &inlen, &outbuf, &outlen)) {
^
In file included from unicode.c:13:0:
/usr/include/iconv.h:42:15: note: expected ‘char ** __restrict__’ but argument is of type ‘const char **’
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
^
unicode.c: In function ‘smbftpd_unicode2codepage’:
unicode.c:120:2: warning: passing argument 2 of ‘iconv’ from incompatible pointer type [enabled by default]
if (-1 == iconv(unicode2codepage, &inbuf, &inlen, &outbuf, &outlen)) {
^
In file included from unicode.c:13:0:
/usr/include/iconv.h:42:15: note: expected ‘char ** __restrict__’ but argument is of type ‘const char **’
extern size_t iconv (iconv_t __cd, char **__restrict __inbuf,
^
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c -o textuser.o textuser.c
cc -o smbftpd misc.o param.o reply.o log.o proctitle.o share.o ftpcmd.o main.o pwcache.o oob.o unicode.o textuser.o -L./cmd -lcmd -L./restrict -lrestrict -L./auth -lauth -L./ssl -lftpssl -lcrypt -lwrap -lpam
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include -c smbftpd-user.c -o smbftpd-user.o
cc -O2 -Wall -Wshadow -Wredundant-decls -pipe -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I./include smbftpd-user.o -o smbftpd-user misc.o param.o share.o textuser.o unicode.o -L./auth -lauth -lcrypt -L./restrict -lrestrict -lwrap -lpam
# make install
===> auth
make -C auth
make[1]: Entering directory `/root/smbftpd-2.7/auth'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/auth'
<=== auth
===> restrict
make -C restrict
make[1]: Entering directory `/root/smbftpd-2.7/restrict'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/restrict'
<=== restrict
===> cmd
make -C cmd
make[1]: Entering directory `/root/smbftpd-2.7/cmd'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/cmd'
<=== cmd
===> ssl
make -C ssl
make[1]: Entering directory `/root/smbftpd-2.7/ssl'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/root/smbftpd-2.7/ssl'
<=== ssl
cc -o smbftpd misc.o param.o reply.o log.o proctitle.o share.o ftpcmd.o main.o pwcache.o oob.o unicode.o textuser.o -L./cmd -lcmd -L./restrict -lrestrict -L./auth -lauth -L./ssl -lftpssl -lcrypt -lwrap -lpam
[ -d /usr/local/bin ] || install -d /usr/local/bin
[ -d /usr/local/sbin ] || install -d /usr/local/sbin
[ -d /usr/local/etc/smbftpd ] || install -d /usr/local/etc/smbftpd
install -c -m 755 -s smbftpd /usr/local/sbin/
install -c -m 755 -s smbftpd-user /usr/local/bin/
install -d -m 755 /usr/local/etc/smbftpd/ssl.crt
install -d -m 755 /usr/local/etc/smbftpd/ssl.csr
install -d -m 755 /usr/local/etc/smbftpd/ssl.key
install -c -m 400 cert/conf/ssl.crt/ca.crt /usr/local/etc/smbftpd/ssl.crt/
install -c -m 400 cert/conf/ssl.crt/server.crt /usr/local/etc/smbftpd/ssl.crt/
install: cannot stat ‘cert/conf/ssl.crt/server.crt’: No such file or directory
install -c -m 400 cert/conf/ssl.csr/ca.csr /usr/local/etc/smbftpd/ssl.csr/
install -c -m 400 cert/conf/ssl.csr/server.csr /usr/local/etc/smbftpd/ssl.csr/
install: cannot stat ‘cert/conf/ssl.csr/server.csr’: No such file or directory
install -c -m 400 cert/conf/ssl.key/ca.key /usr/local/etc/smbftpd/ssl.key/
install -c -m 400 cert/conf/ssl.key/server.key /usr/local/etc/smbftpd/ssl.key/
Is there anything that needs to be done separately to use the system account?
I am using smbftpd-user to create another ftp account.
You want to use a system account instead of a separate account.
# more config.h
/* Copyright 2003-2015 Wang, Chun-Pin All rights reserved. */
#ifndef _SMBFTPD_CONFIG_H_
#define _SMBFTPD_CONFIG_H_
#define SMBFTPD_VERSION "SmbFTPD Ver 2.7"
#define PATH_CONFIG "/usr/local/etc/smbftpd"
#define NET_BUF_SIZE 65536
#undef HAVE_EXLOCK
#undef HAVE_FDCOPY
#define HAVE_TCPWRAPPER
#undef HAVE_PRINTFLIKE
#undef HAVE_PWEXPIRE
#undef HAVE_BSDGLOB
#undef HAVE_PWCACHE
#define HAVE_SHADOW_H
#define HAVE_SENDFILE
#define HAVE_LINUX_SENDFILE
#define USE_PAM
#undef HAVR_SETPROCTITLE
#undef HAVE_SI_LEN
#undef WITH_MYSQL
#undef WITH_PGSQL
#undef WITH_SSL
#undef WITH_SSL_ECC
#define WITH_ICONV
#define INET6
#endif /* _SMBFTPD_CONFIG_H_ */
./configure --with-iconv
O_EXLOCK.............. [NO]
FD_COPY............... [NO]
TCP Wrapper........... [YES]
Have printflike....... [NO]
pw_expire............. [NO]
bsd glob.............. [NO]
user_from_uid......... [NO]
Shadow passowd........ [YES]
Linux sendfile........ [YES]
Use PAM............... [YES]
Check setproctitle.... [NO]
Check sin_len......... [NO]
Check IPv6 support.... [YES]
Check iconv support .. [YES]
Finished configure.
xfer.log size is 0byte, as empty.
smbftpd.log is saved ftp transfer log.