[hackers] [slstatus] ip: add OpenBSD support

2018-04-29 Thread Ali H. Fardan
ip.c already works on OpenBSD, it's just missing some headers: diff --git a/components/ip.c b/components/ip.c index 686344b..422b448 100644 --- a/components/ip.c +++ b/components/ip.c @@ -1,5 +1,9 @@ /* See LICENSE file for copyright and license details. */ -#if defined(__linux__) +#if

Re: [hackers] [slock][PATCH] Improve option parsing routine

2016-10-29 Thread Ali H. Fardan
On 2016-10-29 21:35, Laslo Hunhold wrote: The "problem" with dmenu is that it takes "long" flags, and given so many scripts depend on it we just cannot change it that easily. when did I suggest using arg.h for dmenu? --- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org

Re: [hackers] [slock][PATCH] Improve option parsing routine

2016-10-29 Thread Ali H. Fardan
On 2016-10-29 12:40, Hiltjo Posthuma wrote: This is total bullshit: it is less readable and it makes no sense to optimize this case. Please fix real bugs. uhm, like the dmenu one?[0] [0]: http://git.suckless.org/dmenu/tree/dmenu.c#n649 --- () ascii ribbon campaign - against html e-mail /\

Re: [hackers] [slock][PATCH] Remove arg.h, simplify option parsing

2016-10-29 Thread Ali H. Fardan
On 2016-10-28 23:56, Klemens Nanni wrote: arg.h is really ugly code and way to complex for tools like slock that have such minimal synopsis. it's not ugly, you just can't wrap your head around it, it's just a unix port of the plan 9 option parser[0] [0]:

Re: [hackers] [dwm][PATCH] Do not call die() upon '-v' invocation

2016-10-28 Thread Ali H. Fardan
On 2016-10-28 13:21, Quentin Rameau wrote: On 2016-10-28 13:02, Quentin Rameau wrote: > On Fri, Oct 28, 2016 at 12:45:14PM +0000, Ali H. Fardan wrote: >> actually, imo, I think >> usage() should return success. > Surely not. > The call to usage() is made when wrong opt

Re: [hackers] [dwm][PATCH] Do not call die() upon '-v' invocation

2016-10-28 Thread Ali H. Fardan
On 2016-10-28 13:02, Quentin Rameau wrote: On Fri, Oct 28, 2016 at 12:45:14PM +, Ali H. Fardan wrote: actually, imo, I think usage() should return success. Surely not. The call to usage() is made when wrong options have been passed to the tool, you wouldn't return “no error” code when

Re: [hackers] [dwm][PATCH] Do not call die() upon '-v' invocation

2016-10-28 Thread Ali H. Fardan
I don't think -v should output to stderr either, actually, imo, I think usage() should return success. On 2016-10-28 12:40, Klemens Nanni wrote: Returning -1 upon a valid invocation like 'dwm -v' is just wrong. --- dwm.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

Re: [hackers] More dwm patches

2016-10-27 Thread Ali H. Fardan
On 2016-10-27 11:54, Anselm R Garbe wrote: Doesn't sound useful to me. Wallpaper fetishists should keep using OSX. -Anselm A wallpaper can help change your mood. --- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments

Re: [hackers][sbase][ed] small changes

2016-10-07 Thread Ali H. Fardan
O.o, whhops, that was the wrong patch, attached is the correct one. sorry for spamming the list.diff --git a/ed.c b/ed.c index 184ed30..feeab43 100644 --- a/ed.c +++ b/ed.c @@ -316,7 +316,7 @@ inject(char *s) } static void -clearbuf() +clearbuf(void) { if (scratch) close(scratch); @@

Re: [hackers][sbase][ed] small changes

2016-10-07 Thread Ali H. Fardan
Uhm, sorry about that, but my last patch violates the default ed behavior by using eprintf(), here is the corrected version: diff --git a/ed.c b/ed.c index 184ed30..1e834a6 100644 --- a/ed.c +++ b/ed.c @@ -316,7 +316,7 @@ inject(char *s) } static void -clearbuf() +clearbuf(void) {

[hackers][sbase][ed] small changes

2016-10-07 Thread Ali H. Fardan
diff --git a/ed.c b/ed.c index 184ed30..c7648eb 100644 --- a/ed.c +++ b/ed.c @@ -316,7 +316,7 @@ inject(char *s) } static void -clearbuf() +clearbuf(void) { if (scratch) close(scratch); @@ -328,7 +328,7 @@ clearbuf() } static void -setscratch() +setscratch(void)

Re: [hackers] [PATCH] [slock] Remove faulty example and add a section on security considerations

2016-09-28 Thread Ali H. Fardan
PS: I think this is where the code originated: https://github.com/chjj/slock

Re: [hackers] [PATCH] [slock] Remove faulty example and add a section on security considerations

2016-09-28 Thread Ali H. Fardan
I suggest you take a look at this: https://notabug.org/kl3/slock it was used to be called "slock for the absolute paranoid", but this dude wanted to go further with it and make it fit his taste, but there are some security stuff he did there, check it out. -- Raiz On 2016-09-28 21:33, FRIGN

Re: [hackers] [ii] use pledge by default if compiled on openbsc and provide errno string || Nico Golde

2016-09-06 Thread Ali H. Fardan
eprint() is not declared in ii, be careful. Raiz diff --git a/ii.c b/ii.c index a32326d..51318aa 100644 --- a/ii.c +++ b/ii.c @@ -493,7 +493,7 @@ int main(int argc, char *argv[]) { #ifdef __OpenBSD__ /* OpenBSD pledge(2) support */ if (pledge("stdio rpath wpath

Re: [hackers] [quark] Use sizeof() instead of magic constants || FRIGN

2016-09-05 Thread Ali H. Fardan
On 2016-09-05 10:39, Anselm R Garbe wrote: Why should I try. This is blatantly obvious wrong code. and that's my point.

Re: [hackers] [quark] Use sizeof() instead of magic constants || FRIGN

2016-09-05 Thread Ali H. Fardan
I got an example: try compiling this code: #include int main(void) { printf("%d", sizeof unsigned char); return (0); } you will probably get a compiler error like this: sizeof.c: In function ‘main’: sizeof.c:6:22: error: expected expression before ‘unsigned’ printf("%d",

Re: [hackers] [quark] Use sizeof() instead of magic constants || FRIGN

2016-09-05 Thread Ali H. Fardan
On 2016-09-05 08:53, Markus Teich wrote: can you elaborate on the reasoning behind this? The styleguide says "Always use () with sizeof". from my experience, using sizeof without parenthesies could cause errors. Raiz

Re: [hackers] [ii] add OpenBSD pledge support - thanks Gleydson Soares || Nico Golde

2016-09-04 Thread Ali H. Fardan
Sorry, I can't quote your last message because I accidently deleted it. anyways, as far as I know __OpenBSD__ is either defined by the compiler (in openbsd) or the openbsd libc, so if the code being compiled under openbsd __OpenBSD__ will be defined. Raiz

Re: [hackers] [ii] add OpenBSD pledge support - thanks Gleydson Soares || Nico Golde

2016-09-02 Thread Ali H. Fardan
Would be helpful if you provided error string for pledge(), I have also provided a pledge patch for sic and I submitted it a while ago to the mailing list (maybe you did not notice it). Raiz diff --git a/sic.c b/sic.c index ce6d216..6e37c60 100644 --- a/sic.c +++ b/sic.c @@ -182,6 +182,10 @@

Re: [hackers] [quark] missing newline

2016-09-02 Thread Ali H. Fardan
sorry, wrong patch On 2016-09-02 17:21, Ali H. Fardan wrote: diff --git a/quark.c b/quark.c index 6ff50f5..f69ed59 100644 --- a/quark.cdiff --git a/quark.c b/quark.c index 6ff50f5..7e6530f 100644 --- a/quark.c +++ b/quark.c @@ -694,7 +694,7 @@ main(int argc, char *argv[]) /* raise

[hackers] [quark] missing newline

2016-09-02 Thread Ali H. Fardan
diff --git a/quark.c b/quark.c index 6ff50f5..f69ed59 100644 --- a/quark.c +++ b/quark.c @@ -686,7 +686,7 @@ main(int argc, char *argv[]) /* reap children automatically */ if (signal(SIGCHLD, SIG_IGN) == SIG_ERR) { - fprintf(stderr, "%s: signal: Failed to set

Re: [hackers] [sbase] touch(1) permissions correction

2016-09-01 Thread Ali H. Fardan
. On 2016-09-01 20:13, Ali H. Fardan wrote: from a security prespective, touch should not allow everyone to have write permissions to the file, if someones needs such a permission, chmod(1) can be used later. I have tried touch(1) from coreutils and OpenBSD, both set the default permissions to 644

[hackers] [sbase] touch(1) permissions correction

2016-09-01 Thread Ali H. Fardan
from a security prespective, touch should not allow everyone to have write permissions to the file, if someones needs such a permission, chmod(1) can be used later. I have tried touch(1) from coreutils and OpenBSD, both set the default permissions to 644. Raiz diff --git a/touch.c b/touch.c

Re: [hackers] [sbase] a question regarding date(1)

2016-09-01 Thread Ali H. Fardan
Right, I just found out that this is correct after going through other programs Raiz On 2016-09-01 19:08, FRIGN wrote: On Thu, 01 Sep 2016 19:01:50 +0300 "Ali H. Fardan" <r...@firemail.cc> wrote: Hey Ali, so I just came across this if (argc) statement and I'm not sure

[hackers] [sbase] a question regarding date(1)

2016-09-01 Thread Ali H. Fardan
so I just came across this if (argc) statement and I'm not sure why it is placed there in the first pleace, I am assuming that argc is not tinkered with (via arg.h), but the program works well without it, so my question is, is this if() statement incorrect or it's just there because of arg.h?

[hackers] [sic] extra options patch

2016-08-12 Thread Ali H. Fardan
Greetings, This patch adds -u and -r options to sic, which allows the user to change the default ident and/or realname, is it good or garbage? should this go mainstream or just optional? Raiz diff --git a/sic.1 b/sic.1 index aba8db8..b85390a 100644 --- a/sic.1 +++ b/sic.1 @@ -9,6 +9,10 @@