diff options
author | Alan Brault <alan.brault@incruentatus.net> | 2011-05-02 18:58:40 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunk@stsci.edu> | 2012-05-25 14:21:08 -0400 |
commit | 0b20b98e9b2e87eb2e9e10f658d2d523b0ee9fb6 (patch) | |
tree | 942d28cad437dd20bf29cb60ad58ad4949b87c96 /src | |
parent | db970762d90a3adda07874ac597928f5305b0a49 (diff) | |
download | duser-0b20b98e9b2e87eb2e9e10f658d2d523b0ee9fb6.tar.gz |
Remove strcasestr() and strchrnul() checks from configure, using libdusercompat.a instead
Fix Makefile.am bad entry
Clean up compat, bring in strcasestr from OpenBSD and strchrnul from uclibc
and separate the headers.
Remove config.h from strchrnul.c; not needed
Fix numerous shadow declaration bugs that could cause problems for Solaris libc
Fix bad prototype using in unlink()
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/Makefile.in | 1 | ||||
-rw-r--r-- | src/log.c | 2 | ||||
-rw-r--r-- | src/user.c | 21 |
4 files changed, 13 insertions, 13 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index ecfb6de..db132b6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,5 @@ sbin_PROGRAMS= duser -LIBCOMPAT_LDADDS= $(top_builddir)/compat/libdusercompat.a - AM_CPPFLAGS= -I$(top_srcdir)/include duser_LDFLAGS= -L$(top_srcdir)/compat diff --git a/src/Makefile.in b/src/Makefile.in index 15a1e3a..7f1b5d6 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -189,7 +189,6 @@ target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -LIBCOMPAT_LDADDS = $(top_builddir)/compat/libdusercompat.a AM_CPPFLAGS = -I$(top_srcdir)/include duser_LDFLAGS = -L$(top_srcdir)/compat duser_SOURCES = duser.c \ @@ -43,7 +43,7 @@ int logcleanup() return status; } -int COM(const char* func, char *format, ...) +int COM(const char* func, const char *format, ...) { struct tm *logtm; time_t logtime = time(NULL); @@ -159,16 +159,16 @@ int user_del(record_t* rec) int bytes = 0; int bytes_total = 0; char buf[REGEX_MAX]; - char tmpfile[255]; - snprintf(tmpfile, sizeof(tmpfile), "/tmp/duser.%s.XXXXXX", basename(rec->file)); - if((fd = mkstemp(tmpfile)) < 0 || (tfp = fdopen(fd, "r+")) == NULL) + char _tmpfile[255]; + snprintf(_tmpfile, sizeof(_tmpfile), "/tmp/duser.%s.XXXXXX", basename(rec->file)); + if((fd = mkstemp(_tmpfile)) < 0 || (tfp = fdopen(fd, "r+")) == NULL) { if(fd != -1) { close(fd); - unlink(tmpfile); + unlink(_tmpfile); } - fprintf(stderr, "FATAL: %s: %s: %s\n", SELF, tmpfile, strerror(errno)); + fprintf(stderr, "FATAL: %s: %s: %s\n", SELF, _tmpfile, strerror(errno)); exit(1); } @@ -220,7 +220,10 @@ int user_del(record_t* rec) fclose(fp); close(fd); - unlink(tmpfile); + + /* unistd.h requires this be a (const char *) not (struct FILE * (*)(void)) */ + /* -- extrarius -- */ + unlink((const char *)tmpfile); if(bytes_total) return bytes_total; @@ -266,7 +269,7 @@ record_t* find_in_file(const char* filename, const char* needle) rptr->index = 0; rptr->match = 0; - int index = 0; + int _index = 0; FILE *fp; char *fname = strdup(filename); @@ -287,9 +290,9 @@ record_t* find_in_file(const char* filename, const char* needle) { snprintf(rptr->name, REGEX_MAX, "%s", cmp); rptr->match = 1; - rptr->index = index; + rptr->index = _index; } - index++; + _index++; processed.lines++; } |