summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-02-25Remove "All rights reserved" from Oracle copyright noticesHEADmasterAlan Coopersmith3-3/+3
Oracle no longer includes this term in our copyright & license notices. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-29sessreg 1.1.3sessreg-1.1.3Alan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-16Fix -Wstringop-truncation warnings in safe_strncpy()Alan Coopersmith1-2/+3
In function ‘safe_strncpy’, inlined from ‘set_utmpx’ at sessreg.c:540:3, inlined from ‘main’ at sessreg.c:357:2: sessreg.c:204:11: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation] 204 | (void)strncpy(dest, src, n); | ^~~~~~~~~~~~~~~~~~~~~ In function ‘safe_strncpy’, inlined from ‘set_utmpx’ at sessreg.c:530:4, inlined from ‘main’ at sessreg.c:357:2: sessreg.c:204:11: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation] 204 | (void)strncpy(dest, src, n); | ^~~~~~~~~~~~~~~~~~~~~ In function ‘safe_strncpy’, inlined from ‘set_utmpx’ at sessreg.c:532:3, inlined from ‘main’ at sessreg.c:357:2: sessreg.c:204:11: warning: ‘strncpy’ specified bound 257 equals destination size [-Wstringop-truncation] 204 | (void)strncpy(dest, src, n); | ^~~~~~~~~~~~~~~~~~~~~ In function ‘safe_strncpy’, inlined from ‘set_utmpx’ at sessreg.c:540:3, inlined from ‘main’ at sessreg.c:357:2: sessreg.c:204:11: warning: ‘strncpy’ specified bound 32 equals destination size [-Wstringop-truncation] 204 | (void)strncpy(dest, src, n); | ^~~~~~~~~~~~~~~~~~~~~ In function ‘safe_strncpy’, inlined from ‘main’ at sessreg.c:423:5: sessreg.c:204:11: warning: ‘strncpy’ specified bound 8 equals destination size [-Wstringop-truncation] 204 | (void)strncpy(dest, src, n); | ^~~~~~~~~~~~~~~~~~~~~ In function ‘safe_strncpy’, inlined from ‘main’ at sessreg.c:425:5: sessreg.c:204:11: warning: ‘strncpy’ specified bound 16 equals destination size [-Wstringop-truncation] 204 | (void)strncpy(dest, src, n); | ^~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-10-16gitlab CI: stop requiring Signed-off-by in commitsAlan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-03Build xz tarballs instead of bzip2Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-12-03gitlab CI: add a basic build testAlan Coopersmith1-0/+98
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-11-28Fix spelling/wording issuesAlan Coopersmith3-4/+4
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-06-09sessreg 1.1.2sessreg-1.1.2Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-06-09Add comment about why safe_strncpy isn't replaced with strlcpyAlan Coopersmith1-0/+6
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-05-03Fix missing defines _PATH_WTMPX/_PATH_UTMPX in muslFabrice Fontaine1-0/+7
Downloaded from https://cgit.gentoo.org/proj/musl.git/tree/x11-apps/sessreg/files/sessreg-1.1.0-missing_path_wtmpx.patch Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de> [Retrieved from: https://git.buildroot.net/buildroot/tree/package/x11r7/xapp_sessreg/0001-missing_path_wtmpx.patch] Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2018-11-21Update configure.ac bug URL for gitlab migrationAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-11-16Update README for gitlab migrationAlan Coopersmith3-27/+21
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2018-09-13Replace strncpy calls with a sane version that always terminatesPeter Hutterer1-10/+18
Fixes coverity complaints about potentially unterminated strings Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2017-02-27sessreg 1.1.1sessreg-1.1.1Matt Turner1-1/+1
Signed-off-by: Matt Turner <mattst88@gmail.com>
2017-01-26autogen: add default patch prefixMihail Konev1-0/+3
Signed-off-by: Mihail Konev <k.mvc@ya.ru>
2017-01-26autogen.sh: use quoted string variablesEmil Velikov1-4/+4
Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent fall-outs, when they contain space. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2017-01-26autogen.sh: use exec instead of waiting for configure to finishPeter Hutterer1-1/+1
Syncs the invocation of configure with the one from the server. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-05-30Use off_t instead of long to make largefile support workEgbert Eich1-3/+3
We already use the macro AC_SYS_LARGEFILE in configure.ac. This will only work properly if the correct types are used as well: replace long by off_t when calculating file offsets - which makes a difference on 32-bit systems. http://bugzilla.opensuse.org/show_bug.cgi?id=981522 Signed-off-by: Egbert Eich <eich@suse.de> Found-by: Herbert Kütz <herbert.kuetz@ofd-z.niedersachsen.de> Reviewed-by: Stefan Dirsch <sndirsch@suse.de>
2015-10-07Pass -P to the preprocessor when generating filenames for the manpage.Stefan Dirsch1-1/+1
Fixes build with GCC 5. Patch by Richard Biener <rguenther@suse.com> Tested-by: Matt Turner <mattst88@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2015-01-19sessreg 1.1.0sessreg-1.1.0Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-11-14Include utmp.h if present, even if we're using utmpx interfacesAlan Coopersmith1-2/+4
For platforms which require type or structure definitions from utmp.h when using lastlog or utmpx/wtmpx interfaces. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-11-04Attempt to modernize and better disentangle utmp vs. utmpx in the man pageAlan Coopersmith3-18/+52
Also reduces the number of references to BSD vs. System V differences from the early 90's which are no longer relevant today. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-11-04Stop disabling utmpx & wtmpx calls when -u & -w arguments are passedAlan Coopersmith1-0/+8
The handling of the -u & -w flags would only set utmp_file & wtmp_file, leaving utmpx_file & wtmpx_file set to NULL, disabling the calls to the code to update those files. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-11-04If both utmp & utmpx interfaces are available, just use utmpxAlan Coopersmith1-1/+2
As we already do with wtmp & wtmpx, where only one of the interface sets is compiled in at a time, stop building & potentially calling both the utmp & utmpx interfaces, which could lead to confusion and corruption, especially when xdm passed -u /.../utmpx and sessreg wrote utmp format records to the file instead. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-11-03Zero initialize struct utmpx, as we already do for struct utmpAlan Coopersmith1-0/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-11-03Print which option was in error along with usage messageAlan Coopersmith2-19/+50
In the process, try to make the code a little less painful to read. Still, no love to whomever came up with (*++*a) style coding. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-06-02autogen.sh: Honor NOCONFIGURE=1Alan Coopersmith1-2/+3
See http://people.gnome.org/~walters/docs/build-api.txt Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-06-02configure: Drop AM_MAINTAINER_MODEAlan Coopersmith2-2/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-02-10sessreg 1.0.8sessreg-1.0.8Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-19Add -V option to print version numberAlan Coopersmith2-1/+7
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-01-19Combine usage message into a single stringAlan Coopersmith1-5/+7
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-12-16Fix some clang warnings about implicit conversionsAlan Coopersmith1-3/+3
sessreg.c:360:43: warning: implicit conversion changes signedness: 'unsigned long' to 'off_t' (aka 'long') [-Wsign-conversion] sysnerr (lseek(llog, (long) pwd->pw_uid*sizeof(ll), 0) ~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~ sessreg.c:360:25: warning: implicit conversion changes signedness: 'long' to 'unsigned long' [-Wsign-conversion] sysnerr (lseek(llog, (long) pwd->pw_uid*sizeof(ll), 0) ^~~~~~~~~~~~~~~~~~~ sessreg.c:405:7: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] i = strlen (line); ~ ^~~~~~~~~~~~~ sessreg.c:406:9: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] if (i >= sizeof (u->ut_id)) ~ ^ ~~~~~~~~~~~~~~~~~ sessreg.c:494:7: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] i = strlen (line); ~ ^~~~~~~~~~~~~ sessreg.c:495:9: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare] if (i >= sizeof (u->ut_id)) ~ ^ ~~~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-12-16Remove dubious code.Ed Schouten2-11/+0
The NO_UTMP definition is set on non-FreeBSD, non-OpenBSD, BSD-based systems. When looking at the commonly used BSD-based operating systems, they either use utmpx, or I can't think of a reason why the utmp code wouldn't work. If it turns out some obscure operating system breaks because of this change, we should replace this by something more accurate, such as an Autoconf check or an #ifdef specific to that operating system. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-12-16Make the `line' variable local to main().Ed Schouten1-1/+1
It is only used within main(). This prevents a compilation failure when building with -Wshadow. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-12-16Place NetBSD specific #defines in the proper place.Ed Schouten2-6/+7
For all the other databases (utmp, wtmp, lastlog) we already do it in sessreg.h. There's no reason why we should place the utmpx specific ones in sessreg.c. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-07-08Fix compilation on NetBSD - undefined *TMPX pathsThomas Klausner1-0/+7
Make sure file name defines exist on NetBSD. https://bugs.freedesktop.org/show_bug.cgi?id=50940 Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-10-21sessreg 1.0.7sessreg-1.0.7Alan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-26Add const attributes to fix gcc -Wwrite-strings warningsAlan Coopersmith1-4/+5
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-26Make lastlog work on BSD systems without <lastlog.h>.Ed Schouten3-19/+22
FreeBSD 8.x and lower have struct lastlog in <utmp.h>. Add a specific Autoconf check for struct lastlog, where we include both <utmp.h> and <lastlog.h>. Also, change NO_LASTLOG to a definition for the opposite; USE_LASTLOG. This is more consistent with USE_UTMP and USE_UTMPX. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-26Simply define LLOG_FILE and TTYS_FILE unconditionally.Ed Schouten1-12/+7
It doesn't matter if we define these pathnames, even if we're not going to use them in the code itself. It is already done that way for utmp and wtmp. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-26Fix whitespace inconsistencies.Ed Schouten1-9/+8
Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-26Just use time_t directly.Ed Schouten1-6/+5
There is no use for this #define (anymore). We can already assume that any decent system has time_t defined. It has to, otherwise struct utmp and struct utmpx can't even be defined. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-26Only expose the sflag variable when needed.Ed Schouten1-1/+2
The sflag variable is only used when using BSD-style utmp. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-26Get rid of SYSV definition. Just check for pututline().Ed Schouten2-13/+9
If the system provides pututline(), we just want to use that, instead of specifically checking for certain operating systems. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-26Don't forget to include <sys/types.h> before <utmp.h>.Ed Schouten1-1/+4
Some operating systems (e.g. FreeBSD) require <sys/types.h> to be included before <utmp.h>, because they depend on type definitions such as int32_t, time_t, etc. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-24Get rid of bzero() calls. Replace them by memset().Ed Schouten1-9/+9
bzero() is not part of POSIX; memset() is. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-24Use Autoconf to check for utmp field existence.Ed Schouten2-7/+17
Don't use the quirky SYSV and __QNX__ definitions to determine whether the utmp fields exist. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-24Only split off /dev/ instead trimming to last /.Ed Schouten1-7/+3
This prevents pseudo-terminals with names like /dev/pts/0 from getting trimmed to just 0 instead of pts/0. Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-24Fix typo in function name check.Ed Schouten1-1/+1
Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-06-24Correct whitespace and indentation.Ed Schouten2-95/+95
Signed-off-by: Ed Schouten <ed@80386.nl> Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>