Re: ftp: don't close fin or s twice

2018-02-06 Thread sunil+tech
Stuart Henderson wrote: > Regarding ftp(1), it would be nice to get more eyes on sunil@'s rewrite, > apart from anything else it fixes problems with some servers (like > ftp.tug.org) > that don't work with the existing code.. Hi, For folks on tech@, the latest code is at

softraid: missing keydisk message

2017-11-10 Thread sunil+tech
Hi, boot(8) displays "unknown KDF type 2" if the keydisk is missing... >> OpenBSD/amd64 BOOT 3.33 unknown KDF type 2 open(sr0a:/etc/boot.conf): Operation not permitted boot> The following diff makes boot(8) display slightly better information... >> OpenBSD/amd64 BOOT 3.33 missing keydisk open(sr0

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
the past (hanging sessions). > > After the recent changes, it's now possible to make it a lot simpler > by triggering an event reload internally when data is queued. So the > api user does not have to worry about it. >

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@ >

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

2016-09-07 Thread Sunil Nimmagadda
lect for the child > before returning. > > Looks ok to me. ok? Ok sunil@

Re: smtpd shutdown cleanup

2016-09-06 Thread Sunil Nimmagadda
sg socket is closed > (except for client connection on the control socket of course). That's how > they are supposed to stop now. When doing so, they log as "debug" instead > of "info" because useless logs are useless. > > This makes the shutdown sequence much saner. > > Eric. Ok sunil@

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/po

Re: pop3 daemon with ssl

2013-06-26 Thread sunil
; in > > > /etc/ssl/private to run. Tested with fdm, fetchmail, getmail, mutt > > > packages and mail clients on Andriod, iPhone and Nokia(symbian). > > > > > > Comments? > > > > > > Source: https://poolp.org/~sunil/pop3d.tar.gz > > >

pop3 daemon with ssl

2013-06-26 Thread sunil
ot; in /etc/ssl/private to run. Tested with fdm, fetchmail, getmail, mutt packages and mail clients on Andriod, iPhone and Nokia(symbian). Comments? Source: https://poolp.org/~sunil/pop3d.tar.gz mercurial repository: https://bitbucket.org/nimsun/pop3d/src uuencoded gzipped tar file follows. begin 644 po

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
is a diff with #defines and also does pretty printing of lines in cscope buffer like emacs. Index: Makefile === RCS file: /home/sunil/cvs/src/usr.bin/mg/Makefile,v retrieving revision 1.25 diff -u -p -r1.25 Makefile --- Makefile

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
=== RCS file: /home/sunil/cvs/src/usr.bin/mg/Makefile,v retrieving revision 1.25 diff -u -p -r1.25 Makefile --- Makefile28 Nov 2011 04:41:39 - 1.25 +++ Makefile22 Feb 2012 18:06:59 - @@ -24,7 +24,7 @@ SRCS= autoexec.c basic.c buffer.c cinfo

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
shing onto stack. comments? Index: tags.c === RCS file: /home/sunil/cvs/src/usr.bin/mg/tags.c,v retrieving revision 1.1 diff -u -p -r1.1 tags.c --- tags.c 28 Nov 2011 04:41:39 - 1.1 +++ tags.c 1 Dec 2011 19:42:09 - @@ -208,7 +208,7 @@

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

2011-11-27 Thread Sunil Nimmagadda
Manpage changes as suggested by jmc@, thanks. Index: Makefile === RCS file: /home/sunil/cvs/src/usr.bin/mg/Makefile,v retrieving revision 1.24 diff -u -p -r1.24 Makefile --- Makefile2 Feb 2011 05:21:36 - 1.24

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

2011-11-23 Thread Sunil Nimmagadda
This version checks for presence and permissions of filename input by the user and report problems instead of marching on as suggested by Mark Lumsden. Comments? Index: Makefile === RCS file: /home/sunil/cvs/src/usr.bin/mg/Makefile,v

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

2011-11-14 Thread Sunil Nimmagadda
Handling "Out of memory" gracefully instead of killing mg, check filename truncation and fixed a bug while using tags from an empty *scratch* buffer. Comments? Index: Makefile === RCS file: /home/sunil/cvs/src/usr.bin/mg/

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

2011-11-13 Thread Sunil Nimmagadda
llect tags filename using "visit-tags-file", and is compatible with emacs with respect to tags behaviour. Comments? Index: Makefile ======= RCS file: /home/sunil/cvs/src/usr.bin/mg/Makefile,v retrieving revision 1.24 diff -u -p

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

2011-11-07 Thread Sunil Nimmagadda
This diff fixes a couple of bugs found by Mark Lumsden. It would be great if other mg users interested in this diff could test. Index: Makefile === RCS file: /home/sunil/cvs/src/usr.bin/mg/Makefile,v retrieving revision 1.24 diff -u

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

2011-10-13 Thread Sunil Nimmagadda
The new file tags.c now has a proper license. Could you please review this new diff. Index: Makefile === RCS file: /home/sunil/cvs/src/usr.bin/mg/Makefile,v retrieving revision 1.24 diff -u -p -r1.24 Makefile --- Makefile2 Feb

ctags(1) and mg(1) again

2011-10-09 Thread Sunil Nimmagadda
== RCS file: /home/sunil/cvs/src/usr.bin/mg/main.c,v retrieving revision 1.61 diff -u -p -r1.61 main.c --- main.c 4 Jun 2009 02:23:37 - 1.61 +++ main.c 9 Oct 2011 15:05:40 - @@ -77,11 +77,13 @@ main(int

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