Questions tagged [openbsd]

OpenBSD is an advanced unix-like operating system for modern server, desktop, and embedded computer platforms. It is open source and licensed under the BSD license.

This tag should be used for question pertaining specifically to the OpenBSD operating system. In keeping with the intent of SO, this is limited to programming, not such things as use, installation, configuration, or maintenance. Such questions generally belong on Superuser if related to personal/workstation use, or on ServerFault if related to use as a server.

239 questions
44
votes
1 answer

Using PacketFilter to transparently proxy packets in OS X

There is a cool utility out there called sshuttle. It has depended on ipfw to forward packets in the past. It appears that ipfw is mostly broken in Mavericks and the advice is to use PacketFilter for this now. I've spent most of the day looking at…
Matt Smith
  • 588
  • 4
  • 9
27
votes
5 answers

zsh: command not found: bundle (after gem install bundle)

Why zsh: command not found: bundle after gem install bundler? I tried setting path=( /usr/local/lib/ruby/gems/2.2/gems/ ~/bin /bin /sbin /usr/bin /usr/sbin /usr/local/bin /usr/local/sbin ) in /etc/zshrc and source /etc/zshrc to no…
Mark Boulder
  • 13,577
  • 12
  • 48
  • 78
26
votes
2 answers

What does "@(#)" in comments mean?

In the OpenBSD code here, there is a comment that ends with: @(#)init_main.c 8.9 (Berkeley) 1/21/94 What is the purpose of @(#)? I would assume that it is to make searching easier, but why @(#) specifically and not another more meaningful pattern…
Benjily3
  • 273
  • 2
  • 7
19
votes
3 answers

What is the purpose of format specifier "%qd" in `printf()`?

I saw format specifier %qd when browsing github code. Then I checked in GCC compiler, it's working fine. #include int main() { long long num = 1; printf("%qd\n", num); return 0; } What is the purpose of format specifier %qd…
msc
  • 33,420
  • 29
  • 119
  • 214
11
votes
4 answers

Running xinc on OpenBSD's Apache Server

Has anyone been able to get xinc to run correctly under OpenBSD's chrooted default Apache? I'd like to keep our development server running fully chrooted just like our Production server so that we make sure our code runs just fine chrooted.
dragonmantank
  • 15,243
  • 20
  • 84
  • 92
9
votes
6 answers

C pointer to array declaration with bitwise and operator

I want to understand the following code: //... #define _C 0x20 extern const char *_ctype_; //... __only_inline int iscntrl(int _c) { return (_c == -1 ? 0 : ((_ctype_ + 1)[(unsigned char)_c] & _C)); } It originates from the file ctype.h from the…
accentWool
  • 107
  • 7
9
votes
2 answers

Is it possible to control mplayer from another program easily?

I'm setting up a computer running OpenBSD that I wish to play all the music I will ever want. I want it to basically set in a corner and do it's thing. The problem with that is that I want to control it from wherever I am. I can do that (though not…
Earlz
  • 62,085
  • 98
  • 303
  • 499
9
votes
1 answer

Creating a new file descriptor from stdout with fcntl fails in files

I have a simple test file that looks like this: use v6.c; use NativeCall; sub fcntl(int32, int32 --> int32) is native { * } sub close(int32 --> int32) is native { * } my $fd := fcntl($*OUT.native-descriptor, 0); say $fd; close($fd); The file…
Kaiepi
  • 3,230
  • 7
  • 27
9
votes
3 answers

Bloated echo command

Look at the following implementations of the "echo" command: http://bxr.su/o/bin/echo/echo.c (OpenBSD) http://bxr.su/d/bin/echo/echo.c (DragonFly) http://bxr.su/n/bin/echo/echo.c (NetBSD) http://bxr.su/f/bin/echo/echo.c…
Joe
  • 181
  • 1
  • 5
9
votes
2 answers

How do I get a bash script working on FreeBSD, OpenBSD and Linux without modifying it?

Sorry, the headline might be a bit irritating, but I didn't know anything better. Anyway, I want a bash script to work on FreeBSD, OpenBSD and Linux without modifying it, but bash isn't located at the same place in Linux and BSD. So, if I write…
Thomas
  • 3,074
  • 1
  • 25
  • 39
8
votes
4 answers

php-fpm does not work exec, system, shell_exec, only CLI

php-fpm, nginx exec when in use .phpfiles() shell_exec() system() works fine from the command line. Example when works well: #php myphp.php myphp.php contains: But if I put on my…
laur
  • 500
  • 1
  • 9
  • 23
8
votes
2 answers

home, end, delete, pageup, pagedown with ksh

I want to use home, end, delete, pageup, pagedown with ksh. My TERM is xterm-color. These keys works fine with tcsh and zsh, but not with ksh (print a tilde ~) I found this: bind '^[[3'=prefix-2 bind '^[[3~'=delete-char-forward bind…
Nicolas
  • 81
  • 2
7
votes
2 answers

IPv6: Why are IPv4-mapped addresses a security risk?

The OpenBSD manual states: For security reasons, OpenBSD does not route IPv4 traffic to an AF_INET6 socket, and does not support IPv4 mapped addresses, where IPv4 traffic is seen as if it comes from an IPv6 address like ::ffff:10.1.1.1. Where both…
7
votes
2 answers

Modulus Operator vs Zero (re: arc4random_uniform source)

Found myself looking at the arc4random_uniform source (http://bxr.su/o/lib/libc/crypt/arc4random_uniform.c) My question relates to the following line (the comment is their original comment) : /* 2**32 % x == (2**32 - x) % x */ min = -upper_bound %…
Little Code
  • 1,315
  • 2
  • 16
  • 37
7
votes
4 answers

Use OpenBSD's malloc, realloc and free in my program

I would like to use OpenBSD's implementation of malloc, realloc and free on my Debian lenny desktop rather than glibc's. Are they simply drop in replacements: will they work on my Linux desktop ? Which are the file(s) that I need and which OpenBSD…
Neeladri Vishweswaran
  • 1,695
  • 5
  • 22
  • 40
1
2 3
15 16