MSYS2-packages/inetutils/17-talkd.patch
2014-12-12 14:42:56 +03:00

95 lines
2.9 KiB
Diff

diff -Naur inetutils-1.9.2-orig/talkd/acl.c inetutils-1.9.2/talkd/acl.c
--- inetutils-1.9.2-orig/talkd/acl.c 2013-09-26 12:36:38.000000000 +0300
+++ inetutils-1.9.2/talkd/acl.c 2014-12-12 11:55:13.867200000 +0300
@@ -332,6 +332,28 @@
level = -1; /* Enforce a deny rule. */
}
+ /* existence check */
+ if (access (filename, F_OK) != 0)
+ {
+ switch (errno)
+ {
+ case ENOENT:
+ /* no error message if user doesn't have a .talkrc file */
+ break;
+ default:
+ syslog (LOG_ERR, "con't open config file %s: %m", filename);
+ break;
+ }
+ return NULL;
+ }
+
+ /* read check */
+ if (access (filename, R_OK) != 0)
+ {
+ syslog (LOG_ERR, "con't open config file %s: %m", filename);
+ return NULL;
+ }
+
mark = acl_tail;
read_acl (filename, level);
free (filename);
diff -Naur inetutils-1.9.2-orig/talkd/announce.c inetutils-1.9.2/talkd/announce.c
--- inetutils-1.9.2-orig/talkd/announce.c 2013-09-26 12:36:38.000000000 +0300
+++ inetutils-1.9.2/talkd/announce.c 2014-12-12 11:55:13.867200000 +0300
@@ -88,7 +88,7 @@
}
static int
-print_mesg (char *tty, CTL_MSG * request, char *remote_machine)
+print_mesg (char *tty, CTL_MSG * request, const char *remote_machine)
{
time_t t;
LINE ln;
@@ -125,7 +125,7 @@
/* See if the user is accepting messages. If so, announce that
a talk is requested. */
int
-announce (CTL_MSG * request, char *remote_machine)
+announce (CTL_MSG * request, const char *remote_machine)
{
char *ttypath;
int len;
diff -Naur inetutils-1.9.2-orig/talkd/intalkd.h inetutils-1.9.2/talkd/intalkd.h
--- inetutils-1.9.2-orig/talkd/intalkd.h 2013-09-26 12:36:38.000000000 +0300
+++ inetutils-1.9.2/talkd/intalkd.h 2014-12-12 11:55:13.867200000 +0300
@@ -22,6 +22,13 @@
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#ifdef HAVE_OSOCKADDR_H
+# include <osockaddr.h>
+#else
+# ifndef HAVE_STRUCT_OSOCKADDR
+# include <protocols/osockaddr.h>
+# endif
+#endif
#include <protocols/talkd.h>
#include <netdb.h>
#include <syslog.h>
@@ -65,4 +72,4 @@
extern int new_id (void);
extern void read_acl (char *config_file, int system);
extern int acl_match (CTL_MSG * msg, struct sockaddr_in *sa_in);
-extern int announce (CTL_MSG * request, char *remote_machine);
+extern int announce (CTL_MSG * request, const char *remote_machine);
diff -Naur inetutils-1.9.2-orig/talkd/process.c inetutils-1.9.2/talkd/process.c
--- inetutils-1.9.2-orig/talkd/process.c 2013-10-29 13:38:56.000000000 +0300
+++ inetutils-1.9.2/talkd/process.c 2014-12-12 11:55:13.867200000 +0300
@@ -236,12 +236,14 @@
if (stat (ftty, &statb) == 0)
{
+#ifndef __CYGWIN__
if (!(statb.st_mode & S_IWGRP))
{
if (status != SUCCESS)
status = PERMISSION_DENIED;
continue;
}
+#endif
if (statb.st_atime > last_time)
{
last_time = statb.st_atime;