ftp(1): tls_close(3) handle TLS_WANT_POLLIN, TLS_WANT_PLLOUT

2017-03-01 Thread Sunil Nimmagadda
Hi, tls_close() could return TLS_WANT_POLLIN, TLS_WANT_POLLOUT as well. This diff repeats the call immediately. Ok? cvs server: Diffing . Index: fetch.c === RCS file: /cvs/src/usr.bin/ftp/fetch.c,v retrieving revision 1.161 diff -u -

Re: ftp doesn't close(2) the output file

2017-03-01 Thread Sunil Nimmagadda
Theo de Raadt writes: >> > Index: fetch.c >> > === >> > RCS file: /cvs/src/usr.bin/ftp/fetch.c,v >> > retrieving revision 1.161 >> > diff -u -p -r1.161 fetch.c >> > --- fetch.c28 Feb 2017 06:31:12 - 1.161 >> > +++ f

Re: ftp doesn't close(2) the output file

2017-03-01 Thread Sunil Nimmagadda
Stuart Henderson writes: > ftp doesn't close the output file after writing it. Normally you're > exiting anyway at that point so it doesn't really matter, but if you've > specified multiple URLs on the command line this leaks 1 FD per > requested file. Most noticable if you do some lazy benchark

Re: smtpd: more internal cleanups

2016-11-22 Thread Sunil Nimmagadda
Eric Faurot writes: > Hi. > > When using the internal io api, the caller had to explicitely reset an > io event in some cases (basically when data is buffered outside of an > io callback context) which could easily be missed. This has been the > cause of some of smtpd bugs in the past (hanging s

Re: smtpd: simplify internal io api

2016-11-21 Thread Sunil Nimmagadda
Eric Faurot writes: > The api user should not have to care about normalizing the io input > buffer (i.e. resetting the read/write pos in the buffer). > Do it internally when reloading the io event. > > Eric. Ok sunil@ > > Index: bounce.c > ===

Re: mg: Collect forked off children from M-| command

2016-09-07 Thread Sunil Nimmagadda
On Wed, Sep 07, 2016 at 12:05:22PM +, Mark Lumsden wrote: > Source Joachim Nilsson: > > Collect forked off children from M-| command > > Mg left zombies from commands executed when piping a region of text to > an external command. This patch makes sure to collect for the child >

Re: smtpd shutdown cleanup

2016-09-06 Thread Sunil Nimmagadda
On Tue, Sep 06, 2016 at 11:31:04PM +0200, Eric Faurot wrote: > Previously, all processes would shutdown on receiving SIGINT or SIGTERM. > When going down, the parent process would kill all the other process and > waitpid() them. > > Now, only the parent process handles SIGTERM and SIGINT, other pr

Re: Another step in cleaning the smtpd exit path.

2016-09-04 Thread Sunil Nimmagadda
On Sun, Sep 04, 2016 at 05:02:07PM +0200, Eric Faurot wrote: > > The smtpd processes are not expected to ever leave their event loop. > So stop pretending that the *_shutdown() functions could ever be called > in this context, and just fatal() if event_dispatch() returns. > > Eric. Ok sunil@

Re: [patch] mg: Prevent out-of-bounds read when PATH="/:..."

2016-01-19 Thread Sunil Nimmagadda
> On Tue, Jan 19, 2016 at 12:35:27PM +0100, Sunil Nimmagadda wrote: > > > > - dlen = strlen(dir); > > > - while (dir[dlen-1] == '/') > > > - dir[--dlen] = '\0'; /* strip trailing '/

Re: [patch] mg: Prevent out-of-bounds read when PATH="/:..."

2016-01-19 Thread Sunil Nimmagadda
Thank you for the diff. > I looked for more instances of the pattern that lead to reading one byte > before an allocated buffer in which(1) when PATH begins with "/:". I > found only one, in the function csexists() in usr.bin/mg/cscope.c. > + while ((dir = strsep(&path, ":")) != NULL) { > +

Re: makemap call in etc/mail/Makefile

2015-12-19 Thread Sunil Nimmagadda
> Hi OpenBSD devs, > > there is no more makemap[1]. > > [1]: http://www.openbsd.org/faq/current.html#20151207 That is smtpd(8)'s internal implementation of makemap as a seperate executable that got merged and not /usr/sbin/makemap. makemap(8) still exists and mailwrapper(8) would call an appropr

Re: [patch] mailwrapper: remove broken fallback code

2015-12-08 Thread Sunil Nimmagadda
> If /etc/mailer.conf doesn't exist, mailwrapper tries to run sendmail, > giving a confusing error message: > > mailwrapper: cannot exec /usr/libexec/sendmail/sendmail: No such > file or directory > > This patch removes this fallback code. I believe this is cleaner than > updating the fallback si

Re: http(1) An alternate implementation for a subset of ftp(1)

2015-08-17 Thread Sunil Nimmagadda
On Mon, Aug 17, 2015 at 06:06:17PM +0200, Sebastien Marie wrote: > Hi, > > I start reading your code, and I have a first remark. > > I see in main.c (at line 142 and next) that on redirection, you trust > the server for the filename. I am not sure it is a good thing to do. > > If the user reques

http(1) An alternate implementation for a subset of ftp(1)

2015-08-17 Thread Sunil Nimmagadda
Hi, http(1) is a drop-in substitute for ftp(1)'s "AUTO-FETCHING FILES" mode. It defaults to HTTP method when the url doesn't specify the protocol and supports transferring files from HTTP(S) and FTP servers. The FTP support is limited to file transfer and doesn't do command interpretation. It wor

pkg_add: Adjust problem detection

2015-08-15 Thread Sunil Nimmagadda
Hi, 213 is a valid return code from an FTP server for SIZE command and should not be treated as a problem. Alternate implementations of FETCH_CMD could provide a slightly different "Requesting " log lines. Would it be okay to relax the format a bit and ignore any line starting with "Requesting" i

Re: ftp(1) rewrite

2015-06-01 Thread Sunil Nimmagadda
On Thu, May 21, 2015 at 11:16:09PM -0400, Ted Unangst wrote: > Sunil Nimmagadda wrote: > > Hi, > > > > The idea is to start with the subset of ftp(1) functionality needed > > by pkg_add(1): > > > > ftp [-o output] url ... > > > > i.e., sh

ftp(1) rewrite

2015-05-21 Thread Sunil Nimmagadda
=== RCS file: ftp.c diff -N ftp.c --- /dev/null 1 Jan 1970 00:00:00 - +++ ftp.c 21 May 2015 18:23:37 - @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2015 Sunil Nimmagadda + * + * Permission to use, copy, modify, and distribute this

Re: Byte range implementation for httpd(8)

2015-05-03 Thread Sunil Nimmagadda
On Sat, May 02, 2015 at 02:49:30PM +, Florian Obser wrote: > Sorry for the very late reply, I'm currently very busy :/ Thank you for taking time to review it. A new patch with style nits fixed and a gratuitous NULL check removed. [trimming some text] > this is missing the server_file_method

Re: Byte range implementation for httpd(8)

2015-04-23 Thread Sunil Nimmagadda
Any interest/comments/suggestions for this diff... On Fri, Apr 17, 2015 at 05:04:01AM +0200, Sunil Nimmagadda wrote: > Range requests as defined in RFC7233 is required for resuming > interrupted http(s) downloads for example: > ftp -C http://foo.bar/install57.iso > > With this dif

Byte range implementation for httpd(8)

2015-04-16 Thread Sunil Nimmagadda
Range requests as defined in RFC7233 is required for resuming interrupted http(s) downloads for example: ftp -C http://foo.bar/install57.iso With this diff, httpd parses "Range" header in the requests and provide either 206(Partial Content) or 416(Range not Satisfiable) responses with "Content-Ran

tls_init(3): mention tls_accept_socket function

2014-12-23 Thread Sunil Nimmagadda
Hi, tls_accept_socket function missing in tls_init(3) manpage. Index: tls_init.3 === RCS file: /cvs/src/lib/libtls/tls_init.3,v retrieving revision 1.4 diff -u -p -r1.4 tls_init.3 --- tls_init.3 11 Nov 2014 04:17:34 - 1.4 +

mail(1): new ~i to ignore message headers unconditionally

2014-01-07 Thread Sunil Nimmagadda
There isn't a way to reply to a message without pulling in message headers as part of the body. This diff introduces a new tilde escape to ignore all the message headers regardless of ignore, retain commands. Comments? Index: collect.c =

list colon modifiers in mail(1) manpage

2013-07-12 Thread Sunil Nimmagadda
This diff adds colon modifiers which could be used to specify lists. Index: mail.1 === RCS file: /cvs/src/usr.bin/mail/mail.1,v retrieving revision 1.60 diff -u -p -r1.60 mail.1 --- mail.1 7 Nov 2010 08:05:56 - 1.60 +++

pop3 daemon with ssl/tls and STARTTLS, V2

2013-07-10 Thread Sunil Nimmagadda
Second iteration... 1. Fixed CRLF issues in RETR and TOP commands that caused message truncation. 2. Properly "byte stuff" a line beginning with termination character "." . 3. Implemented STLS and CAPA. (STARTTLS RFC 2595) Comments? Source: https://poolp.org/~sunil/pop3d.tar.gz uuencoded gzipped

Typo in imsg manpage

2012-10-21 Thread Sunil Nimmagadda
There is no struct by name buf. cvs diff: Diffing . Index: imsg_init.3 === RCS file: /cvs/src/lib/libutil/imsg_init.3,v retrieving revision 1.6 diff -u -p -r1.6 imsg_init.3 --- imsg_init.3 15 Jun 2012 23:44:43 - 1.6 +++ imsg_

Re: tinyscheme + mg

2012-06-28 Thread Sunil Nimmagadda
On Thu, Jun 28, 2012 at 10:05:49PM +0500, Mark Lumsden wrote: > > > I'd be a lot happier voicing an opinion in support of something like this > > > if I also saw diffs and interest in *using* them > > > to extend functionality later or replace some things easier to do with > > > scheme to make the

Re: cscope support in mg

2012-05-30 Thread Sunil Nimmagadda
ands corresponding to the mocklisp Index: cscope.c === RCS file: cscope.c diff -N cscope.c --- /dev/null 1 Jan 1970 00:00:00 - +++ cscope.c30 May 2012 16:41:25 - @@ -0,0 +1,612 @@ +/* + * Copyright (c) 2012 Sunil Nimmagadda

Re: Pipe text from mg to external command

2012-04-10 Thread Sunil Nimmagadda
A refined version of the diff with 2 less bugs and shorter by ~40 or so lines. Changes from previous version... Reuse region_get_data() to extract C string from selected region instead of custom line by line iteration, thereby reducing number of send(2) syscalls. Fix a bug which causes gratuitous

Re: Pipe text from mg to external command

2012-03-27 Thread Sunil Nimmagadda
This version implements some off-list review comments... 1. Discard explicit checking whether command exists and it's permissions since shell already does and reports error. 2. Remove unnecessary bzero call. 3. Document minor deviation from emacs behaviour in README. Index: README =

Re: Pipe text from mg to external command

2012-03-18 Thread Sunil Nimmagadda
Third attempt, and these are the changes done since the first version of this diff. 1. Check for existence of the command to be executed and also the permissions. 2. Replace popen(3) which messed stdout with socketpair(2), fork(2) and execl(2). 3. IO multiplexing using poll(2) to prevent dea

Re: Pipe text from mg to external command

2012-03-11 Thread Sunil Nimmagadda
This version properly captures data from external command and puts it into *Shell Command Output* buffer. These are the new commands added to mg with this diff... C-x h mark-whole-buffer M-| shell-command-on-region Comments? Index: buffer.c =

Re: cscope support in mg

2012-03-01 Thread Sunil Nimmagadda
1 Mar 2012 19:34:54 - @@ -0,0 +1,423 @@ +/* + * Copyright (c) 2012 Sunil Nimmagadda + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all

cscope support in mg

2012-02-29 Thread Sunil Nimmagadda
On Fri, Sep 02, 2011 at 02:23:28PM -0300, Christiano F. Haesbaert wrote: > On 2 September 2011 14:17, Matthew Dempsky wrote: > > On Fri, Sep 2, 2011 at 8:55 AM, Sunil Nimmagadda > > wrote: > >> This diff adds tags support to Mg. I am NOT an emacs user so if this >

Hooks in mg

2012-02-22 Thread Sunil Nimmagadda
null 1 Jan 1970 00:00:00 - +++ hookexec.c 22 Feb 2012 19:00:40 -0000 @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2012 Sunil Nimmagadda + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * co

Pipe text from mg to external command

2011-12-25 Thread Sunil Nimmagadda
This diff allows a user pipe text from current region in mg to external command. Also adds a command to mark whole buffer. Comments? Index: def.h === RCS file: /home/sunil/cvs/src/usr.bin/mg/def.h,v retrieving revision 1.118 diff -u -

Fix crash in pop-tag-mark of mg

2011-12-01 Thread Sunil Nimmagadda
pop-tag-mark crashes when the buffer's directory is different from mg's cwd. Steps to reproduce... generate some tags : # cd /usr/src/usr.bin/mg && cvs up && make && make install # cd /usr/src/sys && make tags use them : # mg /usr/src/sys/dev/softraid_crypto.c (for example) then M-x visit-tag-tabl

Re: ctags(1) and mg(1) again

2011-11-27 Thread Sunil Nimmagadda
splay a bunch of useful information about the current location of dot. @@ -835,6 +851,7 @@ terminal-specific startup file concise tutorial .El .Sh SEE ALSO +.Xr ctags 1 , .Xr vi 1 .Sh CAVEATS Since it is written completely in C, there is currently no Index: tags.c ====

Re: ctags(1) and mg(1) again

2011-11-23 Thread Sunil Nimmagadda
ode command. +.Pp +Unlike emacs which uses etags, +.Nm +can only understand tags generated by +.Xr ctags 1 . Index: tags.c ======= RCS file: tags.c diff -N tags.c --- /dev/null 1 Jan 1970 00:00:00 - +++ tags.c 24 Nov 2011 05:50:

Re: ctags(1) and mg(1) again

2011-11-14 Thread Sunil Nimmagadda
.Pp +Unlike emacs which uses etags, +.Nm +can only understand tags generated by +.Xr ctags 1 . Index: tags.c ======= RCS file: tags.c diff -N tags.c --- /dev/null 1 Jan 1970 00:00:00 - +++ tags.c 15 Nov 2011 04:02:53 - @

Re: ctags(1) and mg(1) again

2011-11-13 Thread Sunil Nimmagadda
is currently no @@ -846,3 +857,8 @@ In order to use 8-bit characters (such a needs to be disabled via the .Dq meta-key-mode command. +.Pp +Unlike emacs which uses etags, +.Nm +can only understand tags generated by +.Xr ctags 1 . Index: tags.c === RCS file: tags.c diff -N tags.c --- /d

Re: ctags(1) and mg(1) again

2011-11-07 Thread Sunil Nimmagadda
atus area. .It query-replace @@ -835,6 +843,7 @@ terminal-specific startup file concise tutorial .El .Sh SEE ALSO +.Xr ctags 1 , .Xr vi 1 .Sh CAVEATS Since it is written completely in C, there is currently no Index: tags.c ======= RCS file: tags.c diff -N tags.c --- /dev/null 1 Jan 1970 00:00:00 -

Re: ctags(1) and mg(1) again

2011-10-13 Thread Sunil Nimmagadda
l 1 Jan 1970 00:00:00 - +++ tags.c 13 Oct 2011 17:38:24 - @@ -0,0 +1,332 @@ +/* + * Copyright (c) 2011 Sunil Nimmagadda + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * cop

ctags(1) and mg(1) again

2011-10-09 Thread Sunil Nimmagadda
Hello, This time a little smaller and a simplified diff. A brief outline of what it does... 1) During mg startup it checks and loads a file named "tags" in pwd. 2) M-. would jump to the definition of identifier under cursor if it has an entry in tags file. 3) MS-* pops back to the location before

Re: ctags(1) and mg

2011-09-03 Thread Sunil Nimmagadda
On Sat, Sep 03, 2011 at 07:12:40PM +0300, Henri Kemppainen wrote: > > Being a little less stupid this time. Rewrote the string handling > > part, style(9) formatting and refactored pushtag function. > > Some thoughts about this. Are you sure you're not going to overflow > t in re_tag_conv when y

Re: ctags(1) and mg

2011-09-03 Thread Sunil Nimmagadda
On Fri, Sep 02, 2011 at 10:17:02AM -0700, Matthew Dempsky wrote: > On Fri, Sep 2, 2011 at 8:55 AM, Sunil Nimmagadda > wrote: > > This diff adds tags support to Mg. I am NOT an emacs user so if this > > combination is a bit odd then please excuse. It parses the tags file > &

ctags(1) and mg

2011-09-02 Thread Sunil Nimmagadda
Hello, This diff adds tags support to Mg. I am NOT an emacs user so if this combination is a bit odd then please excuse. It parses the tags file generated by ctags(1) and maintains a tree. M-. on first character of a word jumps to it's definition and M-* jumps back to previous location. Index: Ma