Daniel Cavanagh | 1 Apr 2005 17:09
Picon
Favicon

mixerctl -q

the provided patches implement -q for mixerctl as specified by the man
page, and remove a few superfluous commands in /etc/rc

--- src/usr.bin/mixerctl/mixerctl.c.orig	Thu Feb 10 17:55:42 2005
+++ src/usr.bin/mixerctl/mixerctl.c	Sat Apr  2 00:51:01 2005
 <at>  <at>  -71,6 +71,8  <at>  <at> 
 mixer_ctrl_t *values;
 mixer_devinfo_t *infos;

+int	qflag;
+
 void
 catstr(char *p, char *q, char *out)
 {
 <at>  <at>  -221,7 +223,7  <at>  <at> 

 	if (ioctl(fd, AUDIO_MIXER_WRITE, p->valp) < 0) {
 		warn("AUDIO_MIXER_WRITE");
-	} else {
+	} else if (!qflag) {
 		*p->valp = oldval;
 		prfield(p, ": ", 0);
 		if (ioctl(fd, AUDIO_MIXER_READ, p->valp) < 0) {
 <at>  <at>  -238,7 +240,7  <at>  <at> 
 main(int argc, char **argv)
 {
 	int fd, i, j, ch, pos;
-	int aflag = 0, qflag = 0, vflag = 0;
+	int aflag, vflag;
 	char *file;
(Continue reading)

Fabio Olive Leite | 1 Apr 2005 20:46
Picon
Gravatar

[PATCH] adding -v to nc -l

The patch below, motivated by my april 1st joke on misc <at> , adds an
actual -v "connect" message when nc is in listen mode (-l). Its lines
are long, my type casts look bad, and I had never used inet_ntop
before, so beware. I hope it will be "purified" by a proper developer
if it gets accepted. It does work, anyway.

Index: netcat.c
===================================================================
RCS file: /cvs/src/usr.bin/nc/netcat.c,v
retrieving revision 1.77
diff -u -r1.77 netcat.c
--- netcat.c	8 Feb 2005 15:26:23 -0000	1.77
+++ netcat.c	1 Apr 2005 18:42:10 -0000
 <at>  <at>  -305,6 +305,37  <at>  <at> 
 				connfd = accept(s, (struct sockaddr *)&cliaddr,
 				    &len);
 			}
+			if (vflag) {
+				struct sockaddr_storage sockst;
+				int rv;
+				char hostname[64];
+
+				len = sizeof(sockst);
+				rv = getpeername(connfd, (struct sockaddr *)&sockst, &len);
+				if (rv < 0) {
+					err(1, "getpeername");
+				} else {
+					if (sockst.ss_family == AF_INET) {
+						if (inet_ntop(sockst.ss_family, &((struct sockaddr_in *)&sockst)->sin_addr, hostname, 64)
== NULL) {
(Continue reading)

Ai | 2 Apr 2005 03:38
Picon
Favicon

Re: Mac addresses.

I submitted a kernel code some time ago that "enables setting
arbitrary MAC address in OpenBSD via ifconfig and hostname.*"  I
think it is relatively clean.  The code and notes are still
availiable at 
http://homepage.mac.com/quension/setmac.patch

At this point it only supports NIC cards in these modules: dc, fxp,
and xl.  Some one has suggested that it can be done for all NIC cards
without touching the individual modules.  Nevertheless, if you look
at the change to dc.c, fxp.c, and xl.c, you will find that the
changes are very similar and can be added to other modules easily.

--- Theo de Raadt <deraadt <at> cvs.openbsd.org> wrote:
> > So here are a couple of points that I want to bring up here about
> why 
> > OpenBSD should allow one to change the MAC address on the
> physical 
> > interfaces...
> > 
> > 1) There are a lots of people who may not have a normal ISP (EG:
> Broken 
> > Cable TV providers) out in the middle of po'dunk country, cable
> really 
> > is the only thing as dialup can fail or become a very
> intermittent 
> > connection method.
> > 2) There is very little security gain for protecting the MAC of a
> 
> > network card, as other OSes allow the changes of MAC addresses
> with out 
(Continue reading)

Peter Hessler | 2 Apr 2005 04:53

Re: Mac addresses.

This feature has recently entered the tree.  lladdr in ifconfig(8).

On Fri, 1 Apr 2005 17:38:27 -0800 (PST)
Ai <bsdusr2003 <at> yahoo.com> wrote:

:I submitted a kernel code some time ago that "enables setting
:arbitrary MAC address in OpenBSD via ifconfig and hostname.*"  I
:think it is relatively clean.  The code and notes are still
:availiable at 
:http://homepage.mac.com/quension/setmac.patch
:
:At this point it only supports NIC cards in these modules: dc, fxp,
:and xl.  Some one has suggested that it can be done for all NIC cards
:without touching the individual modules.  Nevertheless, if you look
:at the change to dc.c, fxp.c, and xl.c, you will find that the
:changes are very similar and can be added to other modules easily.

--

-- 
Spirtle, n.:
	The fine stream from a grapefruit that always lands right in
	your eye.
		-- Sniglets, "Rich Hall & Friends"

Fabio Olive Leite | 2 Apr 2005 08:52
Picon
Gravatar

Re: [PATCH] verbose msg on -l, verbose to stderr on nc(1)

The patch below adds a verbose message to the listen mode on nc(1) and
also puts the existing verbose "Connect" message to stderr. As nc(1)
will use read/write directly on fd 1 after printf'ing the "Connect"
message, when the user pipes its output away from a line-buffered
terminal the stdio buffer will never be flushed and you'll never get
the connect message.

If you don't like informative messages on stderr, at least add
fflush(stdout) calls after the printf's.

Index: netcat.c
===================================================================
RCS file: /cvs/src/usr.bin/nc/netcat.c,v
retrieving revision 1.77
diff -u -r1.77 netcat.c
--- netcat.c	8 Feb 2005 15:26:23 -0000	1.77
+++ netcat.c	2 Apr 2005 06:46:00 -0000
 <at>  <at>  -305,6 +305,37  <at>  <at> 
 				connfd = accept(s, (struct sockaddr *)&cliaddr,
 				    &len);
 			}
+			if (vflag) {
+				struct sockaddr_storage sockst;
+				int rv;
+				char hostname[64];
+
+				len = sizeof(sockst);
+				rv = getpeername(connfd, (struct sockaddr *)&sockst, &len);
+				if (rv < 0) {
+					err(1, "getpeername");
(Continue reading)

Jesse Kempf | 2 Apr 2005 12:02
Picon
Favicon

Adding binaries to ramdisk kernel

Hi,
One of my little side projects is adding the smarts to the OpenBSD
installer so that it can tell if an interface is wireless, and if so,
prompt the user to enter an SSID. I thought it better that I not
hackishly modify ifconfig or wicontrol to be able to determine whether
the media is IFM_IEEE80211. So I've got this tiny binary (~1k) called
iswireless that needs to be added to the instbinary. From what I've
pieced together, crunchgen is used to slap everything in
src/distrib/special together, so I've added a directory to special
called iswireless and did all the makery necessary so that iswireless is
generated at the right time. I then surmised that a miracle would
happen, and all I'd have to do is add a directive to
src/distrib/ramdisk/list and iswireless would magically appear after I
built and booted from the new ramdisk kernel.
Now here's the problem I'm having: I can't quite seem to get that to
happen. I'm pretty obviously missing some magic here. What is it? If
it's documented (which would be helpful, but embarassing to me), where
can I find the documentation?

Cheers,
-Jesse Kempf
VLSI Lab Systems Manager
Center for Integrated Electronics
Rensselaer Polytechnic Institute

Cedric Berger | 2 Apr 2005 15:22
Picon

buglet in cat.c

I was reading cat.c sources, and something seemed odd:

void
raw_cat(int rfd)
{
     [...]
     if (fstat(wfd, &sbuf))
         err(1, "%s", filename);

It seem to me that one of the two last lines above is
wrong (don't know which one) because fstat is done on
output file, but the err() call display input file and
not "stdout" like a few line afterwards.

Cedric

Tetsuji Rai | 2 Apr 2005 19:58

Why does mysql have trouble in launching "mysql" and some other apps?

I installed mysql-4.0.24 on openbsd37 and openbsd36  NOt using ports.
Installation works perfect,   and mysqld_safe also works fine. however some clients such as mysql,
mysqladmin doesn't work saying "../libmysql/.libs/libmysqlclient.so.12.0 not found"

Maybe ports patches do the trick, but I want to know what's the problem.  

Will you give me any hints?

mysql:
        -lcurses.8 => /usr/lib/libcurses.so.8.0 (0x40042000)
        ../libmysql/.libs/libmysqlclient.so.12.0 (0x0)
        -lz.1 => /usr/lib/libz.so.1.4 (0x40080000)
        -lstdc++.30 => /usr/lib/libstdc++.so.30.0 (0x4008d000)
        -lm.0 => /usr/lib/libm.so.0.1 (0x400ce000)
        -lc.28 => /usr/lib/libc.so.28.5 (0x400e2000)
--------
Tetsuji 'Maverick' Rai
Born to be the luckiest guy in the world!   May the Force be with me!
Aviation Joke: http://www.geocities.com/tetsuji_rai
Profile: http://maverick.ns1.name/
http://n.1asphost.com/ro0tless/
maverick6664 <at> abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk.com

-----------------------------------------------
2GBまでメールや画像など貯め放題!さらに特典いっぱい♪
livedoor ギガメーラープラス 【新登場】
http://gigamailerplus.livedoor.com/

Marc Espie | 2 Apr 2005 21:06
Favicon

Re: Why does mysql have trouble in launching "mysql" and some other apps?

On Sun, Apr 03, 2005 at 02:58:27AM +0900, Tetsuji Rai wrote:
> Installation works perfect,   and mysqld_safe also works fine. however some clients such as mysql,
mysqladmin doesn't work saying "../libmysql/.libs/libmysqlclient.so.12.0 not found"
> 
> Maybe ports patches do the trick, but I want to know what's the problem.  
> 
> Will you give me any hints?

This is a libtool issue.

Libtool is a big pain in the ass. It doesn't do what it claims to do,
and most patches we've sent `don't fit into the GNU scheme of things
anyways'.

It's a very good example of project management done the GNU way: slippage
between releases, no-one to answer important stuff, over-designed, bloated
and not achieving what it meant to do in the first place.

Tetsuji " Maverick " Rai | 2 Apr 2005 21:57

Re: Why does mysql have trouble in launching "mysql" and some other ap ps?

--Marc Espie<espie <at> nerim.net> wrote:
>On Sun, Apr 03, 2005 at 02:58:27AM +0900, Tetsuji Rai wrote:
>> Installation works perfect,   and mysqld_safe also works fine. however some clients such as mysql,
mysqladmin doesn't work saying "../libmysql/.libs/libmysqlclient.so.12.0 not found"
>> 
>> Maybe ports patches do the trick, but I want to know what's the problem.  
>> 
>> Will you give me any hints?
>
>This is a libtool issue.
>
>Libtool is a big pain in the ass. It doesn't do what it claims to do,
>and most patches we've sent `don't fit into the GNU scheme of things
>anyways'.
>
>It's a very good example of project management done the GNU way: slippage
>between releases, no-one to answer important stuff, over-designed, bloated
>and not achieving what it meant to do in the first place.
>
>

Thanks all.  For now I don't know much about libtool, but my personal workaround is to build those
problematic executables with -static option by hand.  I've read about this on mysql page or something,
found somebody wrote that he built mysql with shared disabled, but this workaround has a problem to me.  I
want to build php-4 or php-5 with mysql and apache2 (somehow openbsd comes with apache-1.3.xx) and if
mysql is built with shared library disabled, php isn't built with libphp4.so/libphp5.so 
required for apache.  So I need to build mysql with shared library enabled, and link some executables with
-static option.   Now I am wondering which *BSD I should use...FreeBSD/NetBSD/OpenBSD....I wonder why it
works with FreeBSD while it doesn't with OpenBSD.   Does FreeBSD do any tricks with libtool?   I am thinking of
using ports, but usually ports.tar.gz is out of date...
(Continue reading)


Gmane