diff options
author | Chris Severance | 2019-03-10 22:09:30 -0400 |
---|---|---|
committer | Chris Severance | 2019-03-10 22:09:30 -0400 |
commit | b7e0364b96a04f9bf75ac59af120da6dc8a1b105 (patch) | |
tree | 3c521601b2a5913a4f4a1ed5bdf9869c79005cc8 | |
parent | f7538e37f5219ba3df4b404d1a3ec01fc114e3f1 (diff) | |
download | aur-b7e0364b96a04f9bf75ac59af120da6dc8a1b105.tar.gz |
autu: Update to 1.19-2
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | 0002-kernel-5.0.0-access_ok.patch | 124 | ||||
-rw-r--r-- | PKGBUILD | 11 |
3 files changed, 137 insertions, 4 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Wed Jul 4 18:10:17 UTC 2018 +# Mon Mar 11 02:09:29 UTC 2019 pkgbase = npreal2 pkgdesc = real tty driver for Moxa NPort serial console terminal server pkgver = 1.19 - pkgrel = 1 + pkgrel = 2 url = https://www.moxa.com/support/sarch_result.aspx?type=soft&prod_id=237&type_id=9 install = npreal2-install.sh arch = i686 @@ -22,9 +22,11 @@ pkgbase = npreal2 source = https://www.moxa.com/drivers/IDC_SW/DeviceServer/Driver/NPort%20Real%20TTY%20Driver%20for%20Linux/Mainline/ver1.19/npreal2_mainline_v1.19_build_17110917.tgz source = npreal2.sh source = 0001-mxmknod-folder-fix-and-chgrp-uucp.patch + source = 0002-kernel-5.0.0-access_ok.patch sha256sums = f99f38ef5618469a1d6f4824e41856616ee65ab8359069daa70d8d481f364462 sha256sums = 7241767fa8dead2dbe4cf4db32d39f5cf9d95b08f60daf79822ae306727af372 sha256sums = 7039ca0740be34a641424e3f57b896902f61fdfd2bfcc26e8e954035849e9605 + sha256sums = 211f3b0ba50452bfe6d39076eb1a60a7557dd038288fb8dcd4374886f4c2844e pkgname = npreal2 diff --git a/0002-kernel-5.0.0-access_ok.patch b/0002-kernel-5.0.0-access_ok.patch new file mode 100644 index 000000000000..c65bdc457d2e --- /dev/null +++ b/0002-kernel-5.0.0-access_ok.patch @@ -0,0 +1,124 @@ +--- npreal2.c.orig 2017-11-10 02:25:03.000000000 -0500 ++++ npreal2.c 2019-03-10 21:28:04.465949059 -0400 +@@ -1317,19 +1317,25 @@ static int npreal_ioctl(struct tty_struc + return(retval); + tty_wait_until_sent(tty, 0); + npreal_send_break(info, arg ? arg*(HZ/10) : HZ/4); + return(0); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,0,0) ++#define compat_access_ok(u,v,w) access_ok(v,w) ++#else ++#define compat_access_ok(u,v,w) access_ok(u,v,w) ++#endif ++ + case TIOCGSOFTCAR: +- error = access_ok(VERIFY_WRITE, (void *)arg, sizeof(long))?0:-EFAULT; ++ error = compat_access_ok(VERIFY_WRITE, (void *)arg, sizeof(long))?0:-EFAULT; + if ( error ) + return(error); + put_to_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long *)arg); + return 0; + + case TIOCSSOFTCAR: +- error = access_ok(VERIFY_READ, (void *)arg, sizeof(long))?0:-EFAULT; ++ error = compat_access_ok(VERIFY_READ, (void *)arg, sizeof(long))?0:-EFAULT; + if ( error ) + return(error); + get_from_user(templ,(unsigned long *)arg); + arg = templ; + #if (LINUX_VERSION_CODE < VERSION_CODE(3,7,0)) +@@ -1340,25 +1346,25 @@ static int npreal_ioctl(struct tty_struc + (arg ? CLOCAL : 0)); + #endif + return(0); + + case TIOCGSERIAL: +- error = access_ok(VERIFY_WRITE, (void *)arg, ++ error = compat_access_ok(VERIFY_WRITE, (void *)arg, + sizeof(struct serial_struct))?0:-EFAULT; + if ( error ) + return(error); + return(npreal_get_serial_info(info, (struct serial_struct *)arg)); + + case TIOCSSERIAL: +- error = access_ok(VERIFY_READ, (void *)arg, ++ error = compat_access_ok(VERIFY_READ, (void *)arg, + sizeof(struct serial_struct))?0:-EFAULT; + if ( error ) + return(error); + return(npreal_set_serial_info(info, (struct serial_struct *)arg)); + + case TIOCSERGETLSR: /* Get line status register */ +- error = access_ok(VERIFY_WRITE, (void *)arg, ++ error = compat_access_ok(VERIFY_WRITE, (void *)arg, + sizeof(unsigned int))?0:-EFAULT; + if ( error ) + return(error); + else + return(npreal_get_lsr_info(info, (unsigned int *)arg)); +@@ -1411,11 +1417,11 @@ static int npreal_ioctl(struct tty_struc + * Return: write counters to the user passed counter struct + * NB: both 1->0 and 0->1 transitions are counted except for + * RI where only 0->1 is counted. + */ + case TIOCGICOUNT: +- error = access_ok(VERIFY_WRITE, (void *)arg, ++ error = compat_access_ok(VERIFY_WRITE, (void *)arg, + sizeof(struct serial_icounter_struct))?0:-EFAULT; + if ( error ) + return(error); + cnow = info->icount; + p_cuser = (struct serial_icounter_struct *)arg; +@@ -3369,11 +3375,11 @@ npreal_net_ioctl ( + } + if (nd->flag & NPREAL_NET_DO_SESSION_RECOVERY) + len = nd->do_session_recovery_len; + else + len = (int)nd->cmd_buffer[2] + 3; +- rtn = access_ok( VERIFY_WRITE, (void *)arg, len)?0:-EFAULT; ++ rtn = compat_access_ok( VERIFY_WRITE, (void *)arg, len)?0:-EFAULT; + if ( rtn ) + { + goto done; + } + if (copy_to_user( (void *)arg, (void *)nd->cmd_buffer,len )) +@@ -3393,11 +3399,11 @@ npreal_net_ioctl ( + if (size < 2) + goto done; + if (size > 84) + size = 84; + +- rtn = access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; ++ rtn = compat_access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; + if ( rtn ) + { + goto done; + } + if (copy_from_user( (void *)rsp_buffer, (void *)arg,size)) +@@ -3518,11 +3524,11 @@ npreal_net_ioctl ( + int status; + + if (size != sizeof (status)) + goto done; + +- rtn = access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; ++ rtn = compat_access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; + if ( rtn ) + { + goto done; + } + status = (nd->flag & NPREAL_NET_TTY_INUSED) ? 1 : 0; +@@ -3543,11 +3549,11 @@ npreal_net_ioctl ( + break; + + if (size != sizeof (struct server_setting_struct)) + goto done; + +- rtn = access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; ++ rtn = compat_access_ok( VERIFY_READ, (void *)arg, size )?0:-EFAULT; + if ( rtn ) + { + goto done; + } + if (copy_from_user( (void *)&settings, (void *)arg,size)) @@ -23,6 +23,7 @@ _opt_defaultmode='666' # default: 666 # Todo: SSL connections should auto reconnect on Moxa restart # Todo: The default mode should be changed to 660 # Todo: mknod should be chgrp uucp +# Todo: When characters are held upstream by a low RTS, connecting to /dev/ttyr* brings RTS high too soon. The held characters are released but never come through to ttyr*. This does not happen with a TCP connection. # Enable and start service # systemctl enable --now 'npreal2.service' @@ -80,7 +81,7 @@ set -u pkgname='npreal2' #pkgver='1.18.49'; _commit='6d9ef0dbafd487595c4f5e4e5e64c1faba98d060' pkgver='1.19'; _build='17110917' -pkgrel=1 +pkgrel='2' pkgdesc='real tty driver for Moxa NPort serial console terminal server' _pkgdescshort="Moxa NPort ${pkgname} TTY driver" arch=('i686' 'x86_64') @@ -101,11 +102,13 @@ source+=('npreal2.sh') _patches=( #'0000-SSL-destroy-cf-configuration.patch' '0001-mxmknod-folder-fix-and-chgrp-uucp.patch' + '0002-kernel-5.0.0-access_ok.patch' # https://lkml.org/lkml/2019/1/4/418 ) source+=("${_patches[@]}") sha256sums=('f99f38ef5618469a1d6f4824e41856616ee65ab8359069daa70d8d481f364462' '7241767fa8dead2dbe4cf4db32d39f5cf9d95b08f60daf79822ae306727af372' - '7039ca0740be34a641424e3f57b896902f61fdfd2bfcc26e8e954035849e9605') + '7039ca0740be34a641424e3f57b896902f61fdfd2bfcc26e8e954035849e9605' + '211f3b0ba50452bfe6d39076eb1a60a7557dd038288fb8dcd4374886f4c2844e') if [ "${_opt_DKMS}" -ne 0 ]; then depends+=('linux' 'dkms' 'linux-headers') @@ -207,6 +210,10 @@ prepare() { #diff -pNau5 'mxmknod'{.orig,} > '0001-mxmknod-folder-fix-and-chgrp-uucp.patch' patch -Nbup0 -i "${srcdir}/0001-mxmknod-folder-fix-and-chgrp-uucp.patch" + #cp -p 'npreal2.c'{,.orig}; false + #diff -pNau5 'npreal2.c'{.orig,} > '0002-kernel-5.0.0-access_ok.patch' + patch -Nbup0 -i "${srcdir}/0002-kernel-5.0.0-access_ok.patch" + # Apply PKGBUILD options sed -e 's:^\(ttymajor\)=.*:'"\1=${_opt_ttymajor}:g" \ -e 's:^\(calloutmajor\)=.*:'"\1=${_opt_calloutmajor}:g" \ |