summaryrefslogtreecommitdiffstats
path: root/ax25/axspawn.c
Commit message (Collapse)AuthorAgeFilesLines
* axspawn: Fix missleading indentation.Ralf Baechle2017-01-261-1/+1
| | | | | | | | | | | axspawn.c:1777:4: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation] if (pw->pw_dir && *(pw->pw_dir)) ^~ axspawn.c:1779:5: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’ ret = chdir(p); ^~~ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* ax25/axspawn.c: Fix signedness compiler warnings.Ralf Baechle2015-06-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25_LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -g -O2 -Wall -MT axspawn.o -MD -MP -MF .deps/axspawn.Tpo -c -o axspawn.o axspawn.c axspawn.c: In function ‘decstathuf’: axspawn.c:595:9: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] srcptr = src; ^ axspawn.c:596:10: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] destptr = dest; ^ axspawn.c: In function ‘read_ax25’: axspawn.c:675:19: warning: pointer targets in passing argument 1 of ‘decstathuf’ differ in signedness [-Wpointer-sign] if (!decstathuf(s, decomp, len, &declen)) { ^ axspawn.c:584:5: note: expected ‘char *’ but argument is of type ‘unsigned char *’ int decstathuf(char *src, char *dest, int srclen, int *destlen) ^ axspawn.c:677:11: warning: pointer targets in passing argument 1 of ‘strcpy’ differ in signedness [-Wpointer-sign] strcpy(s, decomp); ^ In file included from axspawn.c:149:0: /usr/include/string.h:129:14: note: expected ‘char * restrict’ but argument is of type ‘unsigned char *’ extern char *strcpy (char *__restrict __dest, const char *__restrict __src) ^ axspawn.c:690:31: warning: pointer targets in passing argument 1 of ‘Strncasecmp’ differ in signedness [-Wpointer-sign] if (!huffman && !Strncasecmp(s, "//COMP ON\n", 10)) { ^ axspawn.c:498:5: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ int Strncasecmp(const char *s1, const char *s2, int n) ^ axspawn.c:704:10: warning: pointer targets in passing argument 1 of ‘strcpy’ differ in signedness [-Wpointer-sign] strcpy(s,"\n"); ^ In file included from axspawn.c:149:0: /usr/include/string.h:129:14: note: expected ‘char * restrict’ but argument is of type ‘unsigned char *’ extern char *strcpy (char *__restrict __dest, const char *__restrict __src) ^ axspawn.c:708:30: warning: pointer targets in passing argument 1 of ‘Strncasecmp’ differ in signedness [-Wpointer-sign] if (huffman && !Strncasecmp(s, "//COMP OFF\n", 11)) { ^ axspawn.c:498:5: note: expected ‘const char *’ but argument is of type ‘unsigned char *’ int Strncasecmp(const char *s1, const char *s2, int n) ^ axspawn.c:727:10: warning: pointer targets in passing argument 1 of ‘strcpy’ differ in signedness [-Wpointer-sign] strcpy(s,"\n"); ^ In file included from axspawn.c:149:0: /usr/include/string.h:129:14: note: expected ‘char * restrict’ but argument is of type ‘unsigned char *’ extern char *strcpy (char *__restrict __dest, const char *__restrict __src) ^ axspawn.c: In function ‘new_user’: axspawn.c:1101:5: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] q = strchr(p, '/'); ^ axspawn.c:1145:5: warning: pointer targets in assignment differ in signedness [-Wpointer-sign] p = q; ^ axspawn.c: In function ‘main’: axspawn.c:1557:17: warning: pointer targets in passing argument 1 of ‘read_ax25’ differ in signedness [-Wpointer-sign] if (read_ax25(buf, sizeof(buf)) < 0) ^ axspawn.c:662:5: note: expected ‘unsigned char *’ but argument is of type ‘char *’ int read_ax25(unsigned char *s, int size) ^ axspawn.c:1571:24: warning: pointer targets in passing argument 1 of ‘read_ax25’ differ in signedness [-Wpointer-sign] if ((cnt = read_ax25(buf, sizeof(buf)-1)) < 0) ^ axspawn.c:662:5: note: expected ‘unsigned char *’ but argument is of type ‘char *’ int read_ax25(unsigned char *s, int size) ^ axspawn.c:1655:19: warning: pointer targets in passing argument 1 of ‘read_ax25’ differ in signedness [-Wpointer-sign] cnt = read_ax25(buf, sizeof(buf)-1); ^ axspawn.c:662:5: note: expected ‘unsigned char *’ but argument is of type ‘char *’ int read_ax25(unsigned char *s, int size) ^ axspawn.c:1930:22: warning: pointer targets in passing argument 1 of ‘read_ax25’ differ in signedness [-Wpointer-sign] cnt = read_ax25(buf, sizeof(buf)); ^ axspawn.c:662:5: note: expected ‘unsigned char *’ but argument is of type ‘char *’ int read_ax25(unsigned char *s, int size) ^ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* axspawn: Remove unused variable command.Ralf Baechle2015-05-071-1/+0
| | | | | | | | | | | | | gcc -DHAVE_CONFIG_H -I. -I.. -DAX25_SYSCONFDIR=\""/usr/local/etc/ax25/"\" -DAX25 _LOCALSTATEDIR=\""/usr/local/var/ax25/"\" -g -O2 -Wall -MT axspawn.o -MD -MP -MF .deps/axspawn.Tpo -c -o axspawn.o axspawn.c [...] axspawn.c:1049:7: warning: unused variable ‘command’ [-Wunused-variable] char command[1024]; ^ [...] Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* Merge branch 'master' of git://git.linux-ax25.org/pub/scm/ralf/ax25-toolsRalf Baechle2015-05-021-473/+473
|\ | | | | | | | | Conflicts: ax25/axspawn.c
| * Insert space between `)' and a following `{'.Ralf Baechle2013-06-171-1/+1
| | | | | | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
| * Reformat consistently. Strictly whitespace changes only.Ralf Baechle2013-06-171-236/+236
| | | | | | | | | | | | | | Indentation by tabs only. Move case labels in switches are on the same level as the switch keyword. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
| * Always have a space between if, for, switch, while and the following `('.Ralf Baechle2013-06-171-3/+3
| | | | | | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
| * Remove parenthesis around arguments of return statements.Ralf Baechle2013-06-171-12/+12
| | | | | | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
| * Use tabs for indentation, not spaces.Ralf Baechle2013-06-171-154/+154
| | | | | | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
| * Remove useless initializations to 0 or NULL.Ralf Baechle2013-06-171-9/+9
| | | | | | | | | | | | | | They only inflate the .data section of the binary. Initializations to FALSE are still left to do. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
| * Nuke trailing whitespace.Ralf Baechle2013-06-171-71/+71
| | | | | | | | Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* | Found debian wheezy useradd bug: useradd did terminates and eats 100%Thomas Osterried2015-05-011-10/+78
|/ | | | | | | | | | | | | | | | | | | cpu power, if it was called from axspawn. This could be prevented if SIGCHLD is masked. To increase security, no longer call useradd via system() but fork() and execve(). Fixed a bug when useradd failed then the login process continued anyway. Empty lines in axspawn.conf are now valid. The user_shell config variable is optional. If not specified, /bin/bash is used. Except: if create_with_useradd is configured and there's a config file /etc/default/useradd, then it's not passed to useradd in order to let him choose. Signed-off-by: Thomas Osterried <ax25@x-berg.in-berlin.de>
* Weed out all use of RCS strings.Ralf Baechle2013-06-061-3/+0
| | | | | | | Their value has always been dubious and git doesn't support them so let's get rid of the clutter. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
* call setsid() only if we are not already the process group leaderThomas Osterried2011-08-181-2/+6
|
* Removed check for return value of setsid(). If it's alreadyThomas Osterried2011-08-181-3/+2
| | | | process group leader, setsid() fails.
* Fix for CVE-2011-2910: check return status of setuid(), ..Thomas Osterried2011-08-181-2/+3
|
* Christoph Rueckert <dk2crn> had an issue with OpenSuse 11.2.Thomas Osterried2010-03-311-3/+3
| | | | | | | | | | login -f -h <protocol> <as_user> did not work. login -h <protocol> -f <as_user> did work. Imho, OpenSUSE meessed up login's getopt()... On the other hand, we have no problems to switch the position of arguments - as long as there's not another linux demanding another position ;)
* Convert spelling of Joerg Reuter's name from umlaut to oe.Ralf Baechle2009-06-271-2/+2
| | | | | In a world that is caught between ISO 8859-1, ISO 8859-15 and UTF-8 non-ASCII characters are a guaranteed mess, still.
* Remove use of backwards compatibility header name.Ralf Baechle2009-06-211-9/+1
| | | | | | Glibc as old as 2.2 provides working headers under the right name and if not libax25 would install headers under the right name so this has become redundant and ugly.
* Fix type of length argument to sockset syscalls.Ralf Baechle2009-06-141-3/+5
| | | | | | | | Various socket syscalls receive a length argument that should be a socklen_t rsp. a ptr to a socklen_t but instead int rsp. ptr to int were being passed. While in theory this was a bug it's harmless as dangerously large values would not be used but the issue manifested itself in a significant number of compilation warnings.
* Fix utmp time codeRalf Baechle2009-06-141-4/+10
| | | | | | | | | | | | | | | | | | | Thanks to using the antiquated time(2) call the microsecond field of the struct utmp being manipulated was never initialized resulting in random values. On some 64-bit systems this also manifested itself in below warnings. axspawn.c: In function ‘cleanup’: axspawn.c:1017: warning: passing argument 1 of ‘time’ from incompatible pointer type /usr/include/time.h:186: note: expected ‘time_t *’ but argument is of type ‘int32_t *’ [...] axspawn.c: In function ‘main’: [...] axspawn.c:1693: warning: passing argument 1 of ‘time’ from incompatible pointer type /usr/include/time.h:186: note: expected ‘time_t *’ but argument is of type ‘int32_t *’ Fixed by changing it to the recommended initialization sequenze based on gettimeofday().
* bugfix: write_ax25(line, ..) segfaultet if line is static char[].Thomas Osterried2008-11-081-6/+14
|
* fix: strncpy(ut.ut_id, tty + 3, sizeof(ut.ut_id)); // was ↵Thomas Osterried2008-10-221-2/+2
| | | | sizeof(ut.ut_line) with size = 12, wheras ut_id is 4.
* get_assoc(): file handle of fopen(PROC_AX25_CALLS_FILE, "r") wasThomas Osterried2008-10-101-1/+3
| | | | never closed.
* typo: embeded is embeddedThomas Osterried2008-04-131-6/+6
|
* axspawn on embeded systems like openwrt:Thomas Osterried2008-04-131-33/+103
| | | | | | | | | | | | on those systems, things are not as you expect. i.e., /bin/login is a shell script and implements boot-specific actions only (login without root password, etc..). The assumption that /bin/login -f username causes user as uid > 0 to login is wrong; user may gain root rights. axspawn now implements partially (thus, in the important points) what login assures. axspawn should be involked with the option --embeded when called from ax25d.
* new feature: bcpasswd authentication type "unix".Thomas Osterried2008-02-161-3/+7
| | | | | user has now also the choice to use the standard unix passwd/shadow authentication
* - bugfix: if /etc/skel/.profile exists, and /etc/ax25/ax25.profile,Thomas Osterried2007-03-111-4/+41
| | | | | | | | | | then .profile is copied, and without deletion the contense of ax25.profile is overwritten. to .profile. This lead to garbage. - Some useradd implementations refuse to add the user if his homedir already exists. But we need the function which builds the subtree /home/hams/dl9.../, because useradd does not make the missing subdirs by itself (instead, it's a severe error condition for useradd)
* Nuke K&R style non-prototypes ...Ralf Baechle2007-01-231-11/+3
|
* Fix warnings about // style comment. And remove some of the mostRalf Baechle2007-01-231-11/+20
| | | | pointless comments.
* assure to free pwd from read_pwd()Thomas Osterried2006-12-161-2/+10
|
* useradd now with "-s shell" option under special circumstancesThomas Osterried2006-12-101-3/+19
|
* fix: user_changed preinitialization was wrongThomas Osterried2006-06-101-2/+2
|
* login ... -h <protocol> .. - for nicer wtmpThomas Osterried2006-06-101-1/+3
|
* \n problem in in the bcpasswd part while sending messagesThomas Osterried2006-04-151-6/+6
| | | | intr = ^C as stty setting
* md5 and sys authentication via /etc/ax25/bcpasswd and $HOME/bcpasswd.Thomas Osterried2006-04-091-40/+157
| | | | | Documented in axspawn.8 Thanks to Christoph <dk2crn> for contribution.
* - fdlock(): fixed potential lock due to return without unlockThomas Osterried2005-12-101-11/+63
| | | | | | | | | - new password methods (read pwcheck for more info) - mode for homedirectory: new config option secure_home. if not set, new homedirectories become drwxr-xr-x if set, new homedirectories become drwx-----x. other=x, because otherwise uses would be iritating that for e.g. their public_html is not accessable..
* - fixed bug when downloading large messages (where linux kernel returnsThomas Osterried2005-10-301-91/+768
| | | | | | | | | -EAGAIN, when buffers get empty, which leaded to data loss) - fixed bug when '\r\n' was splited into two reads (trailing \r in the first read, starting \n in the second read) -> resulted in an empty line - better FD_SET(&fdread) handling - added //COMP hufman compression - could make use of the useradd(8) program for generating new accounts
* used PF_PACKET for SOCK_PACKET sockets, added time.h to axspawn.cMichael Taylor2002-11-031-1/+2
|
* Import ax25-tools 0.0.3 from tarballax25-tools-0.0.3Ralf Baechle1999-07-081-1/+1
|
* Import ax25-tools 0.0.2 from tarballax25-tools-0.0.2Ralf Baechle1999-06-071-0/+11
|
* Import ax25-tools 0.0.1 from tarballax25-tools-0.0.1Ralf Baechle1999-04-211-0/+911