Re: Recent interface/routing changes breaks on-demand PPP

2001-03-19 Thread Ruslan Ermilov

On Mon, Mar 19, 2001 at 06:34:34PM +0100, Alexander Leidinger wrote:
 On 19 Mar, Ruslan Ermilov wrote:
 
  5.  This affects not only ppp(8).  Add default route that points to the
  LAN; change the IP address on interface; observe that the default
  route has gone away.  The reason is that if we don't do this, we
  may end up using the old (now non-existing) local IP address.
 
 Yesterday I did a buildworld and an installworld with sources which
 contain the fixed routing code (cvsup at ~3pm CET). Today I tried to
 dialout-on-demand right after boot. I use ISDN and have
   defaultrouter="-interface isp1"
 in my rc.conf. It didn't worked and I found the reason withhin a minute.
 There wasn't a defaultroute. So I just added the defaultroute and
 everything was fine... until the next time my system tried to
 dialout-on-demand. There wasn't a defaultroute again. Boring. Ok, I just
 added the defaultroute again and the system dialed out. After this
 second "route add default -interface isp1" the defaultroute didn't
 disappeared for several dialouts. I haven't rebooted yet to try to
 reproduce it.
 
You will have to add the following command to the relevant section of
ppp.conf:

add default HISADDR

for this to work.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: CURRENT breakage in usr.sbin/amd/mk-amd-map

2001-03-21 Thread Ruslan Ermilov

On Wed, Mar 21, 2001 at 03:13:42PM +1100, Bruce Evans wrote:
[...]
 Only the amd ones are broken.  The bug is in ../Makefile.inc.  It spams
 ${SRCS} with some nfs headers.  This breaks bsd.prog.mk's automatic
 setting of ${SRCS} from ${PROG}.  SRCS should be under the control of
 individual Makefiles except for the default in bsd.prog.mk.
 
 This bug also causes bogus setting and building of nfs headers in amd
 subdirs that don't have any C sources and/or don't need any nfs headers,
 e.g. in the scripts subdir.
 
Fixed now, sorry.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Recent interface/routing changes breaks on-demand PPP

2001-03-25 Thread Ruslan Ermilov

On Sun, Mar 25, 2001 at 02:46:22AM +0100, Brian Somers wrote:
   On Fri, Mar 23, 2001 at 23:11:56 +, Brian Somers wrote:
1. Ppp is in -auto mode (or a ``set mode auto'' has been done).  
   Here, ppp configures the interface as soon as it sees the ``set 
   ifaddr'' line and never undoes that configuration.  An ``add'' 
   with a fixed IP number would never have worked if it's before the 
   ``set ifaddr''.  If it's after the ``set ifaddr'', nothing should 
   ever remove it (as the interface will stay configured).

2. Ppp is not in -auto mode.  Here, ppp won't assign the interface 
   address 'till IPCP is up.  Any attempt to ``add'' a route with a 
   static IP number in ppp.conf should fail.

So, the recent routing changes shouldn't have made a difference.

Anyone know what I'm missing ?  Andre, what does your ppp.conf look 
like and how are you running ppp ?
   
   ppp in -auto mode, "add" is after "set ifaddr"
  
  In which case your interface should stay configured despite the link 
  coming down and your route should *not* be deleted.
  
  I'll see if I can reproduce this here (I need to upgrade a machine 
  first).
 
 This was happening because ppp was deleting then re-adding the 
 interface address when IPCP came up, causing the new routing code to 
 nuke the static route.  I've added an optimisation to stop this from 
 happening, so your configuration should work ok again with 
 src/usr.sbin/ppp/iface.c 1.17.
 
You mean, ppp(8) does not do this now if negotiated address does not change?


-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



** HEADS UP **: bsd.man.mk changes

2001-03-26 Thread Ruslan Ermilov

Hi!

The syntax for declaring manual pages has been changed.

The manual pages to be installed can now be listed in a
single MAN variable.  The old MAN[1-9] syntax is still
supported, for backwards compatibility.

The plan is to MFC this feature after 4.3 release, and
start the deorbit sequence for MAN[1-9] syntax.

Developers, please make sure all new Makefiles use the
new syntax.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: usr.bin/kdump - 'make world' broken?

2001-03-27 Thread Ruslan Ermilov

On Tue, Mar 27, 2001 at 07:34:49PM +0400, Sergey A. Osokin wrote:
 On Tue, Mar 27, 2001 at 01:22:51PM +0200, Eckhard Kantz wrote:
  What could be the reason for the following problem?
  
  === usr.bin/kdump
  cc -O -pipe  -I/usr/src/usr.bin/kdump/../ktrace -I/usr/src/usr.bin/kdump/../
  ..   -I/usr/obj/usr/src/i386/usr/include -c ioctl.c
  In file included from ioctl.c:96:
  /usr/obj/usr/src/i386/usr/include/sys/memrange.h:18: warning: `MDF_ACTIVE'
  redefined
  /usr/obj/usr/src/i386/usr/include/pccard/cardinfo.h:81: warning: this is the
  location of the previous definition
  In file included from ioctl.c:52:
  /usr/obj/usr/src/i386/usr/include/machine/i4b_rbch_ioctl.h:45: `TELNO_MAX'
  undeclared here (not in a function)
  *** Error code 1
  
  Stop in /usr/src/usr.bin/kdump.
  *** Error code 1
 
 I reported about this problem more then 3 months ago.
 
(http://www.freebsd.org/cgi/getmsg.cgi?fetch=434185+436356+/usr/local/www/db/text/2001/freebsd-current/20010128.freebsd-current)
 
 I think this problem may resolve with following steps:
 1) rm -rf /usr/src
 2) re-sup
 3) try to make buildworld
 But i haven't -current @ fast channel for this...
 
 Also, you may do following:
 1) vi /usr/src/usr.bin/kdump/Makefile and remove ${DESTDIR} at line 11
 2) vi /usr/src/usr.bin/truss/Makefile remove ${DESTDIR} at line 32
 3) try to make buildworld
 
 I recommend first way.
 It looks like mkioctls do something wrong at ${DESTDIR} at
 buildworld time.
 
Should be fixed in usr.bin/kdump/mkioctls,v 1.20.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: make release broken in telnetd

2001-03-28 Thread Ruslan Ermilov
 "make world",
 ie. outside of the "make release" environment works fine though.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: make release broken in telnetd

2001-03-29 Thread Ruslan Ermilov

Hi!

This was tricky.  Due to the old bug in release/Makefile (it did
not pass -DRELEASE_CRUNCH when building list of object files for
crunched binary), ${OBJS} list for ppp was computed incorrectly,
and ppp/Makefile had a special glue to build empty object files:

: .if defined(RELEASE_CRUNCH)
: # We must create these objects because crunchgen will link them,
: # and we don't want any unused symbols to spoil the final link.
: CFLAGS+=-DNONAT -DNORADIUS -DNOI4B -DNOSUID
: OBJS+=  chap_ms.o mppe.o id.o nat_cmd.o radius.o
: chap_ms.o mppe.o id.o nat_cmd.o radius.o:
: null_${.PREFIX}.c
: cc -c -o ${.TARGET} null_${.PREFIX}.c
: .endif

Recall that release/Makefile executes `make subclean all' against
the crunchgen(1) generated .mk file.  Previously, `subclean' was
executed with the -DRELEASE_CRUNCH; this removed chap_ms.o, and
subsequent `make all' had a chance to build chap_ms.o from the
stub rule above:

: # make -n -DRELEASE_CRUNCH chap_ms.o
: null_chap_ms.c
: cc -c -o chap_ms.o null_chap_ms.c

Now that -DRELEASE_CRUNCH is moved to crunchgen(1) .conf files
(recall that I needed this so that ${OBJS} are computed correctly
for telnet/Makefile), ppp/Makefile got broken.  `subclean' does
not cleans chap_ms.o, and subsequent `make all' considers it
up-to-date.

The attached patch should fix this.  Please let me know...

Actually, I have just committed a fix to crunchgen(1) so that
it runs `make clean' with the ${BUILDOPTS}, to avoid possible
failures in the future.  This fix alone should be enough to
fix the broken `make release', but please test with the attached
patch too.

: ru  2001/03/30 00:04:25 PST
: 
:   Modified files:
: usr.sbin/crunch/crunchgen crunchgen.c
:   Log:
:   `buildopts' may affect the selection of object files.
:   Make sure we pass $(BUILDOPTS) to the `clean' target
:   so that `make clean' works on the same set of object
:   files.  Otherwise, we may end up with an incorrectly
:   built and up-to-date object file.
: 
:   Revision  ChangesPath
:   1.26  +2 -2  src/usr.sbin/crunch/crunchgen/crunchgen.c

On Thu, Mar 29, 2001 at 07:10:57PM +0200, John Hay wrote:
 Hi Ruslan,
 
  
  Could you please try the attached patch and let me know?
  
  I had to move -DRELEASE_CRUNCH to *_fixit.conf so that
  ${OBJS} are computed correctly for usr.bin/telnet.
 
 I have tried it, but now it breaks in boot_crunch:
 
 ##
 cc -O -pipe-DCRUNCHED_BINARY -c tunefs_stub.c
 ld -dc -r -o tunefs.lo tunefs_stub.o /usr/obj//usr/src/sbin/tunefs/tunefs.o
 crunchide -k _crunched_tunefs_stub tunefs.lo
 cc -static -o boot_crunch boot_crunch.o sh.lo find.lo sed.lo test.lo rm.lo pwd.l
 o ppp.lo sysinstall.lo newfs.lo minigzip.lo cpio.lo fsck.lo ifconfig.lo route.lo
  slattach.lo mount_nfs.lo dhclient.lo arp.lo hostname.lo rtsol.lo pccardc.lo pcc
 ardd.lo usbd.lo usbdevs.lo tunefs.lo -ll -ledit -lutil -lkvm -lmd -lcrypt -lftpi
 o -lz -lnetgraph -ldialog -lncurses -lmytinfo -ldisk -lipx
 ppp.lo: In function `MakeKey':
 ppp.lo(.text+0xfe): undefined reference to `des_set_odd_parity'
 ppp.lo: In function `DesEncrypt':
 ppp.lo(.text+0x142): undefined reference to `des_set_key'
 ppp.lo(.text+0x14f): undefined reference to `des_ecb_encrypt'
 ppp.lo: In function `MPPEKeyChange':
 ppp.lo(.text+0x7b6): undefined reference to `RC4_set_key'
 ppp.lo(.text+0x7ca): undefined reference to `RC4'
 ppp.lo: In function `MPPEOutput':
 ppp.lo(.text+0x85b): undefined reference to `RC4_set_key'
 ppp.lo(.text+0x898): undefined reference to `RC4'
 ppp.lo(.text+0x8bd): undefined reference to `RC4'
 ppp.lo: In function `MPPEInput':
 ppp.lo(.text+0x9f7): undefined reference to `RC4_set_key'
 ppp.lo(.text+0xa18): undefined reference to `RC4'
 ppp.lo(.text+0xa4e): undefined reference to `RC4'
 *** Error code 1
 
 Stop in /usr/src/release/boot_crunch.
 *** Error code 1
 ...
 ###

-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: Makefile
===
RCS file: /home/ncvs/src/usr.sbin/ppp/Makefile,v
retrieving revision 1.84
diff -u -p -r1.84 Makefile
--- Makefile2001/03/26 14:41:22 1.84
+++ Makefile2001/03/30 07:16:55
@@ -92,13 +92,7 @@ DPADD+= ${LIBNETGRAPH}
 .endif
 
 .if defined(RELEASE_CRUNCH)
-# We must create these objects because crunchgen will link them,
-# and we don't want any unused symbols to spoil the final link.
 CFLAGS+=-DNONAT -DNORADIUS -DNOI4B -DNOSUID
-OBJS+= chap_ms.o mppe.o id.o nat_cmd.o radius.o
-chap_ms.o mppe.o id.o nat_cmd.o radius.o:
-   null_${.PREFIX}.c
-   cc -c -o ${.TARGET} null_${.PREFIX}.c
 .endif
 
 .include bsd.prog.mk



Re: Recent interface/routing changes breaks on-demand PPP (+sppp)

2001-03-30 Thread Ruslan Ermilov

On Fri, Mar 30, 2001 at 01:36:39PM +0200, Alexander Leidinger wrote:
 On 30 Mar, Ruslan Ermilov wrote:
   - if I put the interface down the first time after a login I have to
 readd the defaultroute (only once, after additional "ifconfig
 down/up" I didn't have to readd the defaultroute, it stays)
  
  This is only possible if you have a routing daemon running.
 
 I didn't have a routing daemon running.
 
  Otherwise, if the default route points to interface X, and
  you execute ``ifconfig X down'', all routes through X will
  be deleted including the default.  Previously, the routing
  code did not delete ``static'' routes, now it does.
 
 What to do in this situation? I didn't want add the defaultroute
 everytime (POLA).
 
But if we don't do this, we may end up using the wrong source IP
address.  Without my fixes, try this:

1)  ifconfig isp1 X.X.X.1 
2)  route add default -iface isp1
3)  ifconfig isp1 X.X.X.2
4)  ping some outside host
5)  watch the packets will go from the wrong address (X.X.X.1)


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Recent interface/routing changes breaks on-demand PPP (+sppp)

2001-03-30 Thread Ruslan Ermilov

[Redirected to -net]

On Fri, Mar 30, 2001 at 03:39:40PM +0200, Alexander Leidinger wrote:
 On 30 Mar, Ruslan Ermilov wrote:
 
  What to do in this situation? I didn't want add the defaultroute
  everytime (POLA).
  
  But if we don't do this, we may end up using the wrong source IP
  address.  Without my fixes, try this:
  
  1)  ifconfig isp1 X.X.X.1 
  2)  route add default -iface isp1
  3)  ifconfig isp1 X.X.X.2
  4)  ping some outside host
  5)  watch the packets will go from the wrong address (X.X.X.1)
 
 If I use
   route add default -interface isp1
 I wan't to have the packets routed trough isp1. I don't care about how
 the routing table is held consistent, but I if the route is discarded
 without my interaction it not only violates POLA, in this case it's
 prohibits a valid use of the -interface feature (dial on demand via sppp
 is broken at the moment).
 
OK, finally got it.  When the interface goes down, the address is still
valid, and there is no reason to delete (static?) routes that use this
address, but the new code does.  I was confused by the code comment below
for the rip_ctlinput() function in raw_ip.c.  The old code actually only
deleted dynamically creates routes (ARP cache, etc.).  IOW, that could be
used as some sort of flush.

: /*
:  * This function exists solely to receive the PRC_IFDOWN messages which
:  * are sent by if_down().  It looks for an ifaddr whose ifa_addr is sa,
:  * and calls in_ifadown() to remove all routes corresponding to that address.
  ^^
:  * It also receives the PRC_IFUP messages from if_up() and reinstalls the
:  * interface routes.
:  */

I then modified in_ifadown() so that it deletes static routes as well
that use this address.

I will probably implement in_ifadelete() that will be called when the
interface address is actually deleted (in_control(); SIOCDIFADDR),
and restore the old behavior of in_ifadown().

This will take some time.  Meanwhile, the following patch could be used
as the temporary workaround:

Index: raw_ip.c
===
RCS file: /home/ncvs/src/sys/netinet/raw_ip.c,v
retrieving revision 1.75
diff -u -p -r1.75 raw_ip.c
--- raw_ip.c2001/03/16 20:00:53 1.75
+++ raw_ip.c2001/03/30 14:09:20
@@ -398,7 +398,9 @@ rip_ctlinput(cmd, sa, vip)
 * thing to do, but at least if we are running
 * a routing process they will come back.
 */
+#if 0
in_ifadown(ia-ia_ifa);
+#endif
break;
}
}


Let me know if it works for you.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: *HEADS UP* libposix1e is integrated into libc

2001-04-05 Thread Ruslan Ermilov

On Thu, Apr 05, 2001 at 09:33:24AM +0200, John Hay wrote:
  On Wed, Apr 04, 2001 at 07:23:18PM +0200, Thomas Moestl wrote:
   src/lib/libposix1e was repocopied to src/lib/libc/posix1e, and I'll
   start to commit the necessary patches now and will then activate the
   build.
   
   World may be broken during a short interval due to the switch. You
   will also need to rebuild anything that uses libposix1e. In the base
   system, those are src/bin/getfacl and src/bin/setfacl for now. I'm not
   aware of any ports using it, so normally you should be fine after a
   buildworld.
  
  The changes are complete now, so any possible breakage should be over.
  
 
 I think you need to change MAN= to MAN+= in /posix1e/Makefile.inc.
 That just caused a make release to fail because it clobbered all
 the previous man entries and then ln couldn't link them.
 
Committed!


-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



** HEADS UP ** Groff 1.17 (including -mdocNG) imported

2001-04-17 Thread Ruslan Ermilov

Hi!

It is my great pleasure to announce the availability of just released
Groff 1.17.  Please refer to the src/contrib/groff/NEWS for details on
what's new in this release.

This release includes the complete re-implementation of the BSD mdoc(7)
macro package, earlier referred to as -mdocNG.  The new mdoc(7) manpage
completely documents the package, thus replacing mdoc.samples(7).  For
now, mdoc.samples(7) is installed as MLINK to mdoc(7), but I will likely
replace it with a short manpage referring to the mdoc(7).  For a complete
set of new features, please refer to the new mdoc(7).  Note that this
manpage could only be displayed with the new groff tools and new -mdoc
package.

FreeBSD-specific -mdoc configuration file is called mdoc.local.  This
version also provides a simple way to localize -mdoc.  For now, only
KOI8-R support is implemented.  See gnu/usr.bin/groff/tmac/koi8-r for
details.

Below is the brief info on -mdoc from the NEWS file:

: o The mdoc package has been completely rewritten, using the full power of
:   GNU troff to remove limitations of Unix troff (which is no longer
:   supported).  Most important changes are:
: 
:   . No argument limit.
:   . Almost all macros are parsed and callable (if it makes sense).
:   . `.Lb': prints library names
:   . `.Nm punctuation' now works as expected; `.Nm "" punctuation' has
: been withdrawn.
:   . Updated `.St' command
:   . `.Fx': prints FreeBSD
:   . `.Ox': prints OpenBSD
:   . `.Bsx': prints BSD/OS
:   . `.Brq', `.Bro', `.Brc': brace enclosure macros
:   . `.Bd -centered': center lines
:   . `.Bl -xwidth string': interpret string and use the resulting width
:   . support for double-sided printing (-rD1 command line switch)
:   . support for 11pt and 12pt document sizes (-rS11, -rS12 command line
: switches)
: 
:   `groff_mdoc.man' replaces `groff_mdoc.samples.man'; it now completely
:   documents the mdoc package.
: 
:   Great care has been taken to assure backwards compatibility.  If you
:   encounter any abnormal results, please report them to [EMAIL PROTECTED]



Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: ** HEADS UP ** Groff 1.17 (including -mdocNG) imported

2001-04-18 Thread Ruslan Ermilov

On Wed, Apr 18, 2001 at 07:33:21PM +0200, Thomas Quinot wrote:
 Le 2001-04-18, Ruslan Ermilov ecrivait :
 
  cd /usr/src/gnu/usr.bin/groff/tmac  make cleandir obj  make all install
 
 It works here, thanks!
 
Make sure you delete empty files from /usr/share/man/[en.ISO_8859-1/]cat?/.
I will try to fix man(1) tomorrow so that it will not create empty files if
groff(1) returns with non-zero exit status.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: groff breaks make -j N buildworld

2001-04-19 Thread Ruslan Ermilov

Hi!

I always thought that ``obj'', ``all'' and ``install'' should be
executed in sequence, not together.  Hey, this even does not work
for bin/cat:

$ uname -a
FreeBSD dev.lan.Awfulhak.org 5.0-CURRENT FreeBSD 5.0-CURRENT #7: Wed Apr 18 14:07:56 
BST 2001 [EMAIL PROTECTED]:/usr/obj/usr/src/sys/DEV  i386
$ make obj
/usr/obj/net/gate/home/ru/cat created for /net/gate/home/ru/cat
$ make -j32 all install -DNOMAN DESTDIR=/tmp/1 BINDIR=/bin BINOWN=ru
cc -O -pipe-I/tmp/1/usr/include -c /net/gate/home/ru/cat/cat.c
install -c -s -o ru -g wheel -m 555   cat /tmp/1/bin
install: cat: No such file or directory
*** Error code 71
1 error
$ make -j32 all install -DNOMAN DESTDIR=/tmp/1 BINDIR=/bin BINOWN=ru
install -c -s -o ru -g wheel -m 555   cat /tmp/1/bin
install: cat: No such file or directory
*** Error code 71
cc -O -pipe-I/tmp/1/usr/include  -o cat cat.o
1 error
$ make -j32 all install -DNOMAN DESTDIR=/tmp/1 BINDIR=/bin BINOWN=ru
install -c -s -o ru -g wheel -m 555   cat /tmp/1/bin
$

OTOH, this seems like a bug in make(1), as the following patch makes
-j32 bootstrap-tools happy in gnu/usr.bin/groff/tmac:

Index: Makefile
===
RCS file: /home/ncvs/src/gnu/usr.bin/groff/tmac/Makefile,v
retrieving revision 1.27
diff -u -r1.27 Makefile
--- Makefile2001/04/17 12:37:18 1.27
+++ Makefile2001/04/19 08:01:52
@@ -58,6 +58,7 @@
cd ${.CURDIR}; \
${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
hyphen.us-ru ${DESTDIR}${TMACDIR}
+   cd ${.OBJDIR}
 .for f in ${STRIPFILES} ${SPECIALFILES}
${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
$f-s ${DESTDIR}${TMACDIR}/$f

On Thu, Apr 19, 2001 at 10:22:08AM +0700, [EMAIL PROTECTED] wrote:
 In [EMAIL PROTECTED] Steve Kargl wrote:
   
  install -C -c -s -o root -g wheel -m 555   tfmtodit /usr/obj/usr/src/i386/usr/bin
  === tmac
  install -C -c -o root -g wheel -m 444  e.tmac-s 
/usr/obj/usr/src/i386/usr/share/tmac/e.tmac
  install: e.tmac-s: No such file or directory
  *** Error code 71
  1 error
  
  A standard "make buildworld" appears to work.
  
  troutmask:kargl[351] grep FreeBSD /usr/src/Makefile.inc1
  # $FreeBSD: src/Makefile.inc1,v 1.197 2001/04/18 12:20:28 ru Exp $
 
   The next patch allows me to 'make -j32 all install' in
 'src/gnu/usr.bin/groff/tmac'.
 
   N.Dudorov
 
 Index: Makefile
 ===
 RCS file: /scratch/CVS/src/gnu/usr.bin/groff/tmac/Makefile,v
 retrieving revision 1.27
 diff -b -u -r1.27 Makefile
 --- Makefile  2001/04/17 12:37:18 1.27
 +++ Makefile  2001/04/19 03:14:14
 @@ -37,7 +37,7 @@
  STRIPFILES=  e.tmac doc.tmac mdoc.local
  MDOCFILES=   doc-common doc-ditroff doc-nroff doc-syms koi8-r
  
 -all: ${MDOCFILES:S/$/-s/} ${STRIPFILES:S/$/-s/} ${SPECIALFILES:S/$/-s/}
 +all: ${MDOCFILES:S/$/-s/} ${STRIPFILES:S/$/-s/} ${SPECIALFILES:S/$/-s/} ${MAN}
  
  .for f in ${MDOCFILES} ${STRIPFILES}
  $f-s: $f
 @@ -51,6 +51,8 @@
   ${.ALLSRC}  ${.TARGET}
  .endfor
  
 +.ORDER: all beforeinstall
 +
  beforeinstall:
   cd ${DIST_DIR}; \
   ${INSTALL} -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
 @@ -59,14 +61,17 @@
   ${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
   hyphen.us-ru ${DESTDIR}${TMACDIR}
  .for f in ${STRIPFILES} ${SPECIALFILES}
 + cd ${.OBJDIR}; \
   ${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
   $f-s ${DESTDIR}${TMACDIR}/$f
  .endfor
  .for f in ${MDOCFILES}
 + cd ${.OBJDIR}; \
   ${INSTALL} ${COPY} -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
   $f-s ${DESTDIR}${MDOCDIR}/$f
  .endfor
  .if !exists(${DESTDIR}${TMACDIR}/man.local)
 + cd ${.OBJDIR}; \
   ${INSTALL} -c -o ${TMACOWN} -g ${TMACGRP} -m ${TMACMODE} \
   ${DIST_DIR}/man.local ${DESTDIR}${TMACDIR}
  .endif
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with "unsubscribe freebsd-current" in the body of the message

-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



make -jN bug (was: Re: groff breaks make -j N buildworld)

2001-04-19 Thread Ruslan Ermilov

On Thu, Apr 19, 2001 at 05:18:41PM +0900, Makoto MATSUSHITA wrote:
 
 ru I always thought that ``obj'', ``all'' and ``install'' should be
 ru executed in sequence, not together.  Hey, this even does not work
 ru for bin/cat:
 
 IIRC, it is assumed that "make -jX install (where X  1)" _doesn't_ work.
 I've heard why, but I've forgotten :-)
 
Attached is the Makefile that demonstrates the problem.  Run it like this:

make obj; make all

Then try:

make install

And then try:

make -j2 install

Note the difference.  This fixes the problem:

--- MakefileThu Apr 19 11:33:04 2001
+++ MakefileThu Apr 19 11:36:20 2001
@@ -8,6 +8,7 @@
 beforeinstall: .SILENT
cd ${.CURDIR}; \
${INSTALL} ${COPY} -m ${NOBINMODE} Makefile ${DESTDIR}/tmp
+   cd ${.OBJDIR}
pwd
${INSTALL} ${COPY} -m ${NOBINMODE} foo ${DESTDIR}/tmp


I'm not sure if this a make(1) bug or a feature, as both NetBSD and
OpenBSD behave the same.  But I'm pretty sure this is a bug.  Will?


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


NOMAN=  YES

all: foo

foo:
touch ${.TARGET}

beforeinstall: .SILENT
cd ${.CURDIR}; \
${INSTALL} ${COPY} -m ${NOBINMODE} Makefile ${DESTDIR}/tmp
pwd
${INSTALL} ${COPY} -m ${NOBINMODE} foo ${DESTDIR}/tmp

.include bsd.prog.mk



Re: groff breaks make -j N buildworld

2001-04-19 Thread Ruslan Ermilov

On Thu, Apr 19, 2001 at 11:12:24PM +1000, Bruce Evans wrote:
[...]
  IIRC, it is assumed that "make -jX install (where X  1)" _doesn't_ work.
  I've heard why, but I've forgotten :-)
 
 Right.  One case where it doesn't work is installing /bin/sh with the
 default install flags. /bin/sh gets clobbered, so anything that attempts
 to use it concurrently doesn't work.  In particular, a concurrent
 sub-make may fail.  This problem is avoided for some very important
 install targets like ld.so by adding -C to INSTALLFLAGS to give an
 atomic installation.  Atomic installation (but not -C) should be the
 default.
 
This one seems like an easy task, and this is suspicious...  How about
the attached patch?  I have tested it lightly, and haven't found any
problems.  Will the `make -j32 installworld' of -CURRENT be enough
test to commit this and remove -B from Makefile.inc1?

 Since make -jX install doesn't work, `make world' in /usr/src/Makefile
 uses `${MAKE} -B installworld' to turn off any previous setting of -j.
 If you make installworld directly, then then -B is not enforced, so
 you must use it in the command line if you have a setting of -j in the
 environment.
 
 ... back to `make all install'.  If this works at all, then you can
 only use it without -j, since the `install' part of it doesn't work
 with -j.  Separate steps are required to pass different flags to
 make(1).
 
Is the atomic install the only known issue for not functional
`make -jN install'?


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: make -jN bug (was: Re: groff breaks make -j N buildworld)

2001-04-19 Thread Ruslan Ermilov

On Thu, Apr 19, 2001 at 11:38:49PM +1000, Bruce Evans wrote:
 On Thu, 19 Apr 2001, Ruslan Ermilov wrote:
 
  Attached is the Makefile that demonstrates the problem.  Run it like this:
  
  make obj; make all
  
  Then try:
  
  make install
  
  And then try:
  
  make -j2 install
  
  Note the difference.  This fixes the problem:
  
  --- MakefileThu Apr 19 11:33:04 2001
  +++ MakefileThu Apr 19 11:36:20 2001
  @@ -8,6 +8,7 @@
   beforeinstall: .SILENT
  cd ${.CURDIR}; \
  ${INSTALL} ${COPY} -m ${NOBINMODE} Makefile ${DESTDIR}/tmp
  +   cd ${.OBJDIR}
  pwd
  ${INSTALL} ${COPY} -m ${NOBINMODE} foo ${DESTDIR}/tmp
  
  I'm not sure if this a make(1) bug or a feature, as both NetBSD and
  OpenBSD behave the same.  But I'm pretty sure this is a bug.  Will?
 
 This is a feature of parallel make.  Parallel make combines all of
 the commands for each target into a single shell command (if possible?).
 Thus `cd's in one command affect subsequent commands.  This feature
 can be controlled using the undocumented .SINGLESHELL directive.
 Unfortunately, the implementation of .SINGLESHELL is too primitive
 for .SINGELSHELL to be worth using.  Using it is equivalent to using
 -B to turn off -j.
 
I stand corrected.  The simple demo of this feature would be:

foo: .SILENT
VARIABLE=value
echo $${VARIABLE}

BTW, I have found the relevant info in the section 2.2 of the
/usr/share/doc/psd/12.make/ paper:

: Because all the commands are given to a single shell to execute,
: such things as setting shell variables, changing directories, etc.,
  
: last beyond the command in which they are found. This also allows
: shell compound commands (like ``for'' loops) to be entered in a
: natural manner.  Since this could cause problems for some makefiles
: that depend on each command being executed by a single shell, PMake
: has a -B flag (it stands for backwards-compatible) that forces each
: command to be given to a separate shell. It also does several other
: things, all of which I discourage since they are now old-fashioned.


Thanks,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Atomic install(1) by default (was: Re: groff breaks make -j N buildworld)

2001-04-19 Thread Ruslan Ermilov

On Thu, Apr 19, 2001 at 05:53:53PM +0300, Ruslan Ermilov wrote:
 On Thu, Apr 19, 2001 at 11:12:24PM +1000, Bruce Evans wrote:
 [...]
   IIRC, it is assumed that "make -jX install (where X  1)" _doesn't_ work.
   I've heard why, but I've forgotten :-)
  
  Right.  One case where it doesn't work is installing /bin/sh with the
  default install flags. /bin/sh gets clobbered, so anything that attempts
  to use it concurrently doesn't work.  In particular, a concurrent
  sub-make may fail.  This problem is avoided for some very important
  install targets like ld.so by adding -C to INSTALLFLAGS to give an
  atomic installation.  Atomic installation (but not -C) should be the
  default.
  
 This one seems like an easy task, and this is suspicious...  How about
 the attached patch?  I have tested it lightly, and haven't found any
 problems.  Will the `make -j32 installworld' of -CURRENT be enough
 test to commit this and remove -B from Makefile.inc1?
 
Damn, forgot to attach the patch.  Here it goes...


-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: xinstall.c
===
RCS file: /home/ncvs/src/usr.bin/xinstall/xinstall.c,v
retrieving revision 1.40
diff -u -p -r1.40 xinstall.c
--- xinstall.c  2000/10/08 09:17:56 1.40
+++ xinstall.c  2001/04/19 14:38:41
@@ -53,11 +53,6 @@ static const char rcsid[] =
  *   attribute changes and don't clear the dump flag.  (I think inode
  *   ctimes are not updated for null attribute changes, but this is a
  *   bug.)
- * o independent of -C, if a copy must be made, then copy to a tmpfile,
- *   set all attributes except the immutable flags, then rename, then
- *   set the immutable flags.  It's annoying that the immutable flags
- *   defeat the atomicicity of rename - it seems that there must be
- *   a window where the target is not immutable.
  */
 
 #include sys/param.h
@@ -347,7 +342,7 @@ install(from_name, to_name, fset, flags)
devnull = 1;
}
 
-   if (docompare) {
+   if (docopy) {
old_to_name = to_name;
/*
 * Make a new temporary file in the same file system
@@ -409,7 +404,7 @@ install(from_name, to_name, fset, flags)
 * It may be possible to better optimize the !dostrip case, however.
 * For further study.
 */
-   if (docompare) {
+   if (docopy) {
struct stat old_sb, new_sb, timestamp_sb;
int old_fd;
struct utimbuf utb;
@@ -423,7 +418,7 @@ install(from_name, to_name, fset, flags)
if (old_sb.st_flags  NOCHANGEBITS)
(void)fchflags(old_fd, old_sb.st_flags  ~NOCHANGEBITS);
fstat(to_fd, new_sb);
-   if (compare(old_fd, old_to_name, to_fd, to_name, old_sb,
+   if (!docompare || compare(old_fd, old_to_name, to_fd, to_name, old_sb,
new_sb)) {
 different:
if (debug != 0)



Re: Atomic install(1) by default (was: Re: groff breaks make -j N buildworld)

2001-04-20 Thread Ruslan Ermilov

On Fri, Apr 20, 2001 at 06:39:30AM +1000, Bruce Evans wrote:
 On Thu, 19 Apr 2001, Ruslan Ermilov wrote:
 
  On Thu, Apr 19, 2001 at 05:53:53PM +0300, Ruslan Ermilov wrote:
   On Thu, Apr 19, 2001 at 11:12:24PM +1000, Bruce Evans wrote:
atomic installation.  Atomic installation (but not -C) should be the
default.

   This one seems like an easy task, and this is suspicious...  How about
   the attached patch?  I have tested it lightly, and haven't found any
   problems.  Will the `make -j32 installworld' of -CURRENT be enough
   test to commit this and remove -B from Makefile.inc1?
   
  Damn, forgot to attach the patch.  Here it goes...
 
 This seems to be simple enough.  A bit too simple :-).  The old
 behaviour of deleting the target first is still needed at least
 optionally to handle cases where there is no space for a copy.
 
But then all atomicy goes awry.  Should I introduce -r instead (borrowed
from NetBSD)?

: -r  Install to a temporary file and then rename the file to its final
: destination name.  This can be used for precious files, to avoid
: truncation of the original when error conditions (filesystem full
: etc.) occur.

 Cleaning up the temporary files after a signal is more necessary if -C
 is the default.
 
I didn't mean to volunteer to fix all of the BUGS section :-)

 Index: xinstall.c
 ===
 RCS file: /home/ncvs/src/usr.bin/xinstall/xinstall.c,v
 retrieving revision 1.40
 diff -u -p -r1.40 xinstall.c
 --- xinstall.c2000/10/08 09:17:56 1.40
 +++ xinstall.c2001/04/19 14:38:41
 @@ -53,11 +53,6 @@ static const char rcsid[] =
   *   attribute changes and don't clear the dump flag.  (I think inode
   *   ctimes are not updated for null attribute changes, but this is a
   *   bug.)
 - * o independent of -C, if a copy must be made, then copy to a tmpfile,
 - *   set all attributes except the immutable flags, then rename, then
 - *   set the immutable flags.  It's annoying that the immutable flags
 - *   defeat the atomicicity of rename - it seems that there must be
 - *   a window where the target is not immutable.
   */
 
 The comment still applies to the -C case.  We now always make a copy, but
 for -C this is just a waste of time if the comparison succeeds.
 
I fail to understand how this still applies.  Could you please exaplain
it in a bit more details?

Also, for -C case, copy is not exactly the waste of time, and this is you
who added the comment below in revision 1.4:

/*
 * Unfortunately, because we strip the installed file and not the
 * original one, it is impossible to do the comparison without
 * first laboriously copying things over and then comparing.
 * It may be possible to better optimize the !dostrip case, however.
 * For further study.
 */

OTOH, I agree that it is probably makes sense to disable -C and -s
combo:

/*-
 * Todo:
 * o for -C, compare original files except in -s case.

And have always compare with original files.  What do you think?

 ...
 @@ -409,7 +404,7 @@ install(from_name, to_name, fset, flags)
* It may be possible to better optimize the !dostrip case, however.
* For further study.
*/
 - if (docompare) {
 + if (docopy) {
   struct stat old_sb, new_sb, timestamp_sb;
   int old_fd;
   struct utimbuf utb;
 @@ -423,7 +418,7 @@ install(from_name, to_name, fset, flags)
   if (old_sb.st_flags  NOCHANGEBITS)
   (void)fchflags(old_fd, old_sb.st_flags  ~NOCHANGEBITS);
   fstat(to_fd, new_sb);
 - if (compare(old_fd, old_to_name, to_fd, to_name, old_sb,
 + if (!docompare || compare(old_fd, old_to_name, to_fd, to_name, old_sb,
   new_sb)) {
 
 Line too long.
 
Argh, I recently added allscreens_flags="VGA_90x25" to /etc/rc.conf :-)


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Atomic install(1) by default (was: Re: groff breaks make -j N buildworld)

2001-04-20 Thread Ruslan Ermilov

Hello Bruce!

Forget all of this.  I started incorporating OpenBSD fixes to install(1).
They seem to cover all the cases you have mentioned.  I will send a CFR
when I finish.  They used your revision 1.4 as the base, and implemented
all of the todos, and even more.


Thanks,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



[CFR] OpenBSD install(1) fixes: atomic install, etc.

2001-04-20 Thread Ruslan Ermilov

Hi!

The attached patch incorporates most of OpenBSD fixes to install(1).
It does not include manpage update.  Most significant changes are:

o All TODOs are acted upon.

o New flags: -b and -B

: -bBackup any existing files before overwriting them by
:   renaming them to file.old.  See -B for specifying a
:   different backup suffix.
: 
: -B suffix
:   Use suffix as the backup suffix if -b is given.

o New flag: -S (atomic install)

: -SSafe copy.  Normally, install unlinks an existing target before
:   installing the new file.  With the -S flag a temporary file is
:   used and then renamed to be the target.  The reason this is safer
:   is that if the copy or rename fails, the existing target is left
:   untouched.

o The -c flag is now the default, and only provided for backwards
  compatibility.  We now never remove the original file.

o Flags -v and -D were withdrawn.

o strip(1) failure is not considered fatal.

Please review.


Thanks,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: xinstall.c
===
RCS file: /home/ncvs/src/usr.bin/xinstall/xinstall.c,v
retrieving revision 1.40
diff -u -p -r1.40 xinstall.c
--- xinstall.c  2000/10/08 09:17:56 1.40
+++ xinstall.c  2001/04/20 15:42:20
@@ -45,21 +45,6 @@ static const char rcsid[] =
   "$FreeBSD: src/usr.bin/xinstall/xinstall.c,v 1.40 2000/10/08 09:17:56 bde Exp $";
 #endif /* not lint */
 
-/*-
- * Todo:
- * o for -C, compare original files except in -s case.
- * o for -C, don't change anything if nothing needs be changed.  In
- *   particular, don't toggle the immutable flags just to allow null
- *   attribute changes and don't clear the dump flag.  (I think inode
- *   ctimes are not updated for null attribute changes, but this is a
- *   bug.)
- * o independent of -C, if a copy must be made, then copy to a tmpfile,
- *   set all attributes except the immutable flags, then rename, then
- *   set the immutable flags.  It's annoying that the immutable flags
- *   defeat the atomicicity of rename - it seems that there must be
- *   a window where the target is not immutable.
- */
-
 #include sys/param.h
 #include sys/wait.h
 #include sys/mman.h
@@ -82,45 +67,29 @@ static const char rcsid[] =
 
 #include "pathnames.h"
 
-/* Bootstrap aid - this doesn't exist in most older releases */
-#ifndef MAP_FAILED
-#define MAP_FAILED ((void *)-1)/* from sys/mman.h */
-#endif
-
-int debug, docompare, docopy, dodir, dopreserve, dostrip, nommap, verbose;
-int mode = S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
-char *group, *owner, pathbuf[MAXPATHLEN];
-char pathbuf2[MAXPATHLEN];
-
 #defineDIRECTORY   0x01/* Tell install it's a directory. */
 #defineSETFLAGS0x02/* Tell install to set flags. */
 #defineNOCHANGEBITS(UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND)
+#defineBACKUP_SUFFIX   ".old"
 
+struct passwd *pp;
+struct group *gp;
+int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy;
+int mode = S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH;
+char pathbuf[MAXPATHLEN], tempfile[MAXPATHLEN];
+char *suffix = BACKUP_SUFFIX;
+uid_t uid;
+gid_t gid;
+
 void   copy __P((int, char *, int, char *, off_t));
-intcompare __P((int, const char *, int, const char *, 
-const struct stat *, const struct stat *));
+intcompare __P((int, const char *, size_t, int, const char *, size_t));
+intcreate_newfile __P((char *, struct stat *));
+intcreate_tempfile __P((char *, char *, size_t));
 void   install __P((char *, char *, u_long, u_int));
 void   install_dir __P((char *));
 void   strip __P((char *));
-void   usage __P((void));
 inttrymmap __P((int));
-
-#define ALLOW_NUMERIC_IDS 1
-#ifdef ALLOW_NUMERIC_IDS
-
-uid_t   uid = -1;
-gid_t   gid = -1;
-
-uid_t  resolve_uid __P((char *));
-gid_t  resolve_gid __P((char *));
-u_long numeric_id __P((char *, char *));
-
-#else
-
-struct passwd *pp;
-struct group *gp;
-
-#endif /* ALLOW_NUMERIC_IDS */
+void   usage __P((void));
 
 int
 main(argc, argv)
@@ -132,20 +101,23 @@ main(argc, argv)
u_long fset;
u_int iflags;
int ch, no_target;
-   char *flags, *to_name;
+   char *flags, *to_name, *group = NULL, *owner = NULL;
 
iflags = 0;
-   while ((ch = getopt(argc, argv, "CcdDf:g:m:Mo:psv")) != -1)
+   while ((ch = getopt(argc, argv, "BbCcdf:g:Mm:o:pSs")) != -1)
switch((char)ch) {
+   case 'B':
+   suffix = optarg;
+   /* FALLTHROUGH */
+   case 'b':
+   dobackup = 1;
+   

Re: [CFR] OpenBSD install(1) fixes: atomic install, etc.

2001-04-20 Thread Ruslan Ermilov

On Fri, Apr 20, 2001 at 07:41:36PM +0300, Maxim Sobolev wrote:
 Konstantin Chuguev wrote:
 
  Hi,
 
  Ruslan Ermilov wrote:
 
   The attached patch incorporates most of OpenBSD fixes to install(1).
   It does not include manpage update.  Most significant changes are:
  
   o New flag: -S (atomic install)
  
   : -SSafe copy.  Normally, install unlinks an existing target before
   :   installing the new file.  With the -S flag a temporary file is
   :   used and then renamed to be the target.  The reason this is safer
   :   is that if the copy or rename fails, the existing target is left
   :   untouched.
  
 
  Just curious: why not make this way of doing install default (i.e. always use
  it)?
 
 It may effectively doubles disk space requirements during copy (when destination
 file is not on a sofdep-enabled partition and is not open at the moment when
 install(8) unlinks it). For small files it doesn't matter, but for a big ones it
 could lead to a problem.
 
I think -S should be made the default for `installworld' (this was the main
reason that triggered this work).  But I don't think this should be turned
`on' by default in install(1).

BTW, this binary just completed the `installworld' test on -STABLE.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: [CFR] OpenBSD install(1) fixes: atomic install, etc.

2001-04-20 Thread Ruslan Ermilov

On Fri, Apr 20, 2001 at 08:03:20PM +0300, Ruslan Ermilov wrote:
 On Fri, Apr 20, 2001 at 07:41:36PM +0300, Maxim Sobolev wrote:
  Konstantin Chuguev wrote:
  
   Hi,
  
   Ruslan Ermilov wrote:
  
The attached patch incorporates most of OpenBSD fixes to install(1).
It does not include manpage update.  Most significant changes are:
   
o New flag: -S (atomic install)
   
: -SSafe copy.  Normally, install unlinks an existing target before
:   installing the new file.  With the -S flag a temporary file is
:   used and then renamed to be the target.  The reason this is safer
:   is that if the copy or rename fails, the existing target is left
:   untouched.
   
  
   Just curious: why not make this way of doing install default (i.e. always use
   it)?
  
  It may effectively doubles disk space requirements during copy (when destination
  file is not on a sofdep-enabled partition and is not open at the moment when
  install(8) unlinks it). For small files it doesn't matter, but for a big ones it
  could lead to a problem.
  
 I think -S should be made the default for `installworld' (this was the main
 reason that triggered this work).  But I don't think this should be turned
 `on' by default in install(1).
 
 BTW, this binary just completed the `installworld' test on -STABLE.
 
Just tried -j32 installworld with modified install(1) binary for which
-S is the default, and it still choked on lib/libncurses.  The problem
is in bsd.man.mk: we should separate installing of manpages and their
MLINKS, otherwise links could be attempted before their originals are
installed.

Continuing with -DNOMAN now...


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: nroff -man broken?

2001-04-25 Thread Ruslan Ermilov

On Tue, Apr 24, 2001 at 10:25:47PM +0200, Riccardo Torrini wrote:
 # man man
 Formatting page, please wait...mdoc error: end-macro (.em)
respecification is not allowed. (#20)
Should this have been `.Em ...'?
 User Abort.
 Done.
 
 
 This happens over last week.  World of this night (after
 cvsup with also make kernel and mergemaster, for 4 times).
 I have also tryed to remove all */man/cat*/*gz compiled
 manuals with but luck :(  Any hints?  Thanks.
 
There was a problem caused by broken `make cleandir' behavior.
Make sure you have src/share/mk/bsd.obj.mk, revision 1.35.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: telnet -a the default

2001-05-03 Thread Ruslan Ermilov

On Sat, Apr 28, 2001 at 01:15:06PM -0700, Nick Sayer wrote:
 Ruslan Ermilov wrote:
 
  On Sat, Apr 28, 2001 at 09:34:22AM -0700, Nick Sayer wrote:
  
  Ruslan Ermilov wrote:
  
  
  On Sat, Apr 28, 2001 at 08:45:48AM -0700, Nick Sayer wrote:
  
  
  Ruslan Ermilov wrote:
  
  
  
  Hi!
  
  Any reason why revisions 1.6 and 1.7 of crypto/telnet/telnet/main.c
  are not propagated to usr.bin/telnet/main.c?
  
  Well, because it's meaningless without having encryption compiled in. 
  All of the authentication methods require encryption.
  
  
  Sorry, I meant making -a the default.
  
  
  Cheers,
  
  Again, making -a the default is meaningless without crypto.
  
  
  I just found it inconvenient to supply -K to telnet(1) every time
  now, and you know that secure/ telnet is installed by default.
  
  Could you please then tell me why -a was made the default for
  crypto telnet(1), and why it is meaningless without crypto?
 
 I didn't make -a the default for telnet, but I did MFC it just so that 
 both branches would have the same sources.
 
 -a without an authentication method ends up just giving you a login: 
 prompt from the other end. It's functionally no different than just 
 doing it the old fashioned way.
 
Assar,

What is the reason why -a was made the default for crypto/ telnet?
Is it the prerequisite for auto-negotiation of encrypt and decrypt
committed in crypto/telnet/telnet/main.c,v 1.6 or could it be made
optional?


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



DEVFS

2001-05-10 Thread Ruslan Ermilov

Hi!

Just installed recent -CURRENT on my PC, and noticed strange things:

1)  If I don't have devfs line in /etc/fstab, why DEVFS mount is still
happening on /dev, and where?

2)  Is it valid that multiple DEVFS mounts over /dev are allowed?

perl# mount -t devfs
devfs on /dev (devfs, local)
perl# mount /dev
perl# mount -t devfs
devfs on /dev (devfs, local)
devfs on /dev (devfs, local)
perl# mount /dev
perl# mount -t devfs
devfs on /dev (devfs, local)
devfs on /dev (devfs, local)
devfs on /dev (devfs, local)
perl#


Thanks,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: cvs commit: src Makefile.inc1

2001-05-15 Thread Ruslan Ermilov

On Mon, May 14, 2001 at 10:21:02AM -0700, Ruslan Ermilov wrote:
 ru  2001/05/14 10:21:02 PDT
 
   Modified files:
 .Makefile.inc1 
   Log:
   Add kbdcontrol(1) to bootstrap-tools.
   This fixes the upgrade path breakage in usr.sbin/sysinstall.
   
   Revision  ChangesPath
   1.201 +2 -1  src/Makefile.inc1
 
Argh, this doesn't work either.  I first tried this with some stuff
commented out in Makefile.inc1, and it succeeded.  But at the time
kbdcontrol is built in bootstrap-tools, ${WORLDTMP}/usr/include is
not yet populated, and kbdcontrol.c requires an up-to-date header
files.  OTOH, the bootstrap-tools are supposed to be built under
the host environment, so compiling against CURRENT sources would
be a bug.  Ideas?

--
 stage 1: bootstrap tools
--
[...]
cd /CURRENT/usr/src/usr.sbin/kbdcontrol;  make obj;  make depend;  make all;  make 
install
/usr/obj/CURRENT/usr/src/i386/CURRENT/usr/src/usr.sbin/kbdcontrol created for 
/CURRENT/usr/src/usr.sbin/kbdcontrol
lex -t  /CURRENT/usr/src/usr.sbin/kbdcontrol/lex.l  lex.c
rm -f .depend
mkdep -f .depend -a-I/CURRENT/usr/src/usr.sbin/kbdcontrol 
-I/usr/obj/CURRENT/usr/src/i386/usr/include  
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c lex.c
cd /CURRENT/usr/src/usr.sbin/kbdcontrol; make _EXTRADEPEND
echo kbdcontrol: /usr/obj/CURRENT/usr/src/i386/usr/lib/libc.a 
/usr/obj/CURRENT/usr/src/i386/usr/lib/libl.a  .depend
cc -O -pipe  -I/CURRENT/usr/src/usr.sbin/kbdcontrol   
-I/usr/obj/CURRENT/usr/src/i386/usr/include -c 
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c: In function `get_entry':
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c:206: `PASTE' undeclared (first use 
in this function)
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c:206: (Each undeclared identifier is 
reported only once
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c:206: for each function it appears 
in.)
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c: In function `print_entry':
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c:444: `PASTE' undeclared (first use 
in this function)
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c: In function `dump_entry':
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c:646: `PASTE' undeclared (first use 
in this function)
*** Error code 1

Stop in /CURRENT/usr/src/usr.sbin/kbdcontrol.
*** Error code 1

Stop in /CURRENT/usr/src.
*** Error code 1

Stop in /CURRENT/usr/src.
*** Error code 1

Stop in /CURRENT/usr/src.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: cvs commit: src Makefile.inc1

2001-05-15 Thread Ruslan Ermilov

OK, more details on 4.3-STABLE - 5.0-CURRENT upgrade path breakage.

1.  kbdcontrol(1) is used by usr.sbin/sysinstall/Makefile to generate
keymap.h with keyboard maps.

2.  Recent usr.sbin/sysinstall/Makefile wants to generate keymap.h
from current keymap sources in ../../share/syscons/keymaps,
so it should use current kbdcontrol(1) as well because:
a) only -CURRENT kbdcontrol(1) understands ${KEYMAP_PATH}
b) only current kbdcontrol(1) may understand current keymap
   file syntax, as is the keyboard paste feature for now.

3.  So usr.sbin/kbdcontrol should be in Makefile.inc1:bootstrap-tools.

4.  But bootstrap-tools are supposed to be built in a host environment,
and -CURRENT kbdcontrol(1) couldn't be built on -STABLE because it
requires -CURRENT sys/sys/kbio.h header (the PASTE define).

I'm currently testing with -I${.CURDIR}/../../sys added to the
kbdcontrol/Makefile, but this is a gross hack.

On Tue, May 15, 2001 at 04:19:57PM +0300, Ruslan Ermilov wrote:
 On Mon, May 14, 2001 at 10:21:02AM -0700, Ruslan Ermilov wrote:
  ru  2001/05/14 10:21:02 PDT
  
Modified files:
  .Makefile.inc1 
Log:
Add kbdcontrol(1) to bootstrap-tools.
This fixes the upgrade path breakage in usr.sbin/sysinstall.

Revision  ChangesPath
1.201 +2 -1  src/Makefile.inc1
  
 Argh, this doesn't work either.  I first tried this with some stuff
 commented out in Makefile.inc1, and it succeeded.  But at the time
 kbdcontrol is built in bootstrap-tools, ${WORLDTMP}/usr/include is
 not yet populated, and kbdcontrol.c requires an up-to-date header
 files.  OTOH, the bootstrap-tools are supposed to be built under
 the host environment, so compiling against CURRENT sources would
 be a bug.  Ideas?
 
 --
  stage 1: bootstrap tools
 --
 [...]
 cd /CURRENT/usr/src/usr.sbin/kbdcontrol;  make obj;  make depend;  make all;  make 
install
 /usr/obj/CURRENT/usr/src/i386/CURRENT/usr/src/usr.sbin/kbdcontrol created for 
/CURRENT/usr/src/usr.sbin/kbdcontrol
 lex -t  /CURRENT/usr/src/usr.sbin/kbdcontrol/lex.l  lex.c
 rm -f .depend
 mkdep -f .depend -a-I/CURRENT/usr/src/usr.sbin/kbdcontrol 
-I/usr/obj/CURRENT/usr/src/i386/usr/include  
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c lex.c
 cd /CURRENT/usr/src/usr.sbin/kbdcontrol; make _EXTRADEPEND
 echo kbdcontrol: /usr/obj/CURRENT/usr/src/i386/usr/lib/libc.a 
/usr/obj/CURRENT/usr/src/i386/usr/lib/libl.a  .depend
 cc -O -pipe  -I/CURRENT/usr/src/usr.sbin/kbdcontrol   
-I/usr/obj/CURRENT/usr/src/i386/usr/include -c 
/CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c
 /CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c: In function `get_entry':
 /CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c:206: `PASTE' undeclared (first use 
in this function)
 /CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c:206: (Each undeclared identifier 
is reported only once
 /CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c:206: for each function it appears 
in.)
 /CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c: In function `print_entry':
 /CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c:444: `PASTE' undeclared (first use 
in this function)
 /CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c: In function `dump_entry':
 /CURRENT/usr/src/usr.sbin/kbdcontrol/kbdcontrol.c:646: `PASTE' undeclared (first use 
in this function)
 *** Error code 1
 
 Stop in /CURRENT/usr/src/usr.sbin/kbdcontrol.
 *** Error code 1
 
 Stop in /CURRENT/usr/src.
 *** Error code 1
 
 Stop in /CURRENT/usr/src.
 *** Error code 1
 
 Stop in /CURRENT/usr/src.
 
 
 Cheers,
 -- 
 Ruslan ErmilovOracle Developer/DBA,
 [EMAIL PROTECTED] Sunbay Software AG,
 [EMAIL PROTECTED]FreeBSD committer,
 +380.652.512.251  Simferopol, Ukraine
 
 http://www.FreeBSD.orgThe Power To Serve
 http://www.oracle.com Enabling The Information Age

-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: cvs commit: src Makefile.inc1

2001-05-15 Thread Ruslan Ermilov

On Tue, May 15, 2001 at 05:42:04PM +0300, Peter Pentchev wrote:
[...]
 Can't you teach sysinstall/Makefile to use the kbdcontrol in
 ${.OBJDIR}/../kbdcontrol/kbdcontrol instead, and make it somehow
 depend on kbdcontrol being built beforehand?
 
Doing it this way would break cross-platform builds.


-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: cvs commit: src Makefile.inc1

2001-05-16 Thread Ruslan Ermilov

On Tue, May 15, 2001 at 05:02:25PM -0600, Warner Losh wrote:
 In message [EMAIL PROTECTED] Maxim Sobolev writes:
 : Perhaps we could rip off the code that dumps keymap file into a
 : little utility on its own and use this utility to bootstrap
 : sysinstall. I could look into this direction if there aren't better
 : ideas.
 
 I think your idea of just defining PASTE is the best way to go.  I
 came up with it independently after trying a number of different ideas
 on how to get around this.
 
FWIW, my gross hack to usr.sbin/kbdcontrol also worked:

Index: Makefile
===
RCS file: /home/ncvs/src/usr.sbin/kbdcontrol/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- Makefile2001/03/26 14:40:28 1.8
+++ Makefile2001/05/16 07:19:20
@@ -3,6 +3,7 @@
 PROG=  kbdcontrol
 SRCS=  kbdcontrol.c lex.l
 CFLAGS+= -I${.CURDIR}
+CFLAGS+=-I${.CURDIR}/../../sys
 MAN=   kbdcontrol.1 kbdmap.5
 MLINKS= kbdmap.5 keymap.5
 DPADD= ${LIBL}


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Shouldn't wchar.h get copied somewhere during build?

2001-05-16 Thread Ruslan Ermilov
.

-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: cvs commit: src Makefile.inc1

2001-05-16 Thread Ruslan Ermilov

On Thu, May 17, 2001 at 12:51:59AM +1000, Bruce Evans wrote:
 On Wed, 16 May 2001, Warner Losh wrote:
 
  In message [EMAIL PROTECTED] Ruslan Ermilov writes:
  : FWIW, my gross hack to usr.sbin/kbdcontrol also worked:
  
  I tend to dislike adding ../../sys to the includes list since they
  might not be compatible with the host's sys files used to build libc.
 
 I'd like to remove all the existing ones.  They are a hack to handle
 the case where you haven't bootstrapped properly.  They intentionally
 give sys includes which may be incompatible with the host ones, in
 case the host ones are out of date relative to the src tree.  This
 depends on only a few headers like sys/user.h being out of date,
 and sometimes helps mainly for headers like sys/user.h which declare
 system structures that are groped in by userland.  But it is just a
 bug in general.
 
I would probably volunteer for doing this.


-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: cvs commit: src Makefile.inc1

2001-05-17 Thread Ruslan Ermilov

On Thu, May 17, 2001 at 08:14:10PM +1000, Bruce Evans wrote:
 On Wed, 16 May 2001, Warner Losh wrote:
 
  In message [EMAIL PROTECTED] Brian Somers writes:
  : How should this be done - and where should I install digiio.h if 
  : that's what's required ?
  
  I think that ppi device sets the standard here.  It installs into
  /usr/include/dev/ppi/ppi*.h.  digiio should likely do the same.
 
 Ugh.  ppi (actually ppbus) sets a bad example.  A /usr/include/dev
 tree with an average of 1+epsilon files per directory is even worse
 than a /sys/dev tree with an average of about 3 files per directory
 (not counting 4 CVS files per directory).  ppbus actually installs a
 lot of kernel-only headers so /sys/dev/ppbus is not all that small.
 
 Most headers that define ioctls are in sys.  I think there should
 be at most one directory for ioctl headers and it shouldn't be a subdir
 of /usr/include/sys (/usr/include/sys/dev doesn't even reflect the
 kernel tree).
 
Might I guess it should probably be called /usr/include/sys/io[ctl],
and digiio.h put there.


-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Where to put include files (was: cvs commit: src Makefile.inc1)

2001-05-17 Thread Ruslan Ermilov

On Thu, May 17, 2001 at 05:37:54PM +0100, Brian Somers wrote:
 [cc'd to -arch and not to cvs-committers]
 
 For anyone that's reading -arch and hasn't seen this on -current, the 
 thread is discussing userland sources that have -I../../sys in their 
 Makefile and then #include sys/dev/blahio.h.
 
 I think everyone agrees that these headers should be made public, the 
 question is ``where to put them ?''.
 
 Warner wrote:
  In message [EMAIL PROTECTED] Brian
  Somers writes:
  : Solaris calls it's ioctl files /usr/include/sys/driver_io.h so I'd 
  : spell digiio.h /usr/include/sys/digi_io.h.
  
  Actually, the more I think about it, the more I like putting it in
  /usr/include/sys/fooio.h.  We have lots of other files there now.  The
  down side to this approach is that it breaks up the driver sources
  that we've been trying to concentrate into sys/dev/foo/* (or
  introduces asymetry such that you can't just toss in a -I/sys and have
  the same tree that gets stuck under /usr/include).
 
 The SHARED variable in src/include/Makefile makes this side of things 
 tricky too - we've got to be careful that we either keep our sources 
 together and maintain a resemblance of the hierarchy in /usr/include 
 or split our sources.
 
 When I was working on Solaris I found it better to have the *io.h 
 files in sys (separate from the driver) as it made it very clear that 
 it was a public interface - the driver lived somewhere that just got 
 built into a module and wasn't seen by the outside world.
 
 So I think I'd tend to vote (FWIW) for moving digiio.h (and other 
 similar things) out of sys/dev/drivername/ and into sys/sys/.
 
 Comments ?
 
More to that.

There are 59 Makefiles that have -I${.CURDIR}/(../)+sys in them.
All these are bogus.  We should get rid of all of them (-I's).

So far, I have found sbin/mount_* use headers from /sys/miscfs/
that are not installed into /usr/include, but should be.  Where
should these be installed?  /usr/include/fs/fs_from_miscfs or
should we preserve the /usr/include/miscfs/ layout like in
/sys/miscfs?  Modern fs'es install their headers into include/fs
and old ones in include/fs.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Where to put include files (was: cvs commit: src Makefile.inc1)

2001-05-18 Thread Ruslan Ermilov

On Thu, May 17, 2001 at 07:52:51PM +0300, Ruslan Ermilov wrote:
[...]
 
 There are 59 Makefiles that have -I${.CURDIR}/(../)+sys in them.
 All these are bogus.  We should get rid of all of them (-I's).
 
 So far, I have found sbin/mount_* use headers from /sys/miscfs/
 that are not installed into /usr/include, but should be.  Where
 should these be installed?  /usr/include/fs/fs_from_miscfs or
 should we preserve the /usr/include/miscfs/ layout like in
 /sys/miscfs?  Modern fs'es install their headers into include/fs
 and old ones in include/fs.
 
I have removed the -I${.CURDIR}/.../sys from the half of Makefiles
that do not actually need it.  Here is the rest of Makefiles that
have the -I${.CURDIR}/.../sys in them, and it's currently required
because they use headers from /sys that do not get installed into
/usr/include (but should):

sbin/atm/atm/Makefile
sbin/atm/fore_dnld/Makefile
sbin/atm/ilmid/Makefile

sbin/mount_null/Makefile
sbin/mount_portal/Makefile
sbin/mount_umap/Makefile
sbin/mount_union/Makefile

sbin/vinum/Makefile

usr.sbin/acpi/Makefile.inc  very interesting example!

usr.sbin/ancontrol/Makefile

usr.sbin/dpt/dpt_ctlinfo/Makefile
usr.sbin/dpt/dpt_ctls/Makefile
usr.sbin/dpt/dpt_dm/Makefile
usr.sbin/dpt/dpt_led/Makefile   these even don't compile!!!
usr.sbin/dpt/dpt_sig/Makefile
usr.sbin/dpt/dpt_softc/Makefile
usr.sbin/dpt/dpt_sysinfo/Makefile

usr.sbin/mlxcontrol/Makefile
usr.sbin/pciconf/Makefile
usr.sbin/pnpinfo/Makefile
usr.sbin/pstat/Makefile
usr.sbin/raycontrol/Makefile
usr.sbin/setkey/Makefile
usr.sbin/sicontrol/Makefile


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Where to put include files (was: cvs commit: src Makefile.inc1)

2001-05-18 Thread Ruslan Ermilov

On Fri, May 18, 2001 at 05:11:11PM +0300, Ruslan Ermilov wrote:
 On Thu, May 17, 2001 at 07:52:51PM +0300, Ruslan Ermilov wrote:
 [...]
  
  There are 59 Makefiles that have -I${.CURDIR}/(../)+sys in them.
  All these are bogus.  We should get rid of all of them (-I's).
  
  So far, I have found sbin/mount_* use headers from /sys/miscfs/
  that are not installed into /usr/include, but should be.  Where
  should these be installed?  /usr/include/fs/fs_from_miscfs or
  should we preserve the /usr/include/miscfs/ layout like in
  /sys/miscfs?  Modern fs'es install their headers into include/fs
  and old ones in include/fs.
  
 I have removed the -I${.CURDIR}/.../sys from the half of Makefiles
 that do not actually need it.  Here is the rest of Makefiles that
 have the -I${.CURDIR}/.../sys in them, and it's currently required
 because they use headers from /sys that do not get installed into
 /usr/include (but should):
 
[...]
 
 sbin/mount_null/Makefile
 sbin/mount_portal/Makefile
 sbin/mount_umap/Makefile
 sbin/mount_union/Makefile
 
FS headers should go into /usr/include/fs/fsfs.h, one per
each filesystem.

Boris, could you please move smbfs.h one directory up from the
/usr/include/fs/smbfs/?  Also, installing of smbfs_node.h and
smbfs_subr.h seems to be not required as these are used solely
within the kernel.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: -STABLE kernel build broken?

2001-05-21 Thread Ruslan Ermilov

On Mon, May 21, 2001 at 07:01:19AM -0700, David Wolfskill wrote:
 Seems that perhaps the MFC of some changes to mbuf.h also needed some
 corresponding changes elsewhere (such as netncp/ncp_rq.c).
 
 This is on a system running:
 FreeBSD dhcp-133.catwhisker.org 4.3-STABLE FreeBSD 4.3-STABLE #20: Sun May 20 
06:23:46 PDT 2001 
[EMAIL PROTECTED]:/common/S2/obj/usr/src/sys/LAPTOP_30W  i386
 
 Tail end of the log:
 
  Kernel build for LAPTOP_30W started on Mon May 21 06:25:33 PDT 2001
 ...
 === msdos
 ...
 === ncp
 ...
 cc -O -pipe   -D_KERNEL -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes 
 -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions -ansi 
-DKLD_MODULE -nostdinc -I-  -I. -I@ -I@/../include  -mpreferred-stack-boundary=2 -c 
/usr/src/sys/modules/ncp/../../netncp/ncp_rq.c
 /usr/src/sys/modules/ncp/../../netncp/ncp_rq.c:49: conflicting types for `m_getm'
 @/sys/mbuf.h:572: previous declaration of `m_getm'
 /usr/src/sys/modules/ncp/../../netncp/ncp_rq.c:49: warning: redundant redeclaration 
of `m_getm' in same scope
 @/sys/mbuf.h:572: warning: previous declaration of `m_getm'
 *** Error code 1
 
 Stop in /usr/src/sys/modules/ncp.
 *** Error code 1
 
 Stop in /usr/src/sys/modules.
 *** Error code 1
 
 Stop in /common/S2/obj/usr/src/sys/LAPTOP_30W.
 *** Error code 1
 
 
 /usr/src/sys/sys/mbuf.h is:
  * $FreeBSD: src/sys/sys/mbuf.h,v 1.44.2.9 2001/05/21 07:01:44 bp Exp $
 
 and /usr/src/sys/netncp/ncp_rq.c is:
  * $FreeBSD: src/sys/netncp/ncp_rq.c,v 1.1 1999/10/02 04:06:17 bp Exp $
 
 (The latter is up to 1.7 in -CURRENT.)
 
1.3 without M_WAIT - M_TRYWAIT should work.


-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



__FreeBSD_version and -CURRENT

2001-05-21 Thread Ruslan Ermilov

Hi!

Is there any sense at all in bumping __FreeBSD_version in -CURRENT?
(I would have liked to see FreeBSD 5.0-RELEASE go with 50.)


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



[CFR] /sys/miscfs/* - /sys/fs/

2001-05-21 Thread Ruslan Ermilov

Hi!

The below patch moves /sys/miscfs/* to /sys/fs.
Also, it installs missing headers to /usr/include
and removes explicit -I${.CURDIR}/../../sys lines
from various Makefiles.

For testers: the patch assumes that the repo-copy
of /sys/miscfs/* to /sys/fs has already been made,
so you will also need to (cd /sys; mv miscfs/* fs)
before applying the patch.

The patch is available from here:

http://www.FreeBSD.org/~ru/miscfs2fs.patch


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



** HEADS UP **: sys/miscfs file systems moved

2001-05-23 Thread Ruslan Ermilov

Dear -CURRENT users,

Please note that:

- FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION file
  systems were repo-copied from sys/miscfs to sys/fs.

- Renamed the following file systems and their modules:
  fdesc - fdescfs, portal - portalfs, union - unionfs.

- Renamed corresponding kernel options:
  FDESC - FDESCFS, PORTAL - PORTALFS, UNION - UNIONFS.

- Install header files for the above file systems.


Warner, could you please add this to UPDATING?


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: ** HEADS UP **: sys/miscfs file systems moved

2001-05-23 Thread Ruslan Ermilov

On Wed, May 23, 2001 at 12:52:40PM +0100, Brian Somers wrote:
  Dear -CURRENT users,
  
  Please note that:
  
  - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION file
systems were repo-copied from sys/miscfs to sys/fs.
  
  - Renamed the following file systems and their modules:
fdesc - fdescfs, portal - portalfs, union - unionfs.
  
  - Renamed corresponding kernel options:
FDESC - FDESCFS, PORTAL - PORTALFS, UNION - UNIONFS.
  
  - Install header files for the above file systems.
  
  
  Warner, could you please add this to UPDATING?
 
 It may also be worth mentioning that people should move /usr/include 
 to (say) /usr/include.not before their next installworld and nuke 
 /usr/include.not after it completes.
 
Why?  Only new headers get installed, no old headers were withdrawn.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



sbin/vinum broken

2001-05-23 Thread Ruslan Ermilov

Hi!

src/sbin/vinum is broken at the moment.
It doesn't build without -DVINUMDEBUG.

A quick workaround:

Index: Makefile
===
RCS file: /home/ncvs/src/sbin/vinum/Makefile,v
retrieving revision 1.20
diff -u -r1.20 Makefile
--- Makefile2001/05/23 05:24:53 1.20
+++ Makefile2001/05/23 13:55:24
@@ -5,6 +5,7 @@
 MAN=   vinum.8
 
 CFLAGS+=   -I${.CURDIR}/../../sys -Wall
+CFLAGS+=   -DVINUMDEBUG
 
 # Print __FILE__ and __LINE__ when doing perror()
 #CFLAGS+=  -DDEVBUG



Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: sbin/vinum broken

2001-05-23 Thread Ruslan Ermilov

On Wed, May 23, 2001 at 09:08:31AM -0700, David Wolfskill wrote:
 Date: Wed, 23 May 2001 16:56:39 +0300
 From: Ruslan Ermilov [EMAIL PROTECTED]
 
 src/sbin/vinum is broken at the moment.
 It doesn't build without -DVINUMDEBUG.
 
 A quick workaround:
 
 [Workaround -- adding CFLAGS+= -DVINUMDEBUG to
 src/sbin/vinum/Makefile -- elided]
 
 OK; I verified that I experienced this, as well.  After applying the
 workaround, I continued with make everything  make kernel
 KERNCONF=LAPTOP_30W  make installworld  mergemaster.
 
 The make installworld dies, however:
 
 cd /usr/src/include/../sys;  install -C -C -o root -g wheel -m 444 dev/usb/*.h  
/usr/include/dev/usb
 cd /usr/src/include/../sys;  install -C -C -o root -g wheel -m 444 dev/wi/*.h  
/usr/include/dev/wi
 cd /usr/src/include/../sys;  install -C -C -o root -g wheel -m 444 fs/fdesc/*.h  
/usr/include/fs/fdesc
 install: fs/fdesc/*.h: No such file or directory
 *** Error code 71
 
 Stop in /usr/src/include.
 *** Error code 1
 
 Stop in /usr/src.
 *** Error code 1
 
Already fixed in src/include/Makefile,v 1.139, sorry for that!


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: sbin/vinum broken

2001-05-24 Thread Ruslan Ermilov

On Thu, May 24, 2001 at 09:24:56AM +0930, Greg Lehey wrote:
 On Wednesday, 23 May 2001 at 16:56:39 +0300, Ruslan Ermilov wrote:
  Hi!
 
  src/sbin/vinum is broken at the moment.
  It doesn't build without -DVINUMDEBUG.
 
 *sigh*.  I could have sworn I tested this, but it seems I did it in a
 parallel universe.  It's fixed now, I think.  me-pointyhat++;
 
 
  A quick workaround:
 
  Index: Makefile
  ===
  RCS file: /home/ncvs/src/sbin/vinum/Makefile,v
  retrieving revision 1.20
  diff -u -r1.20 Makefile
  --- Makefile2001/05/23 05:24:53 1.20
  +++ Makefile2001/05/23 13:55:24
  @@ -5,6 +5,7 @@
   MAN=   vinum.8
 
   CFLAGS+=   -I${.CURDIR}/../../sys -Wall
  +CFLAGS+=   -DVINUMDEBUG
 
 This didn't work for me:
 
 === root@zaphod (/dev/ttyp1) /src/FreeBSD/5.0-CURRENT/src/sbin/vinum 4 - make
 Warning: Using /wantadilla/home/obj/src/FreeBSD/5.0-CURRENT/src/sbin/vinum as object 
directory instead of canonical /usr/obj/src/FreeBSD/5.0-CURRENT/src/sbin/vinum
 cc -O -pipe -c /src/FreeBSD/5.0-CURRENT/src/sbin/vinum/v.c
 In file included from /src/FreeBSD/5.0-CURRENT/src/sbin/vinum/v.c:57:
 /src/FreeBSD/5.0-CURRENT/src/sbin/vinum/vext.h:75: dev/vinum/vinumvar.h: No such 
file or directory
 /src/FreeBSD/5.0-CURRENT/src/sbin/vinum/vext.h:76: dev/vinum/vinumio.h: No such file 
or directory
 /src/FreeBSD/5.0-CURRENT/src/sbin/vinum/vext.h:77: dev/vinum/vinumkw.h: No such file 
or directory
 /src/FreeBSD/5.0-CURRENT/src/sbin/vinum/vext.h:78: dev/vinum/vinumutil.h: No such 
file or directory
 
 Am I missing something?
 
I bet you specified CFLAGS on a command line, and that clobbered
CFLAGS+=-I${.CURDIR}/../../sys from Makefile.  Otherwise, I fail
to see why there's no -I... in the above output.

Missing /usr/include/dev/vinum headers, yeah?  :-)


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: ** HEADS UP **: sys/miscfs file systems moved

2001-05-25 Thread Ruslan Ermilov

On Thu, May 24, 2001 at 04:49:08PM -0600, Warner Losh wrote:
 In message [EMAIL PROTECTED] Brian Somers writes:
 : It may also be worth mentioning that people should move /usr/include 
 : to (say) /usr/include.not before their next installworld and nuke 
 : /usr/include.not after it completes.
 
 Eh?  that's a bug in the installation proceedure then.
 
Don't I answered this question?  Only new subdirs have appeared.


-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: 'make includes' ownership patch

2001-05-28 Thread Ruslan Ermilov

On Sat, May 26, 2001 at 03:06:00PM -0700, Kris Kennaway wrote:
 On Sat, May 26, 2001 at 02:59:22PM -0700, Kris Kennaway wrote:
  Shouldn't the includes/Makefile be installing headers using
  INCOWN/INCGRP instead of BINOWN/BINGRP?  I ran into this when trying
  to do a 'make includes' as a normal user.
 
 Oops, hit send too soon; more changes are required of the same form.
 Before I go to the trouble of doing those, I might as well get
 confirmation whether this is the right thing to do.
 
This was on my TODO.  The only problem with INCOWN/INCGRP not being
used here is that they were introduced long after include/Makefile.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: 'make includes' ownership patch

2001-05-28 Thread Ruslan Ermilov

On Mon, May 28, 2001 at 10:26:11AM -0700, David O'Brien wrote:
 On Mon, May 28, 2001 at 10:22:33AM -0700, Rodney W. Grimes wrote:
   This was on my TODO.  The only problem with INCOWN/INCGRP not being
   used here is that they were introduced long after include/Makefile.
  
  And perhaps one should go read the commit message that introduced them...
  it was an experiment, a sample test designed to only be used in -current
  /usr/src/lib, that BDE, Sheldon and myself had long followon conversations
  about, and got dropped into the cracks.
 
 What was the reasoning for a serperate owner specification from BIN*?
 
Because headers are installed with NOBINMODE, not BINMODE :-)


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: set*uid broken?

2001-06-06 Thread Ruslan Ermilov

Fixed in sys/kern/kern_prot.c,v 1.93.  Thanks for the report!

On Wed, Jun 06, 2001 at 11:18:15AM +0200, Alexander Leidinger wrote:
 Hi,
 
 (3) root@ttyp0 # ktrace fetchnews
 fetchnews: must be run as news or root
 
 (4) root@ttyp0 # id
 uid=0(root) gid=0(wheel) groups=0(wheel), 2(kmem), 3(sys), 4(tty), 5(operator), 
20(staff), 31(guest)
 
 (5) root@ttyp0 # ll `which fetchnews`
 -r-xr-xr-x  1 root  wheel  58996 Apr  6 15:32 /usr/local/sbin/fetchnews*
 
 (6) root@ttyp0 # ldd `which fetchnews`   
 /usr/local/sbin/fetchnews:
 libc.so.5 = /usr/lib/libc.so.5 (0x28074000)
 
 (7) root@ttyp0 # kdump |grep -e [ug]id
   1860 fetchnews CALL  geteuid
   1860 fetchnews RET   geteuid 0
   1860 fetchnews CALL  getuid
   1860 fetchnews RET   getuid 0
   1860 fetchnews CALL  getegid
   1860 fetchnews RET   getegid 0
   1860 fetchnews CALL  getgid
   1860 fetchnews RET   getgid 0
   1860 fetchnews CALL  geteuid
   1860 fetchnews RET   geteuid 0
   1860 fetchnews CALL  setregid(0x,0x8)
   1860 fetchnews RET   setregid 0
   1860 fetchnews CALL  setreuid(0x,0x8)
   1860 fetchnews RET   setreuid 0
   1860 fetchnews CALL  geteuid
   1860 fetchnews RET   geteuid 8
   1860 fetchnews CALL  getegid
   1860 fetchnews RET   getegid 0
 
 -current from yesterday, leafnode+-2.12, ktrace.out available on request
 (I didn't want to mail 21k to everyone).
 
 I noticed some mails about changed set*uid behavior, is this a buggy
 program, or is it a bug in -current?
 
 Bye,
 Alexander.

-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



** HEADS UP **: -nostdinc -Wfoo == -DNO_WERROR is temporarily the default for `buildworld'

2001-06-11 Thread Ruslan Ermilov

Hi!

-DNO_WERROR (which effectively disables the -Werror) is temporarily
the default for `buildworld' because restored -nostdinc bit affects
the gcc(1) warning produced for /usr/include headers.
(See Makefile.inc1,v 1.203.)

For example, if run with -nostdinc, bin/chmod bombs with the following:

: Warning: Object directory not changed from original /home/ru/1/chmod
: cc -O -pipe   -nostdinc -I/usr/include -W -Wall -Wstrict-prototypes 
:-Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Werror -Wreturn-type 
:-Wcast-qual -Wwrite-strings -Wswitch -Wshadow  -c chmod.c
: cc1: warnings being treated as errors
: In file included from chmod.c:53:
: /usr/include/fts.h:48: warning: function declaration isn't a prototype
: *** Error code 1
: 
: Stop in /home/ru/1/chmod.

While this is definitely a problem in fts.h, which is fixed with the
attached patch, it is unclear why this warning is hidden after the
-nostdinc.

PLEASE DON'T FIX THE HEADERS UNTIL WE FIGURE OUT WHY THIS IS HIDDEN
AFTER -nostdinc.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: ** HEADS UP **: -nostdinc -Wfoo == -DNO_WERROR is temporarily the default for `buildworld'

2001-06-11 Thread Ruslan Ermilov

On Mon, Jun 11, 2001 at 09:26:28PM +0300, Ruslan Ermilov wrote:
[...]
 While this is definitely a problem in fts.h, which is fixed with the
 attached patch, it is unclear why this warning is hidden after the
 -nostdinc.
 
For those interested, here's the missing patch.


-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: include/fts.h
===
RCS file: /home/ncvs/src/include/fts.h,v
retrieving revision 1.3
diff -u -p -r1.3 fts.h
--- include/fts.h   1997/05/07 19:59:58 1.3
+++ include/fts.h   2001/06/11 18:20:14
@@ -45,7 +45,8 @@ typedef struct {
int fts_rfd;/* fd for root */
int fts_pathlen;/* sizeof(path) */
int fts_nitems; /* elements in the sort array */
-   int (*fts_compar)();/* compare function */
+   int (*fts_compar)   /* compare function */
+   __P((const struct _ftsent **, const struct _ftsent **));
 
 #defineFTS_COMFOLLOW   0x001   /* follow command line symlinks */
 #defineFTS_LOGICAL 0x002   /* logical walk */
Index: lib/libc/gen/fts.c
===
RCS file: /home/ncvs/src/lib/libc/gen/fts.c,v
retrieving revision 1.18
diff -u -p -r1.18 fts.c
--- lib/libc/gen/fts.c  2001/06/01 21:53:50 1.18
+++ lib/libc/gen/fts.c  2001/06/11 18:20:17
@@ -936,7 +936,8 @@ fts_sort(sp, head, nitems)
}
for (ap = sp-fts_array, p = head; p; p = p-fts_link)
*ap++ = p;
-   qsort((void *)sp-fts_array, nitems, sizeof(FTSENT *), sp-fts_compar);
+   qsort((void *)sp-fts_array, nitems, sizeof(FTSENT *),
+   (int (*) __P((const void *, const void *)))sp-fts_compar);
for (head = *(ap = sp-fts_array); --nitems; ++ap)
ap[0]-fts_link = ap[1];
ap[0]-fts_link = NULL;



Patch to restore WARNS feature

2001-06-12 Thread Ruslan Ermilov

Hi!

The attached patch enables us to restore the -Werror bit of
the WARNS feature by fixing relevant headers and adding one
new header, complex.h, aligned with the POSIX.1-200x draft.

I did not fix the CSRG's libm (-DWANT_CSRG_LIBM) because it
does not compile with the current sources for the reason of
missing library functions.

Also, the -traditional-cpp bit in games/adventure/Makefile
correlares badly with -nostdinc and WARNS=2.

Please review (tested).


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: Makefile.inc1
===
RCS file: /home/ncvs/src/Makefile.inc1,v
retrieving revision 1.203
diff -u -p -r1.203 Makefile.inc1
--- Makefile.inc1   2001/06/11 18:09:08 1.203
+++ Makefile.inc1   2001/06/12 12:39:19
@@ -200,7 +200,7 @@ WMAKEENV=   ${CROSSENV} \
DESTDIR=${WORLDTMP} \
INSTALL=sh ${.CURDIR}/tools/install.sh \
PATH=${TMPPATH}
-WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1 -DNO_WERROR
+WMAKE= ${WMAKEENV} ${MAKE} -f Makefile.inc1
 
 # install stage
 IMAKEENV=  ${CROSSENV} \
Index: games/adventure/Makefile
===
RCS file: /home/ncvs/src/games/adventure/Makefile,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile
--- games/adventure/Makefile2001/05/20 05:37:46 1.10
+++ games/adventure/Makefile2001/06/12 12:39:19
@@ -4,7 +4,6 @@
 PROG=  adventure
 SRCS=  main.c init.c done.c save.c subr.c vocab.c wizard.c io.c data.c crc.c
 MAN=   adventure.6
-CFLAGS+=-traditional-cpp
 HIDEGAME=hidegame
 CLEANFILES=data.c setup setup.o
 
Index: include/Makefile
===
RCS file: /home/ncvs/src/include/Makefile,v
retrieving revision 1.146
diff -u -p -r1.146 Makefile
--- include/Makefile2001/06/07 05:04:53 1.146
+++ include/Makefile2001/06/12 12:39:19
@@ -8,7 +8,8 @@
 
 CLEANFILES= osreldate.h version vers.c
 SUBDIR= rpcsvc rpc
-FILES= a.out.h ar.h assert.h bitstring.h ctype.h db.h dirent.h disktab.h \
+FILES= a.out.h ar.h assert.h bitstring.h complex.h ctype.h db.h \
+   dirent.h disktab.h \
dlfcn.h elf.h elf-hints.h err.h fnmatch.h fstab.h \
fts.h glob.h grp.h strhash.h \
hesiod.h histedit.h ieeefp.h ifaddrs.h iso646.h langinfo.h \
Index: include/complex.h
===
RCS file: complex.h
diff -N complex.h
--- /dev/null   Tue Jun 12 03:18:33 2001
+++ complex.h   Tue Jun 12 15:39:19 2001
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 2001 The FreeBSD Project.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _COMPLEX_H
+#define _COMPLEX_H
+
+#ifdef __GNUC__
+#define _Complex   __complex__
+#define _Complex_I 1.0fi
+#endif
+
+#define complex_Complex
+#define I  _Complex_I
+
+#include sys/cdefs.h
+
+__BEGIN_DECLS
+
+double cabs __P((double complex));
+float  cabsf __P((float complex));
+double cimag __P((double complex));
+float  cimagf __P((float complex));
+double creal __P((double complex));
+float  crealf __P((float complex));
+
+__END_DECLS
+
+#ifdef __GNUC__
+#define cimag(z)   (__imag__ (z))
+#define cimagf(z)  (__imag__ (z))
+#define creal(z)   (__real__ (z))
+#define crealf(z)  (__real__ (z))
+#endif
+
+#endif /* _COMPLEX_H */
Index: include/fts.h

fts_open() (was: Re: Patch to restore WARNS feature)

2001-06-13 Thread Ruslan Ermilov

Should I commit the attached patch then?

On Tue, Jun 12, 2001 at 02:35:39PM +1000, Bruce Evans wrote:
  For those interested, here's the missing patch.
 
 Index: lib/libc/gen/fts.c
 ===
 RCS file: /home/ncvs/src/lib/libc/gen/fts.c,v
 retrieving revision 1.18
 diff -u -p -r1.18 fts.c
 --- lib/libc/gen/fts.c2001/06/01 21:53:50 1.18
 +++ lib/libc/gen/fts.c2001/06/11 18:20:17
 @@ -936,7 +936,8 @@ fts_sort(sp, head, nitems)
   }
   for (ap = sp-fts_array, p = head; p; p = p-fts_link)
   *ap++ = p;
 - qsort((void *)sp-fts_array, nitems, sizeof(FTSENT *), sp-fts_compar);
 + qsort((void *)sp-fts_array, nitems, sizeof(FTSENT *),
 + (int (*) __P((const void *, const void *)))sp-fts_compar);
   for (head = *(ap = sp-fts_array); --nitems; ++ap)
   ap[0]-fts_link = ap[1];
   ap[0]-fts_link = NULL;
 
 This just hides the bug that fts's comparison function is not suitable
 for use by qsort().
 
 Bruce

On Tue, Jun 12, 2001 at 02:38:13PM -0400, Garrett Wollman wrote:
 On Tue, 12 Jun 2001 15:53:18 +0300, Ruslan Ermilov [EMAIL PROTECTED] said:
 
  +   qsort((void *)sp-fts_array, nitems, sizeof(FTSENT *),
  +   (int (*) __P((const void *, const void *)))sp-fts_compar);
 
 This is wrong.  The declaration of the comparison function should be
 fixed, rather than papering over the mistake here.
 
 (This is arguably a deficiency in the C standard.  qsort() should take
 an additional state parameter for the comparison function, but
 doesn't.)
 


-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: include/fts.h
===
RCS file: /home/ncvs/src/include/fts.h,v
retrieving revision 1.3
diff -u -p -r1.3 fts.h
--- include/fts.h   1997/05/07 19:59:58 1.3
+++ include/fts.h   2001/06/13 12:17:31
@@ -45,7 +45,8 @@ typedef struct {
int fts_rfd;/* fd for root */
int fts_pathlen;/* sizeof(path) */
int fts_nitems; /* elements in the sort array */
-   int (*fts_compar)();/* compare function */
+   int (*fts_compar)   /* compare function */
+   __P((const void *, const void *));
 
 #defineFTS_COMFOLLOW   0x001   /* follow command line symlinks */
 #defineFTS_LOGICAL 0x002   /* logical walk */
@@ -120,7 +121,7 @@ __BEGIN_DECLS
 FTSENT *fts_children __P((FTS *, int));
 int fts_close __P((FTS *));
 FTS*fts_open __P((char * const *, int,
-   int (*)(const FTSENT **, const FTSENT **)));
+   int (*)(const void *, const void *)));
 FTSENT *fts_read __P((FTS *));
 int fts_set __P((FTS *, FTSENT *, int));
 __END_DECLS
Index: lib/libc/gen/fts.3
===
RCS file: /home/ncvs/src/lib/libc/gen/fts.3,v
retrieving revision 1.12
diff -u -p -r1.12 fts.3
--- lib/libc/gen/fts.3  2001/02/01 16:29:34 1.12
+++ lib/libc/gen/fts.3  2001/06/13 12:17:32
@@ -45,7 +45,7 @@
 .Fd #include sys/stat.h
 .Fd #include fts.h
 .Ft FTS *
-.Fn fts_open char * const *path_argv int options int (*compar)(const FTSENT **, 
const FTSENT **)
+.Fn fts_open char * const *path_argv int options int (*compar)(const void *, 
+const void *)
 .Ft FTSENT *
 .Fn fts_read FTS *ftsp
 .Ft FTSENT *
@@ -462,9 +462,9 @@ The argument
 specifies a user-defined function which may be used to order the traversal
 of the hierarchy.
 It
-takes two pointers to pointers to
-.Fa FTSENT
-structures as arguments and
+takes two pointers as arguments (which need to be cast to
+.Vt FTSENT **
+inside the function's body) and
 should return a negative value, zero, or a positive value to indicate
 if the file referenced by its first argument comes before, in any order
 with respect to, or after, the file referenced by its second argument.
Index: lib/libc/gen/fts.c
===
RCS file: /home/ncvs/src/lib/libc/gen/fts.c,v
retrieving revision 1.18
diff -u -p -r1.18 fts.c
--- lib/libc/gen/fts.c  2001/06/01 21:53:50 1.18
+++ lib/libc/gen/fts.c  2001/06/13 12:17:35
@@ -85,7 +85,7 @@ FTS *
 fts_open(argv, options, compar)
char * const *argv;
register int options;
-   int (*compar) __P((const FTSENT **, const FTSENT **));
+   int (*compar) __P((const void *, const void *));
 {
register FTS *sp;
register FTSENT *p, *root;
Index: bin/cp/cp.c
===
RCS file: /home/ncvs/src/bin/cp/cp.c,v
retrieving revision 1.26
diff -u -p -r1.26 cp.c
--- bin/cp/cp.c 2001/06/11 13:57:54 1.26

Re: fts_open() (was: Re: Patch to restore WARNS feature)

2001-06-13 Thread Ruslan Ermilov

On Wed, Jun 13, 2001 at 11:16:57AM -0400, Garrett Wollman wrote:
 On Wed, 13 Jun 2001 23:28:29 +1000 (EST), Bruce Evans [EMAIL PROTECTED] said:
 
  3. Provide an alternative to qsort() that takes an comparison function
 that takes an additional function pointer arg (use this arg to avoid
 the global in (1)).
 
 Actually, doing this would solve a number of similar problems, and it
 doesn't look to be too difficult to do.  I would make the additional
 argument a `void *'; fts's comparison trampoline function could use
 this as a `FTS *' to look up the comparison function.  (I think this
 is more general than passing any kind of function pointer.)
 
How should we call this function?
(I'll implement this tomorrow.)


-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



ucred.cr_gid

2001-06-22 Thread Ruslan Ermilov

Hi!

The attached patch replaces ucred.cr_groups[0] with ucred.cr_gid.
This is mostly needed for POSIX alignment.  setegid(2) etc. should
not change supplementary groups set.

Also, type of grp.h's group.gr_gid changed to a more natural
gid_t (also as in POSIX).

getgrouplist(3)'s and initgroups(3)'s prototypes fixed.
getgrouplist(3) has been also fixed to not duplicate the
primary group, and always return number of suplementary
groups, even if ngroups is zero (similar to sysctl(3)).

Assorted changes:

cmsgcred.cmcred_egidNew
kproc_info.ki_gid   New
portal_cred.pcr_gid New
xucred.cr_gid   New

I'm not sure what to do with xucred.

Also, I'm not sure about KINFO_PROC_SIZE on ia64 and PowerPC.

Please review.

See also ChangeLog.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: include/grp.h
===
RCS file: /home/ncvs/src/include/grp.h,v
retrieving revision 1.3
diff -u -p -r1.3 grp.h
--- include/grp.h   1997/05/07 19:59:59 1.3
+++ include/grp.h   2001/06/22 14:50:40
@@ -48,7 +48,7 @@
 struct group {
char*gr_name;   /* group name */
char*gr_passwd; /* group password */
-   int gr_gid; /* group id */
+   gid_t   gr_gid; /* group id */
char**gr_mem;   /* group members */
 };
 
Index: include/unistd.h
===
RCS file: /home/ncvs/src/include/unistd.h,v
retrieving revision 1.41
diff -u -p -r1.41 unistd.h
--- include/unistd.h2001/05/27 19:57:36 1.41
+++ include/unistd.h2001/06/22 14:50:40
@@ -138,7 +138,7 @@ int  ftruncate __P((int, off_t));
 #endif
 int getdomainname __P((char *, int));
 int getdtablesize __P((void));
-int getgrouplist __P((const char *, int, int *, int *));
+int getgrouplist __P((const char *, gid_t, gid_t *, int *));
 longgethostid __P((void));
 int gethostname __P((char *, int));
 int getlogin_r __P((char *, int));
@@ -151,7 +151,7 @@ int  getresuid __P((uid_t *, uid_t *, ui
 int getsid __P((pid_t _pid));
 char   *getusershell __P((void));
 char   *getwd __P((char *));   /* obsoleted by getcwd() */
-int initgroups __P((const char *, int));
+int initgroups __P((const char *, gid_t));
 int iruserok __P((unsigned long, int, const char *, const char *));
 int iruserok_sa __P((const void *, int, int, const char *, const char *));
 int issetugid __P((void));
Index: lib/libc/gen/getgrent.3
===
RCS file: /home/ncvs/src/lib/libc/gen/getgrent.3,v
retrieving revision 1.15
diff -u -p -r1.15 getgrent.3
--- lib/libc/gen/getgrent.3 2000/11/20 16:18:45 1.15
+++ lib/libc/gen/getgrent.3 2001/06/22 14:50:41
@@ -78,7 +78,7 @@ file
 struct group {
char*gr_name;   /* group name */
char*gr_passwd; /* group password */
-   int gr_gid; /* group id */
+   gid_t   gr_gid; /* group id */
char**gr_mem;   /* group members */
 };
 .Ed
Index: lib/libc/gen/getgrouplist.3
===
RCS file: /home/ncvs/src/lib/libc/gen/getgrouplist.3,v
retrieving revision 1.6
diff -u -p -r1.6 getgrouplist.3
--- lib/libc/gen/getgrouplist.3 2000/10/30 13:23:18 1.6
+++ lib/libc/gen/getgrouplist.3 2001/06/22 14:50:41
@@ -43,18 +43,18 @@
 .Sh SYNOPSIS
 .Fd #include unistd.h
 .Ft int
-.Fn getgrouplist const char *name int basegid int *groups int *ngroups
+.Fn getgrouplist const char *name gid_t basegid gid_t *groups int *ngroups
 .Sh DESCRIPTION
 The
 .Fn getgrouplist
-function reads through the group file and calculates
+function reads through the group database and calculates
 the group access list for the user specified in
 .Fa name .
 The
 .Fa basegid
 is automatically included in the groups list.
 Typically this value is given as
-the group number from the password file.
+the group number from the password database.
 .Pp
 The resulting group list is returned in the integer array pointed to by
 .Fa groups .
@@ -64,6 +64,8 @@ array in the integer pointed to by
 .Fa ngroups ;
 the actual number of groups found is returned in
 .Fa ngroups .
+.Pp
+Duplicate group IDs will be suppressed from the result.
 .Sh RETURN VALUES
 The
 .Fn getgrouplist
@@ -94,3 +96,11 @@ If the invoking program uses any of thes
 the group structure will
 be overwritten in the call to
 .Fn getgrouplist .
+.Pp
+In the case where the group array is too small and duplicate GIDs
+have been suppressed, the returned
+.Fa ngroups
+will be too large by a factor

[CFR] ucred.cr_gid

2001-06-26 Thread Ruslan Ermilov

Could someone please take a look at it before I commit this?

- Forwarded message from Ruslan Ermilov [EMAIL PROTECTED] -

Date: Fri, 22 Jun 2001 18:05:09 +0300
From: Ruslan Ermilov [EMAIL PROTECTED]
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: ucred.cr_gid
Message-ID: [EMAIL PROTECTED]
Mail-Followup-To: [EMAIL PROTECTED], [EMAIL PROTECTED]

Hi!

The attached patch replaces ucred.cr_groups[0] with ucred.cr_gid.
This is mostly needed for POSIX alignment.  setegid(2) etc. should
not change supplementary groups set.

Also, type of grp.h's group.gr_gid changed to a more natural
gid_t (also as in POSIX).

getgrouplist(3)'s and initgroups(3)'s prototypes fixed.
getgrouplist(3) has been also fixed to not duplicate the
primary group, and always return number of suplementary
groups, even if ngroups is zero (similar to sysctl(3)).

Assorted changes:

cmsgcred.cmcred_egidNew
kproc_info.ki_gid   New
portal_cred.pcr_gid New
xucred.cr_gid   New

I'm not sure what to do with xucred.

Also, I'm not sure about KINFO_PROC_SIZE on ia64 and PowerPC.

Please review.

See also ChangeLog.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

- End forwarded message -

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: [CFR] ucred.cr_gid

2001-06-27 Thread Ruslan Ermilov

On Tue, Jun 26, 2001 at 11:18:56AM -0400, Robert Watson wrote:
 
 On Tue, 26 Jun 2001, Ruslan Ermilov wrote:
 
  Could someone please take a look at it before I commit this?
 
 I won't get a chance to properly review this until I'm at USENIX tomorrow.
 If you're willing to hold off for about a week, I'd be happy to give it a
 fairly detailed review: I had some thoughts of doing this when I
 originally merged ucred and pcred a few weeks ago, but decided to hold
 off.  I'm generally fairly positive about this change, but would be
 interested in hearing Bruce's thoughts on any compatibility issues, in
 particular, with respects to the behavior of userland processes with
 expectations about the old behavior.  Obviously, this is a change that is
 very sensitive to subtle semantic changes on calls--on the other hand, I
 think moving towards making the supplementary groups being independent
 from the effect gid is a good goal, as it simplifies our credential code,
 and improves compatibility.
 
At least one compatibility issue here is that it's no longer possible
to use initgroups(3) to set the effective group ID.

  Date: Fri, 22 Jun 2001 18:05:09 +0300
  From: Ruslan Ermilov [EMAIL PROTECTED]
  To: [EMAIL PROTECTED], [EMAIL PROTECTED]
  Subject: ucred.cr_gid
  Message-ID: [EMAIL PROTECTED]
  Mail-Followup-To: [EMAIL PROTECTED], [EMAIL PROTECTED]
  
  Hi!
  
  The attached patch replaces ucred.cr_groups[0] with ucred.cr_gid.  This
  is mostly needed for POSIX alignment.  setegid(2) etc. should not change
  supplementary groups set.
  
  Also, type of grp.h's group.gr_gid changed to a more natural gid_t
  (also as in POSIX).
 
 Sounds good, I think this change was bandied about once before and perhaps
 simply didn't get committed.
 
Some of the assorted changes were committed as part of Hesiod import
from NetBSD.

  getgrouplist(3)'s and initgroups(3)'s prototypes fixed.  getgrouplist(3)
  has been also fixed to not duplicate the primary group, and always
  return number of suplementary groups, even if ngroups is zero (similar
  to sysctl(3)). 
 
 Having not looked at the patch yet, just need to make sure I point out the
 following areas that are sensitive to this type of change: linux and other
 ABI emulation, where semantic mapping of this sort is already performed,
 as well as userland applications managing groups.
 
I think my patch handles these.

  Assorted changes:
  
  cmsgcred.cmcred_egidNew
 
 This is an ABI change that will break applications compiled for older
 versions of FreeBSD.  Is this a change that applications can detect via
 some sort of sizeof/sanity check on cmsg results?
 
I can't see how this would break old applications.

  kproc_info.ki_gid   New
  portal_cred.pcr_gid New
  xucred.cr_gid   New
  
  I'm not sure what to do with xucred. 
 
 Probably reflect changes made in ucred fairly closely.
 
I mean, I'm not sure if we should preserve the 4.2's size of this
structure or no, and if so, how to actually do it.  Theoretically,
this could be done by placing cr_gid in a union with _cr_unused1
and #define that untangles the fact that cr_gid is in a union,
but that define would have to be ``#define cr_gid ...'' which is
too bad.

 I'll try to give you a detailed code review in a couple of days.
 
Thanks!


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: [CFR] ucred.cr_gid

2001-06-27 Thread Ruslan Ermilov

On Wed, Jun 27, 2001 at 06:40:53PM +1000, Bruce Evans wrote:
 On Wed, 27 Jun 2001, Ruslan Ermilov wrote:
 
  On Tue, Jun 26, 2001 at 11:18:56AM -0400, Robert Watson wrote:
   ...
   off.  I'm generally fairly positive about this change, but would be
   interested in hearing Bruce's thoughts on any compatibility issues, in
   particular, with respects to the behavior of userland processes with
   expectations about the old behavior.  Obviously, this is a change that is
 
 Me too :-).  I don't know much about this except that it is related to
 longstanding bugs in gid management.
 
  At least one compatibility issue here is that it's no longer possible
  to use initgroups(3) to set the effective group ID.
 
 I think this shows that keeping the egid in group lists is intentional.
 
It's hard to say actually.  4.3BSD up to Tahoe and Net/1 had (in user.h)
explicit holder for egid and NGROUPS supplementary group IDs.

 The only bug in the current implementation seems to be that NGROUPS_MAX
 is 1 too small.  The first gid in group lists is conventionally always
 the egid, but there must be space for NGROUPS_MAX supplementary groups,
 so statically allocated group lists must have size NGROUPS_MAX+1, but
 they currently (all?) have size NGROUPS_MAX.  POSIX.1-200x documents this
 for getgroups(2) -- returning the egid is optional, and getgroups() may
 return {NGROUPS_MAX}+1 entries.
 
What's wrong with keeping cr_gid in a separate structure member?
Continuing to keep it inside the cr_groups[] would cause us to
deal with NGROUPS_MAX vs. NGROUPS_MAX + 1 calculations all over
the place inside the kernel.  This IMHO only unnecessary complicates
the things.

We could still preserve the old behavior of getgroups(2) returning
the effective GID, but this only makes sense if we also preserve
the semantics of setgroups(2) setting the effective GID, which is
bogus; setgroups(2) should only be allowed to set the supplementary
group IDs, like most other OSes do, including NetBSD since 1995.

 I think the semantics of getgroups(), setgroups() and initgroups()
 shouldn't be changed.
 
This isn't possible, as if we continue to return egid with getgroups(),
it will now return maximum {NGROUPS_MAX} + 1 gids, as opposed to the
currently documented no more than NGROUPS_MAX will ever be returned,
thus breaking backwards compatibility anyway.

 To set a really supplemental gid (one not affected by setegid(),
 setgroups() must put the gid in the list after the first entry
 even if it is is the egid).
 
 In the kernel, the problem is not really changed by keeping the egid
 in a separate variable.  I currently slightly prefer keeping it in
 group lists.
 
Again, why?

 Binary compatibility could be preserve by hacking NGROUPS_MAX to
 NGROUPS_MAX - 1 (ugh).  I don't see how to preserve source level
 compatibility.  You have to change either the semantics by not
 putting the egid in group lists, or NGROUPS_MAX to NGROUPS_MAX+1
 in many places.  Portable applications need the latter change anyway.
 

BTW, in a second pass, I've found one place where I missed the
obvious change.

Index: kern_prot.c
===
RCS file: /home/ncvs/src/sys/kern/kern_prot.c,v
retrieving revision 1.93
diff -u -p -r1.93 kern_prot.c
--- kern_prot.c 2001/06/06 13:58:03 1.93
+++ kern_prot.c 2001/06/27 10:11:17
@@ -689,7 +687,7 @@ setgroups(p, uap)
 * have the egid in the groups[0]).  We risk security holes
 * when running non-BSD software if we do not do the same.
 */
-   newcred-cr_ngroups = 1;
+   newcred-cr_ngroups = 0;
} else {
if ((error = copyin((caddr_t)uap-gidset,
(caddr_t)newcred-cr_groups, ngrp * sizeof(gid_t {

-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: libalias, natd and punch_fw

2001-06-27 Thread Ruslan Ermilov

On Sun, Jun 24, 2001 at 08:51:49PM +0200, Furwitt, Bernd wrote:
 hi,
 
 i've upgraded a system from 4.3-stable to 5.0-current (22.06.2001) and
 noticed that the punch_fw option of natd doesn't work anymore. i testet
 several active-ftp-connections and only got a response from the ftp-server
 500 Invalid Port Command. natd did not punch new firewall-rules.
 is libalias broken or just configured different in -current?
 
Fixed in lib/libalias/alias_ftp.c,v 1.12, thanks for noticing!


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



TIOCSCTTY

2001-07-02 Thread Ruslan Ermilov

Hi!

Could someone please explain why the following code snippet
does not work anymore with the /dev/console argument?

# ./tiocsctty /dev/console
tiocsctty: ioctl(/dev/console, TIOCSCTTY): Operation not permitted


Thanks,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


#include sys/ioctl.h
#include err.h
#include fcntl.h
#include stdio.h
#include stdlib.h

int
main(int argc, char *argv[])
{
int fd;

if (argc != 2)
errx(1, missing argument);
if ((fd = open(argv[1], O_RDWR)) == -1)
err(1, open %s, argv[1]);
if (daemon(1, 1) == -1)
err(1, daemon);
if (ioctl(fd, TIOCSCTTY) == -1)
err(1, ioctl(%s, TIOCSCTTY), argv[1]);

exit(0);
}



Re: did somebody notice a crash in ip_output if you're using multicast?

2001-07-19 Thread Ruslan Ermilov

Could you please try the attached patch and see if it helps?

On Thu, Jul 19, 2001 at 12:40:11PM -0700, Matthew Jacob wrote:
 
 fatal kernel trap:
 
 trap entry = 0x2 (memory management fault)
 cpuid  = 0
 faulting va= 0x48
 type   = access violation
 cause  = load instructon
 pc = 0xfc4ce89c
 ra = 0xfc4ce874
 sp = 0xfe002e1bbaf8
 usp= 0x11ffb5a0
 curproc= 0xfe0028293fc0
 pid = 199, comm = ntpd
 
 Stopped at  ip_output+0x9bc:ldq t0,0x48(s6) 0x48
 t0=0x20
 11d00,s6=0x0
 db t
 ip_output() at ip_output+0x9bc
 igmp_sendpkt() at igmp_sendpkt+0x1a0
 igmp_joingroup() at igmp_joingroup+0x7c
 in_addmulti() at in_addmulti+0x108
 ip_setmoptions() at ip_setmoptions+0x4c0
 ip_ctloutput() at ip_ctloutput+0x2ac
 sosetopt() at sosetopt+0x4c
 setsockopt() at setsockopt+0xb4
 syscall() at syscall+0x728
 XentSys() at XentSys+0x64
 --- syscall (105, FreeBSD ELF, setsockopt) ---
 --- user mode ---
 db reboot
 
 halted CPU 0
 
 halt code = 5
 HALT instruction executed
 PC = fc5cdf40
 
 CPU 0 booting
 
 (boot dkb200.2.0.5.1 -flags a)
 pblock 0 of dkb200.2.0.5.1 is a valid boot block
 reading 15 blocks from dkb200.2.0.5.1
 bootstrap code read in
 base = 20, image_start = 0, image_bytes = 1e00
 initializing HWRPB at 2000
 
 -matt
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-current in the body of the message

-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: ip_output.c
===
RCS file: /home/ncvs/src/sys/netinet/ip_output.c,v
retrieving revision 1.130
diff -u -p -r1.130 ip_output.c
--- ip_output.c 2001/07/19 07:10:30 1.130
+++ ip_output.c 2001/07/19 10:49:09
@@ -253,14 +253,13 @@ ip_output(m0, opt, ro, flags, imo)
ip-ip_ttl = 1;
isbroadcast = in_broadcast(dst-sin_addr, ifp);
} else if (IN_MULTICAST(ntohl(ip-ip_dst.s_addr)) 
-   (imo != NULL) 
-   (imo-imo_multicast_ifp != NULL)) {
+   imo != NULL  imo-imo_multicast_ifp != NULL) {
/*
-* bypass the normal routing lookup for
-* multicast packets if the interface is
-* specified
+* Bypass the normal routing lookup for multicast
+* packets if the interface is specified.
 */
-   /* No Operation */
+   ifp = imo-imo_multicast_ifp;
+   IFP_TO_IA(ifp, ia);
} else {
/*
 * If this is the case, we probably don't want to allocate
@@ -303,8 +302,6 @@ ip_output(m0, opt, ro, flags, imo)
 */
if (imo != NULL) {
ip-ip_ttl = imo-imo_multicast_ttl;
-   if (imo-imo_multicast_ifp != NULL)
-   ifp = imo-imo_multicast_ifp;
if (imo-imo_multicast_vif != -1)
ip-ip_src.s_addr =
ip_mcast_src(imo-imo_multicast_vif);
@@ -325,13 +322,9 @@ ip_output(m0, opt, ro, flags, imo)
 * of outgoing interface.
 */
if (ip-ip_src.s_addr == INADDR_ANY) {
-   register struct in_ifaddr *ia1;
-
-   TAILQ_FOREACH(ia1, in_ifaddrhead, ia_link)
-   if (ia1-ia_ifp == ifp) {
-   ip-ip_src = IA_SIN(ia1)-sin_addr;
-   break;
-   }
+   /* XXX: interface may have no addresses. */
+   if (ia != NULL)
+   ip-ip_src = IA_SIN(ia)-sin_addr;
}
 
IN_LOOKUP_MULTI(ip-ip_dst, ifp, inm);
@@ -824,7 +817,7 @@ pass:
}
 
/* Record statistics for this interface address. */
-   if (!(flags  IP_FORWARDING)) {
+   if (!(flags  IP_FORWARDING)  ia) {
ia-ia_ifa.if_opackets++;
ia-ia_ifa.if_obytes += m-m_pkthdr.len;
}
@@ -964,7 +957,7 @@ sendorfree:
/* clean ipsec history once it goes out of the node */
ipsec_delaux(m);
 #endif
-   if (error == 0) {
+   if (error == 0  ia) {
/* Record statistics for this interface address. */
ia-ia_ifa.if_opackets++;
ia-ia_ifa.if_obytes += m-m_pkthdr.len;



Cross builds and upgrade path from 4.x are broken in usr.bin/file

2001-08-09 Thread Ruslan Ermilov

David!

As you have been warned, revisions 1.19 and 1.20 to file/Makefile
broke cross builds and upgrade path from 4.x to 5.0.  This is due
to the use of just built ./file binary to produce magic.mgc and
magic.mime.mgc files.  In the case of 4.x-5.0 upgrade, buildworld
bombs with

./file -C -m magic
/usr/libexec/ld-elf.so.1: Shared object libc.so.5 not found
*** Error code 1

when trying to compile the magic file.  In the cross build case,
the ./file binary is targetted for a different platform.

The attached patch adds `build-tools' target to usr.bin/file that
build xfile binary on the host platform, and that is used to
compile magic and magic.mime file.  (This is done similar to how
it's done in usr.bin/sysinstall, in case you wonder.)

Simply adding usr.bin/file to bootstrap-tools did not work because
the all target in file/Makefile depends on .mgc files, and this
requires -C flag to be available at make all in usr.bin/file when
running through `bootstrap-tools' stage of Makefile.inc1.  Actually,
we can still bootstrap the file(1), and use it later at `buildworld'
time, but this is somewhat tricky.  We would:

1)  Add usr.bin/file to bootstrap-tools
2)  Add -DBOOTSTRAPPING flag to ${BMAKE}
3)  Check this flag from within file/Makefile

If this flag is set, we could skip building/installing .mgc
files.

But by concept, this should be a build-tool anyway.  It just
appears to be the first precedence where a tool is also a
build tool.  (Compare with sysinstall.)


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: Makefile.inc1
===
RCS file: /home/ncvs/src/Makefile.inc1,v
retrieving revision 1.208
diff -u -r1.208 Makefile.inc1
--- Makefile.inc1   2001/08/04 18:25:38 1.208
+++ Makefile.inc1   2001/08/09 09:21:15
@@ -600,7 +600,8 @@
 
 build-tools:
 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
-${_libroken4} ${_libkrb5} lib/libncurses ${_share} usr.sbin/sysinstall
+${_libroken4} ${_libkrb5} lib/libncurses ${_share} usr.bin/file \
+usr.sbin/sysinstall
cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
 .endfor
 
Index: usr.bin/file/Makefile
===
RCS file: /home/ncvs/src/usr.bin/file/Makefile,v
retrieving revision 1.21
diff -u -r1.21 Makefile
--- usr.bin/file/Makefile   2001/08/08 16:19:30 1.21
+++ usr.bin/file/Makefile   2001/08/09 09:21:15
@@ -34,23 +34,28 @@
 CFLAGS+= -DMAGIC='${MAGICPATH}/magic' -DBUILTIN_ELF -DELFCORE -DHAVE_CONFIG_H
 CFLAGS+= -I${.CURDIR} -I${SRCDIR}
 
-CLEANFILES+=   magic magic.mgc magic.mime.mgc magic.mime.PITA
+CLEANFILES+=   xfile magic magic.mgc magic.mime.mgc magic.mime.PITA
 
 MAGFILES=  ${SRCDIR}/Header\
${SRCDIR}/Localstuff\
${SRCDIR}/Magdir/[a-z]*
 
-all: file magic magic.mgc magic.mime.mgc
+all: ${PROG} magic magic.mgc magic.mime.mgc
 
+build-tools: xfile
+
+xfile: ${SRCS}
+   ${CC} ${CFLAGS} -o ${.TARGET} ${.ALLSRC}
+
 magic: ${MAGFILES}
cat ${.ALLSRC}  ${.TARGET}
 
 magic.mgc: file magic
-   ./${PROG} -C -m magic
+   ./xfile -C -m magic
 
 magic.mime.mgc: file magic.mime
ln -sf ${SRCDIR}/magic.mime magic.mime.PITA
-   ./${PROG} -C -m magic.mime.PITA
+   ./xfile -C -m magic.mime.PITA
mv magic.mime.PITA.mgc magic.mime.mgc
 
 CLEANFILES+=   print-hacked.c



Re: Cross builds and upgrade path from 4.x are broken in usr.bin/file

2001-08-13 Thread Ruslan Ermilov

On Sat, Aug 11, 2001 at 11:51:18AM -0700, Terry Lambert wrote:
[...]
   If this is really a goal, then you should redesign the
   process and not put more and more tools into the build tools
   category to work around these problems.
  
  Take a look at sysinstall/Makefile to have a better idea of what
  a pure build tool is, rtermcap.  It is just the first incident
  (with file(1)) that it's also a build-tool for its own .mgc files.
 
 Mark is right, here.  The idea of build tools is intrinsically
 broken, given the goal (if it is a goal).
 
The build-tools stage is responsible for creating tools that are
to be used only during `buildworld', and are not used/installed
otherwise.

The file(1) is special in that it produces the MD format, hence
it is not suitable for build-tools.  (I did not know that.)


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Cross builds and upgrade path from 4.x are broken in usr.bin

2001-08-13 Thread Ruslan Ermilov

On Fri, Aug 10, 2001 at 11:54:27AM -0700, John Baldwin wrote:
 
 On 10-Aug-01 Ruslan Ermilov wrote:
  On Fri, Aug 10, 2001 at 10:04:01AM -0700, Mark Peek wrote:
  At 7:14 PM +0300 8/10/01, Ruslan Ermilov wrote:
  On Fri, Aug 10, 2001 at 08:38:21AM -0700, Mark Peek wrote:
 At 5:37 PM +0300 8/10/01, Ruslan Ermilov wrote:
 I'm not sure I understand what you mean by cross-platform
installworld. Do you mean build on a HOST platform and install on
TARGET, or build on a HOST, install on HOST but using a TARGET
disk?
  
  I meant the latter here.
  
  Has this ever worked?
  Is it really a goal of the project to have it work?
  
  Yes.  Imagine that you are rolling an Alpha release on an i386 box.
 
 You don't do that.  Cross releases need much more work before that is
 feasible.  As Mark mentions, there are many thigns that would need to be
 fixed.  Also, the release process would be hacked, and you still wouldn't
 have a true clean room release since you can't build a clean room to run
 a fresh world in.
 
But this doesn't mean we should add more to this breakage, if we can
avoid this.  Otherwise, you more and more complicate the task for
making this scenario possible.

  Your solution does not work. You're creating binary files in HOST 
  format during the build phase and expecting things such as alignment 
  and endianness to be the same as the TARGET format. Unless the tools 
  are built to output for either the appropriate architecture or in a 
  portable, binary format, you will have problems reading the file on 
  the TARGET platform. It probably works for you since you're doing a 
  4.X-5.0 upgrade on the same platform.
  
  What?  ``file -C'' produces different output on Alpha and on i386?
  Are you sure?  (Haven't checked myself.)
 
 sparc64 is big endian.
 
So what?  There are utilities that produce MI binary output.
Apparently, this one does not.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Cross builds and upgrade path from 4.x are broken in usr.bin/file

2001-08-14 Thread Ruslan Ermilov

On Mon, Aug 13, 2001 at 01:30:15PM -0700, David O'Brien wrote:
 On Fri, Aug 10, 2001 at 08:23:00PM +0300, Ruslan Ermilov wrote:
   Your solution does not work. You're creating binary files in HOST 
   format during the build phase and expecting things such as alignment 
   and endianness to be the same as the TARGET format. Unless the tools 
   are built to output for either the appropriate architecture or in a 
   portable, binary format, you will have problems reading the file on 
   the TARGET platform. It probably works for you since you're doing a 
   4.X-5.0 upgrade on the same platform.
   
  What?  ``file -C'' produces different output on Alpha and on i386?
  Are you sure?  (Haven't checked myself.)
 
 They produce the same output, but in the general case they do not need
 to.
 
What I hear?  Hell, then my solution (or something similar) should be
committed, as it at least unbreaks the 4.x - 5.0 upgrade path, which
I am mostly concerned about (on the same arch).

(Currently, it is broken because ./file depends on libc.so.5 while in
-STABLE it is still libc.so.4.)


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Cross builds and upgrade path from 4.x are broken in usr.bin/file

2001-08-14 Thread Ruslan Ermilov

On Tue, Aug 14, 2001 at 08:55:56AM -0700, David O'Brien wrote:
 On Tue, Aug 14, 2001 at 09:54:04AM +0300, Ruslan Ermilov wrote:
   They produce the same output, but in the general case they do not need
   to.
  
  What I hear?  Hell, then my solution (or something similar) should be
  committed, as it at least unbreaks the 4.x - 5.0 upgrade path, which
  I am mostly concerned about (on the same arch).
 
 I never said they weren't the same format nor that it wouldn't be fixed.
 I said I wanted to try some things.  NetBSD something simular to the
 patch below in their usr.bin/file/Makefile -- they build the .mgc files
 during build time.  The patch to src/Makefile.inc is one way to implement
 the needed hooks.
 
Good.

 From a correctness stand point, building the .mgc files at install time
 is the correct thing to do... or maybe we should do both -- doing the
 [re]creation of the .mgc files at install time in the cross-[arch-]build
 case.
 
Just to clarify.  Nothing should be built in ${.OBJDIR} at install time,
as it may be read-only.  The build in ${DESTDIR} is allowed, we, for
example, execute makewhatis(1) at the end of `installworld'.  But this
build is implicit, i.e., it's not done by make dependencies.  And
also note that only bootstrap-tools and utilities copied to the
${TMPPATH} as the first step of `installworld' are allowed during
`installworld'.

 +mkmagic: apprentice.c print-hacked.c
 + ${HOST_CC} -o mkmagic -DHAVE_CONFIG_H -DCOMPILE_ONLY \
 + -I${.CURDIR} -I${SRCDIR} ${.ALLSRC}
 
Whoa, cool!

That's what I wanted from the very beginning (-DCOMPILE_ONLY knob).
It then fits just nicely into the `build-tools' concept.  And we
don't need this ugly HOST_CC hack for Makefile.inc1, as ${CC} is
set correctly during the `build-tools' stage.  Let's don't reinvent
the wheel, and please try the attached patch instead.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: Makefile.inc1
===
RCS file: /home/ncvs/src/Makefile.inc1,v
retrieving revision 1.208
diff -u -r1.208 Makefile.inc1
--- Makefile.inc1   2001/08/04 18:25:38 1.208
+++ Makefile.inc1   2001/08/14 17:30:11
@@ -600,7 +600,8 @@
 
 build-tools:
 .for _tool in bin/csh bin/sh ${_games} gnu/usr.bin/cc/cc_tools ${_fortran} \
-${_libroken4} ${_libkrb5} lib/libncurses ${_share} usr.sbin/sysinstall
+${_libroken4} ${_libkrb5} lib/libncurses ${_share} usr.bin/file \
+usr.sbin/sysinstall
cd ${.CURDIR}/${_tool}; ${MAKE} build-tools
 .endfor
 
Index: usr.bin/file/Makefile
===
RCS file: /home/ncvs/src/usr.bin/file/Makefile,v
retrieving revision 1.21
diff -u -r1.21 Makefile
--- usr.bin/file/Makefile   2001/08/08 16:19:30 1.21
+++ usr.bin/file/Makefile   2001/08/14 17:30:11
@@ -34,23 +34,29 @@
 CFLAGS+= -DMAGIC='${MAGICPATH}/magic' -DBUILTIN_ELF -DELFCORE -DHAVE_CONFIG_H
 CFLAGS+= -I${.CURDIR} -I${SRCDIR}
 
-CLEANFILES+=   magic magic.mgc magic.mime.mgc magic.mime.PITA
+CLEANFILES+=   mkmagic magic magic.mgc magic.mime.mgc magic.mime.PITA
 
 MAGFILES=  ${SRCDIR}/Header\
${SRCDIR}/Localstuff\
${SRCDIR}/Magdir/[a-z]*
 
-all: file magic magic.mgc magic.mime.mgc
+all: ${PROG} magic magic.mgc magic.mime.mgc
 
+build-tools: mkmagic
+
+mkmagic: apprentice.c print-hacked.c
+   ${CC} -DHAVE_CONFIG_H -DCOMPILE_ONLY \
+   -I${.CURDIR} -I${SRCDIR} -o ${.TARGET} ${.ALLSRC}
+
 magic: ${MAGFILES}
cat ${.ALLSRC}  ${.TARGET}
 
-magic.mgc: file magic
-   ./${PROG} -C -m magic
+magic.mgc: mkmagic magic
+   ./mkmagic magic
 
-magic.mime.mgc: file magic.mime
+magic.mime.mgc: mkmagic magic.mime
ln -sf ${SRCDIR}/magic.mime magic.mime.PITA
-   ./${PROG} -C -m magic.mime.PITA
+   ./mkmagic magic.mime.PITA
mv magic.mime.PITA.mgc magic.mime.mgc
 
 CLEANFILES+=   print-hacked.c



Re: Cross builds and upgrade path from 4.x are broken in usr.bin/file

2001-08-15 Thread Ruslan Ermilov

On Wed, Aug 15, 2001 at 12:40:19PM +1000, Bruce Evans wrote:
[...]
   +mkmagic: apprentice.c print-hacked.c
   + ${HOST_CC} -o mkmagic -DHAVE_CONFIG_H -DCOMPILE_ONLY \
   + -I${.CURDIR} -I${SRCDIR} ${.ALLSRC}
  
  Whoa, cool!
 
  That's what I wanted from the very beginning (-DCOMPILE_ONLY knob).
  It then fits just nicely into the `build-tools' concept.  And we
  don't need this ugly HOST_CC hack for Makefile.inc1, as ${CC} is
  set correctly during the `build-tools' stage.  Let's don't reinvent
  the wheel, and please try the attached patch instead.
 
 I agree (except the build-tools concept is a hack to work around
 build-tools binaries not being buildable and installable in the usual
 way (with 1 binary per Makefile)).
 
It seems pretty easy to add src/tools/build-tools/, and move all the
build-tools there.  What do you say?

[...]
 See sh/Makefile for other tweaks (depend on .o instead of .c ...).  Other
 probems with this (generally shared with all build-tools binaries):
 - CFLAGS for the main binary may be inappropriate for the tools
 - missing dependencies on headers.
 
Dependency of a build-tool on .o instead of .c is bad if:

1)  build-tools are built in the same ${.OBJDIR} as the main ${PROG}
(this is always true)
2)  objects for a build-tool are created for the host arch
3)  objects for a ${PROG} are created for a different arch
4)  ${PROG} and build-tool share one or more object files

This is not the case for bin/sh, but it's true for usr.bin/file.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: 4-STABLE--5-CURRENT upgrade path is b0rken in libform [patch]

2001-08-17 Thread Ruslan Ermilov

On Fri, Aug 17, 2001 at 01:21:59PM +0300, Maxim Sobolev wrote:
 Hi,
 
 Currently 4-STABLE -- 5-CURRENT upgrade path is broken in libform
 because it uses older curses.h header from the host system, which
 misses some macros necessary. Attached patch is expected to fix the
 problem, please review it and let me know if it is OK to commit it.
 
Are you sure?

1.  We currently run `buildworld' with -nostdinc, so /usr/include
(unless explicitly specified by CFLAGS) headers aren't used.

2.  `make includes' is executed first, before `make libraries' in
`buildworld', and the former installs the correct curses.h
into /usr/obj/usr/src/i386/usr/include.

3.  I can't reproduce your problem on my dual 4.4-PREPELEASE and
5.0-CURRENT box.

I can only imagine this scenario if you try to execure `make all'
from src/lib/libform manually.

 Index: Makefile
 ===
 RCS file: /home/ncvs/src/lib/libform/Makefile,v
 retrieving revision 1.6
 diff -d -u -r1.6 Makefile
 --- Makefile  2001/03/27 17:27:01 1.6
 +++ Makefile  2001/08/17 10:16:24
 @@ -21,8 +21,9 @@
  INCS=${NCURSES}/form/form.h
  
  CLEANFILES+= ncurses_def.h
 -CFLAGS+= -I. -I${.CURDIR}/../libncurses -I${NCURSES}/form -I${NCURSES}/menu \
 - -I${NCURSES}/include -Wall -DNDEBUG -DHAVE_CONFIG_H
 +CFLAGS+= -I. -I${.CURDIR}/../libncurses -I${.OBJDIR}/../libncurses \
 + -I${NCURSES}/form -I${NCURSES}/menu -I${NCURSES}/include \
 + -Wall -DNDEBUG -DHAVE_CONFIG_H
  
  ncurses_def.h:   MKncurses_def.sh ncurses_defs
   AWK=${AWK} sh ${NCURSES}/include/MKncurses_def.sh \


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: 4-STABLE--5-CURRENT upgrade path is b0rken in libform [patch]

2001-08-17 Thread Ruslan Ermilov

On Fri, Aug 17, 2001 at 02:00:43PM +0200, Alexander Langer wrote:
 Thus spake Ruslan Ermilov ([EMAIL PROTECTED]):
 
  Are you sure?
 
 Yes, I reported this on IRC already some weeks ago, but I was
 too lazy to fix it, so I just copied the include to /usr/include
 manually. ;-)
 
 I can easily reproduce this, from 4.4-PRERELEASE, 4.3-STABLE and (!)
 from a fairly old -CURRENT.
 
Strange, I have a nightly build on my 4.4-PRERELEASE box, that checks
the fresh 5.0 sources out, then does `make world DESTDIR=/CURRENT'.

I would like to take a look at that part of `buildworld' output that
is failing.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: Cross builds and upgrade path from 4.x are broken in usr.bin/file

2001-08-17 Thread Ruslan Ermilov

On Fri, Aug 17, 2001 at 08:49:10AM -0700, David O'Brien wrote:
 On Fri, Aug 10, 2001 at 05:37:51PM +0300, Ruslan Ermilov wrote:
  I can't believe I hear that from you, Bruce.  :-)
  Generation at install time is a damn bad idea, please see below.
 [...]
  1.  This won't work for cross-platform installworld, since ./file
  is targetted for a different platform.  (My version builds the
  xfile build-tool for the build platform and compiles .mgc files
  in ${.OBJDIR}.)
 
 You are generalizing.  It breaks cross-platform installworld when done on
 the build host.  It does not break cross-platform installworlds when done
 on the target host.  We should decide if a cross-platform must be
 installworld'able on the host, target, or both.
 
If we build at build time only, we always build on build host.
And that will work in both cases of cross-platform installworld,
as it won't build anything during install time.


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: /usr/games/wtf

2001-08-21 Thread Ruslan Ermilov

On Tue, Aug 21, 2001 at 01:03:11PM +0700, Max Khon wrote:
 hi, there!
 
 I would like to add /usr/games/wtf from NetBSD to base system.
 Any opinions/objections?
 
FWIW, I don't like its name.  :-)


Cheers,
-- 
Ruslan Ermilov  Oracle Developer/DBA,
[EMAIL PROTECTED]   Sunbay Software AG,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.512.251Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



Re: weekly_catman not generating the right result?

2011-08-03 Thread Ruslan Ermilov
On Sun, Jul 31, 2011 at 03:57:01PM +0200, Ulrich Spörlein wrote:
 On Sun, 2011-07-31 at 05:43:39 -0700, Xin LI wrote:
  On 07/31/11 05:17, Ulrich Spörlein wrote:
   On Sun, 2011-07-31 at 01:22:36 -0700, Xin LI wrote:
   Hi,
   
   I just noticed that weekly_catman is not generating the right
   result, e.g. instead of a highlight NAME, it gives 1mNAME0m (looks
   like the escape character is missing here).
   
   Is this a known issue?
   
   Now it is :)
   
   This is due to the recent changes that made groff emit ANSI
   sequences and catman(1) is still putting col(1) in the pipe, which is
   not really required and gobbles up part of the escape sequences.
   
   Please try the attached patch. Thanks.
  
  Thanks, that fixes the problem.
  
  Note that I noticed that setting PAGER to less won't work.  Looking at
  my 8.2-RELEASE system, the rendered catpages are using ^H when
  highlighting while on -CURRENT it's an escape sequence (but I didn't see
  any change to nroff script nor catman itself)...
 
 The change that did this is r222648. You'll need to use `less -Rs' as
 your PAGER/MANPAGER (or export LESS=-Rs).
 
 It's debatable if we want catpages to retain the old way of marking up
 bold and underlined text.
 
 Ruslan: bsd.doc.mk was told to not use SGR in r222647, does it make
 sense to do the same for catpages?

This probably affects your patch that I've just reviewed, but I think
you're right in that catpages should be in the old fashioned format.


Cheers,
-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: awk(1) segfaults when building kernel modules

2011-08-10 Thread Ruslan Ermilov
On Wed, Aug 10, 2011 at 08:02:32PM +, Alexander Best wrote:
 On Wed Aug 10 11, Navdeep Parhar wrote:
  On Wed, Aug 10, 2011 at 11:12 AM, Test Rat ttse...@gmail.com wrote:
   `make -s buildkernel' seems to contain lots of segfaults after recent
   update of one-true-awk in r224731. It chokes on sys/conf/kmod_syms.awk.
 
 just out of curiosity: what's the point of doing a vendor import during a
 beta phase? isn't this exactly the kind of stuff you DON'T want to do, because
 it can only turn out badly?

The previous version had a bug in handling the -v option
since the last import.  I sent a patch to bwk@ months ago,
but he only released the new version that included a fix
on August 7.

Unfortunately, while fixing another bug (fixed day 1 bug
that resurrected deleted elements of ARGV when used as
filenames (in lib.c).), not all code was fixed, and a NULL
pointer deference bug is triggered by the following code
snippet:

awk 'BEGIN{delete ARGV[1]}{}' arg

%%%
Index: head/contrib/one-true-awk/lib.c
===
--- head/contrib/one-true-awk/lib.c (revision 224760)
+++ head/contrib/one-true-awk/lib.c (working copy)
@@ -89,8 +89,13 @@
char *p;
 
for (i = 1; i  *ARGC; i++) {
-   if (!isclvar(p = getargv(i))) { /* find 1st real filename */
-   setsval(lookup(FILENAME, symtab), getargv(i));
+   p = getargv(i); /* find 1st real filename */
+   if (p == NULL || *p == '\0') {  /* deleted or zapped */
+   argno++;
+   continue;
+   }
+   if (!isclvar(p)) {
+   setsval(lookup(FILENAME, symtab), p);
return;
}
setclvar(p);/* a commandline assignment before filename */
%%%

 imho r224731 should completely be reverted. aren't those exactly the kind of
 commits re@ shouldn't approve?


-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: awk(1) segfaults when building kernel modules

2011-08-11 Thread Ruslan Ermilov
On Wed, Aug 10, 2011 at 10:12:11PM +0400, Test Rat wrote:
 `make -s buildkernel' seems to contain lots of segfaults after recent
 update of one-true-awk in r224731. It chokes on sys/conf/kmod_syms.awk.
 The case can be reduced to
 
   $ awk 'BEGIN { delete ARGV[1] } END { print ARGV[1] }' blah
   [...]

Should be fixed in r224776; please confirm.


Cheers,
-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Deterministic builds

2011-12-09 Thread Ruslan Ermilov
On Fri, Dec 09, 2011 at 12:16:39PM +0100, Erik Cederstrand wrote:
 I've been working on a project to make it possible to produce deterministic
 builds with FreeBSD. By this I mean building a FreeBSD distribution twice
 from the same code base and having all files in the two distributions match
 by md5 sum. Currently, this is not the case.
[...]
 I'd be very grateful for any comments on the approach and the patch.

The idea is not new.  Setting CROSS_BUILD_TESTING during the buildworld
addressed similar issues at a time I wrote it, to compare cross builds
to native ones, with several exceptions.  I haven't tested it for years,
so things might have changed, but it's still a good idea to give it a
try.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Deterministic builds

2011-12-09 Thread Ruslan Ermilov
On Fri, Dec 09, 2011 at 03:25:40PM +0100, Erik Cederstrand wrote:
 Den 09/12/2011 kl. 14.37 skrev Ruslan Ermilov:
 
  On Fri, Dec 09, 2011 at 12:16:39PM +0100, Erik Cederstrand wrote:
  I've been working on a project to make it possible to produce deterministic
  builds with FreeBSD. By this I mean building a FreeBSD distribution twice
  from the same code base and having all files in the two distributions match
  by md5 sum. Currently, this is not the case.
  [...]
  I'd be very grateful for any comments on the approach and the patch.
  
  The idea is not new.  Setting CROSS_BUILD_TESTING during the buildworld
  addressed similar issues at a time I wrote it, to compare cross builds
  to native ones, with several exceptions.  I haven't tested it for years,
  so things might have changed, but it's still a good idea to give it a
  try.
 
 I can't see that CROSS_BUILD_TESTING does anything in current other
 than adding TARGET and TARGET_ARCH to OBJTREE in src/Makefile.inc1?

Take a look at src/tools/build/Makefile.

Last time I checked (July 19, 2005) there were only the following
diffs when verifying cross-builds (verifying included doing a
native build and binary comparing it with a cross-build made on
i386/amd64):

: *:
: /usr/lib/libsupc++.a:vec.o  symbols with generated names
: /usr/lib/libobjc.a:NXConstStr.o
: /usr/lib/libobjc.a:Object.o
: /usr/lib/libobjc.a:Protocol.o
: 
: i386 - amd64
: /usr/sbin/isdn* timestamp (__TIME__) (i386 only)
: 
: sparc64 - amd64
: /usr/share/misc/magic*.mgc  mkmagic not endianness clean


-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: HEADSUP: /etc/malloc.conf format change

2012-04-25 Thread Ruslan Ermilov
On Tue, Apr 17, 2012 at 12:34:20PM -0700, Jason Evans wrote:
 As a result of the recent jemalloc update, the format for
 /etc/malloc.conf has changed.  If your system has an old-style
 /etc/malloc.conf, you will want to delete it prior to
 installworld, and optionally re-create it using the new format
 after rebooting.  See malloc.conf(5) for details (specifically
 the TUNING section and the opt.* entries in the MALLCTL
 NAMESPACE section).
 
 The MALLOC_OPTIONS environment variable and the _malloc_options
 global do not pose the same headache, because their new
 counterparts are named MALLOC_CONF and malloc_conf,
 respectively.

So you removed _malloc_options that was part of the documented
programming API, while some software made use of it.

While removing part of the documented API was definitely a bad
idea, you didn't provide any mean to detect this change 
programmatically, neither through a macro test, nor by bumping
__FreeBSD_version.  The only way now is to try and see if it
compiles, which is far from perfect.

The way how _malloc_options is handled for binary compatibility,
by simply ignoring its value, is (ahem) questionable.

Why do I care?  The developers of the nginx web server have 
been notified today that it could not be built on FreeBSD
10.0-CURRENT anymore, due to this change, when compiled with 
nginx malloc debugging.  It's activated by the DEBUG option
of the www/nginx-devel port, if you care to try it out.

Please explore the possibility to add backwards compatiblity for 
the documented API, or at the very least provide a mean to 
detect this otherwise disruptive and hard to detect change
for a programmer.


Cheers,
-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: HEADSUP: /etc/malloc.conf format change

2012-04-26 Thread Ruslan Ermilov
On Wed, Apr 25, 2012 at 10:43:59AM -0700, Jason Evans wrote:
 On Apr 25, 2012, at 9:39 AM, Ruslan Ermilov wrote:
  So you removed _malloc_options that was part of the documented
  programming API, while some software made use of it.
[...]
  Please explore the possibility to add backwards compatiblity for 
  the documented API, or at the very least provide a mean to 
  detect this otherwise disruptive and hard to detect change
  for a programmer.
 
 A __FreeBSD_version bump seems like a good idea to me, but
 adding backward compatibility for _malloc_options is
 questionable at best.  Of the 17 options that _malloc_options
 supported, only 6 have directly corresponding options in
 malloc_conf, plus another 3 that would present strange quirks
 (fragile and difficult to precisely document) if an attempt
 were made to provide compatibility.  In past iterations I was
 always careful to provide as much option compatibility as
 possible over the lifetime of each release (e.g., 'H' in
 RELENG_7), but individual options came and went  with major
 releases.
 
 _malloc_options could only be pushed so far, and when it hit
 its breaking point I replaced it.  Creaky compatibility is IMO
 a liability rather than an asset.  In the case of nginx, it
 looks like a __FreeBSD_version bump is exactly what it needs.
 I'll try to get that done today.

Well, thanks for that, and for all your hard work with malloc().

 On a related note, is there any way to find all ports that
 refer to _malloc_options without extracting source for all of
 them?  I considered being proactive about finding software that
 depends on _malloc_options, but no tractable approaches came to
 mind.

That was already answered by Mark.


-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [RFC] Un-staticise the toolchain

2012-04-26 Thread Ruslan Ermilov
On Thu, Apr 26, 2012 at 12:35:48PM +0300, Konstantin Belousov wrote:
 I think it is time to stop building the toolchain static. I was told that
 original reasoning for static linking was the fear of loosing the ability
 to recompile if some problem appears with rtld and any required dynamic
 library. Apparently, current dependencies are much more spread, e.g. /bin/sh
 is dynamically linked, and statically linked make does not solve anything.


r76801 | sobomax | 2001-05-18 13:05:56 +0400 (Fri, 18 May 2001) | 6 lines

By default build make(1) as a static binary. It costs only 100k of additional
disk space, buf provides measureable speed increase for make-intensive
operations, such as pkg_version(1), `make world' and so on.

MFC after:  1 week



Have things changed enough that the above is not true anymore?

 Patch below makes the dynamically linked toolchain a default, adding an
 WITHOUT_SHARED_TOOLCHAIN build-time option for real conservators.
 
 I did not looked in details why including bsd.own.mk makes NO_MAN
 non-functional. Please see the diffs for gnu/usr.bin/cc1*/Makefile.

Because you include bsd.own.mk before NO_MAN is defined, and the way
how .if works in make(1).
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [RFC] Un-staticise the toolchain

2012-04-27 Thread Ruslan Ermilov
On Fri, Apr 27, 2012 at 11:58:59AM +0300, Konstantin Belousov wrote:
 On Thu, Apr 26, 2012 at 05:41:40PM +0400, Ruslan Ermilov wrote:
  On Thu, Apr 26, 2012 at 12:35:48PM +0300, Konstantin Belousov wrote:
[...]
   Patch below makes the dynamically linked toolchain a default, adding an
   WITHOUT_SHARED_TOOLCHAIN build-time option for real conservators.
   
   I did not looked in details why including bsd.own.mk makes NO_MAN
   non-functional. Please see the diffs for gnu/usr.bin/cc1*/Makefile.
  
  Because you include bsd.own.mk before NO_MAN is defined, and the way
  how .if works in make(1).
 
 What is the 'right' thing to do then ?
 
 Postpone the inclusion of bsd.own.mk after NO_MAN definition ? This makes
 the .if $MK_SHARED_TOOLCHAIN to not work.
 
 Or, continue to do what I have done, using 'MAN=' instead ?

Two ways, both are demonstrated by gnu/lib/libgcov/Makefile:

- Define NO_* before including bsd.own.mk so it sets the
  corresponding MK_* variable appropriately, and before testing
  the MK_*.  

- Remove NO_*, include bsd.own.mk, then set MK_MAN=no.

(The nearby gnu/lib/libssp/Makefile has a similar problem with
NO_PROFILE.)

 N.B. I will commit the change, with defaults kept to build toolchain static,
 just to avoid bikeshed.

I think this is the right approach.

Regarding your patch...

By placing SHARED_TOOLCHAIN to __DEFAULT_NO_OPTIONS list in
bsd.own.mk, you already had MK_SHARED_TOOLCHAIN set to no by
default, which preserves the current status quo of building
toolchain static.  But you misspelled
tools/build/options/WITH_STATIC_TOOLCHAIN, probably as the result
of iteratively modifying your change.  The option and this file
should be named WITH_SHARED_TOOLCHAIN, the opposite of the
default.  Anyway, checking that the resulting src.conf(5) manpage
sounds sensible is a good idea.  As for the contents of this file,
I wouldn't call ar/ranlib a librarian but rather a library
archives manager, as per POSIX.  Your diff also suggests that it
misses a newline at EOF.
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [PATCH] Fix CFLAGS overwrite by Makefile

2011-05-25 Thread Ruslan Ermilov
On Tue, May 24, 2011 at 11:08:52PM -0400, Arnaud Lacombe wrote:
 Hi,
 
 On Tue, May 24, 2011 at 10:54 PM, Arnaud Lacombe lacom...@gmail.com wrote:
  ps: for static library and loader, I derived the total size as the sum
  of the size of the text/data/bss section of the member object using :
 
  size *.o | awk 'BEGIN {text=0; data=0; bss=0;}; {text+=$1; data+=$2;
  bss+=$3}; END {print text   data   bss  '$i'}'
 
  where $i is the cpu type to test. make(1) is passed either CPUTYPE=$i
  for i in i[3456]86, or the empty string. The compiler used for the
  test is gcc, and it is the compiler build during a buildworld stage,
  in the tmp directory.
 
 just to cut loose any question about my environment, additionally to
 the original patch, I made the following modification to the tree to
 try to isolate it from the host:
  - applied the following patch:

[...]

  - manually created two symlinks:
  1) include/machine - ../sys/i386/include/
  2) include/x86 - ../sys/x86/include/
 
 The host is running a custom 8.2-STABLE/amd64 kernel (only config
 change) on the following CPU:
 
 CPU: Intel(R) Xeon(R) CPU   X3430  @ 2.40GHz (2394.00-MHz K8-class 
 CPU)
   Origin = GenuineIntel  Id = 0x106e5  Family = 6  Model = 1e  Stepping = 5
  
 Features=0xbfebfbffFPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE
   
 Features2=0x98e3fdSSE3,DTES64,MON,DS_CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,SSE4.2,POPCNT
   AMD Features=0x28100800SYSCALL,NX,RDTSCP,LM
   AMD Features2=0x1LAHF
   TSC: P-state invariant
 
 I am still not sure what is the default gcc target architecture on this 
 machine.

Why not go along a supported way, and do a cross-build?


-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


[HEADS UP] color and page width support in man(1)

2011-06-03 Thread Ruslan Ermilov
Hi there,

On a freshly installed -CURRENT, to view a colorized manpage in color
and in full terminal width, try this:

env MANCOLOR=yes MANWIDTH=tty man grotty

Both features are disabled by default for POLA reasons.  Bikeshedding
will be redirected to /dev/null.


Cheers,
-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: WITHOUT_INSTALLLIB broken?

2011-06-16 Thread Ruslan Ermilov
On Thu, Jun 16, 2011 at 01:50:17PM +0200, Milan Obuch wrote:
 Hi,
 
 I encountered an error when WITHOUT_INSTALLLIB option is specified
 for 'make buildworld' process. I documented this issue with build logs
 at my page, http://www.dino.sk/build/2011-06-16-log1 and
 http://www.dino.sk/build/2011-06-16-log2 show how to test this. At this
 time, there is no /etc/make.conf nor /etc/src.conf.
 
 Any idea what's wrong with libegacy.a here?

This option wasn't designed for build, only for install.  It's like
WITHOUT_TOOLCHAIN, which is documented to not work for build targets.


-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: WITHOUT_INSTALLLIB broken?

2011-06-16 Thread Ruslan Ermilov
On Thu, Jun 16, 2011 at 05:09:05PM +0400, Eir Nym wrote:
 On 16 June 2011 16:55, Ruslan Ermilov r...@freebsd.org wrote:
  On Thu, Jun 16, 2011 at 01:50:17PM +0200, Milan Obuch wrote:
  Hi,
 
  I encountered an error when WITHOUT_INSTALLLIB option is specified
  for 'make buildworld' process. I documented this issue with build logs
  at my page, http://www.dino.sk/build/2011-06-16-log1 and
  http://www.dino.sk/build/2011-06-16-log2 show how to test this. At this
  time, there is no /etc/make.conf nor /etc/src.conf.
 
  Any idea what's wrong with libegacy.a here?
 
  This option wasn't designed for build, only for install.  It's like
  WITHOUT_TOOLCHAIN, which is documented to not work for build targets.
 
 
 Should this be simply ignored for build targets?

build targets utilize install targets internally, so this is
hardly doable.


-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: Bad 'grep' behaviour in -CURRENT, faulty binary detection?

2000-01-04 Thread Ruslan Ermilov

On Fri, Nov 12, 1999 at 20:45:10 -0800, Paul Eggert wrote:
 
Date: Fri, 12 Nov 1999 17:23:21 -0800
From: "David O'Brien" [EMAIL PROTECTED]
 
I assume "--ignore-binary" or "--ignore-binary-files" would be the GNU
longopt.
 
 Another possibility would be to follow the example of the existing
 --directories=ACTION option, e.g. something like this:
 
 --binary-files=ACTION  how to handle binary files
ACTION is 'read', 'skip', or 'summarize' (default)
 -I equivalent to --binary-files=skip
 -a, --text equivalent to --binary-files=read
 
Paul, could you please consider applying the following patch (it is against
virgin grep-2.4 sources).  Could you please also let me know when the Alpha
with this feature will be made available, so I could import it into FreeBSD.
Or maybe tell me an address of appropriate "announce" mailing list...


Thanks,
-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


--- grep.c.orig Sat Nov 13 18:31:55 1999
+++ grep.c  Tue Jan  4 14:11:09 2000
@@ -60,7 +60,7 @@
 
 /* Short options.  */
 static char const short_options[] =
-"0123456789A:B:C::EFGHUVX:abcd:e:f:hiLlnqrsuvwxyZz";
+"0123456789A:B:C::EFGHIUVX:Y:abcd:e:f:hiLlnqrsuvwxyZz";
 
 /* Long options equivalences. */
 static struct option long_options[] =
@@ -68,6 +68,7 @@
   {"after-context", required_argument, NULL, 'A'},
   {"basic-regexp", no_argument, NULL, 'G'},
   {"before-context", required_argument, NULL, 'B'},
+  {"binary-files", required_argument, NULL, 'Y'},
   {"byte-offset", no_argument, NULL, 'b'},
   {"context", optional_argument, NULL, 'C'},
   {"count", no_argument, NULL, 'c'},
@@ -120,6 +121,14 @@
 SKIP_DIRECTORIES
   } directories;
 
+/* How to handle binary files.  */
+static enum
+  {
+SUMMARIZE_BINARIES,
+READ_BINARIES,
+SKIP_BINARIES
+  } binaries;
+
 static int  ck_atoi PARAMS ((char const *, int *));
 static void usage PARAMS ((int)) __attribute__((noreturn));
 static void error PARAMS ((const char *, int));
@@ -476,7 +485,6 @@
 }
 
 /* Flags controlling the style of output. */
-static int always_text;/* Assume the input is always text. */
 static int filename_mask;  /* If zero, output nulls after filenames.  */
 static int out_quiet;  /* Suppress all normal output. */
 static int out_invert; /* Print nonmatching stuff. */
@@ -732,11 +740,14 @@
   return nlines;
 }
 
-  not_text = (! (always_text | out_quiet)
+  not_text = (binaries != READ_BINARIES
   memchr (bufbeg, eol ? '\0' : '\200', buflim - bufbeg));
   done_on_match += not_text;
   out_quiet += not_text;
 
+  if (not_text  binaries == SKIP_BINARIES)
+goto finish_grep;
+
   for (;;)
 {
   lastnl = bufbeg;
@@ -993,10 +1004,13 @@
   -H, --with-filename   print the filename for each match\n\
   -h, --no-filename suppress the prefixing filename on output\n\
   -q, --quiet, --silent suppress all normal output\n\
-  -a, --textdo not suppress binary output\n\
   -d, --directories=ACTION  how to handle directories\n\
 ACTION is 'read', 'recurse', or 'skip'.\n\
   -r, --recursive   equivalent to --directories=recurse.\n\
+  -Y, --binary-files=ACTION how to handle binary files\n\
+ACTION is 'summarize' (default), 'read', or 'skip'.
+  -a, --textequivalent to --binary-files=read\n\
+  -Iequivalent to --binary-files=skip\n\
   -L, --files-without-match only print FILE names containing no match\n\
   -l, --files-with-matches  only print FILE names containing matches\n\
   -c, --count   only print a count of matching lines per FILE\n\
@@ -1276,7 +1290,7 @@
setmatcher (optarg);
break;
   case 'a':
-   always_text = 1;
+   binaries = READ_BINARIES;
break;
   case 'b':
out_byte = 1;
@@ -1326,6 +1340,9 @@
   case 'h':
no_filenames = 1;
break;
+  case 'I':
+   binaries = SKIP_BINARIES;
+   break;
   case 'i':
   case 'y':/* For old-timers . . . */
match_icase = 1;
@@ -1363,6 +1380,16 @@
break;
   case 'x':
match_lines = 1;
+   break;
+  case 'Y':
+   if (strcmp (optarg, "summarize") == 0)
+ binaries = SUMMARIZE_BINARIES;
+   else if (strcmp (optarg, "read") == 0)
+ binaries = READ_BINARIES;
+   else if (strcmp (optarg, "skip") == 0)
+ binaries = SKIP_BINARIES;
+   else
+ fatal (_("unknown binary-files method"), 0);
break;
   case 'Z':
filename_mask = 0;



Re: 4.0 code freeze scheduled for Jan 15th

2000-01-06 Thread Ruslan Ermilov

On Thu, Jan 06, 2000 at 02:32:47AM -0800, Amancio Hasty wrote:
 
 Curious , what is elischer.org ? 8)
 
According to www.elischer.org, this is the temporary home page
for the Elischer family's internet enterprises and Family stuff. 

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



HEADS UP: GNU texinfo has been upgraded to 4.0

2000-01-17 Thread Ruslan Ermilov

[CC'ed explicitly to Peter Wemm, because he was the person]
[who requested --forceentry for install-info(1), see below]

Hi!

I've just upgraded our GNU texinfo to the latest available version 4.0.
Please see src/contrib/texinfo/NEWS for what has been changed since 3.12.

It should be built with `make world', not by simple `cvs update' and `make'.
If you wonder why, please see the log message for
src/gnu/usr.bin/texinfo/doc/Makefile,v 1.10.

But if you need to, it is possible to build it without `world' by:
make MAKEINFO=../makeinfo/makeinfo

The install-info(1)'s --forceentry option has been removed, since it is
(and always was) the same as stock --entry option (i.e., it overrides any
INFO-DIR-ENTRY from the INFO-FILE).


Happy hacking,
-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: buildworld failure in === makeinfo

2000-01-17 Thread Ruslan Ermilov
makeinf
 o/../../../../contrib/texinfo/makeinfo/node.c
 cc -O -pipe -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/share/locale\"  
-I/usr/src/gnu/usr.bin/texinfo/makeinfo/../../../../contrib/texinfo -I/usr/sr
 c/gnu/usr.bin/texinfo/makeinfo/../../../../contrib/texinfo/lib   
-I/usr/obj/usr/src/i386/usr/include -c /usr/src/gnu/usr.bin/texinfo/makeinf
 o/../../../../contrib/texinfo/makeinfo/sectioning.c
 cc -O -pipe -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/share/locale\"  
-I/usr/src/gnu/usr.bin/texinfo/makeinfo/../../../../contrib/texinfo -I/usr/sr
 c/gnu/usr.bin/texinfo/makeinfo/../../../../contrib/texinfo/lib   
-I/usr/obj/usr/src/i386/usr/include -c /usr/src/gnu/usr.bin/texinfo/makeinf
 o/../../../../contrib/texinfo/makeinfo/toc.c
 cc -O -pipe -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/share/locale\"  
-I/usr/src/gnu/usr.bin/texinfo/makeinfo/../../../../contrib/texinfo -I/usr/sr
 c/gnu/usr.bin/texinfo/makeinfo/../../../../contrib/texinfo/lib   
-I/usr/obj/usr/src/i386/usr/include  -o makeinfo cmds.o defun.o files.o foo
 tnote.o html.o index.o insertion.o lang.o macro.o makeinfo.o multi.o node.o 
sectioning.o toc.o  /usr/obj/usr/src/i386/usr/src/gnu/usr.bin/te
 xinfo/makeinfo/../libtxi/libtxi.a 
 /usr/obj/usr/src/i386/usr/libexec/elf/ld: cannot open crt1.o: No such file or 
directory
 *** Error code 1
 
 Stop in /usr/src/gnu/usr.bin/texinfo/makeinfo.
 *** Error code 1
 
 Stop in /usr/src/gnu/usr.bin/texinfo.
 *** Error code 1
 
 Stop in /usr/src.
 *** Error code 1
 
 Stop in /usr/src.
 *** Error code 1
 
Could you please try the following patch?

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


Index: Makefile.inc1
===
@@ -168,7 +168,7 @@ TMAKE=  ${TMAKEENV} ${MAKE} -f Makefile.
 XMAKEENV=  ${BOOTSTRAPENV} \
TARGET_ARCH=${MACHINE_ARCH}
 XMAKE= ${XMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML \
-   -DNO_FORTRAN -DNO_GDB
+   -DNO_FORTRAN -DNO_GDB -DNOSHARED
 
 # world stage
 WMAKEENV=  ${CROSSENV} \



Re: Is texinfo needed for buildworld with -DNOINFO ?

2000-01-18 Thread Ruslan Ermilov

On Tue, Jan 18, 2000 at 07:14:19PM +0900, Munehiro Matsuda wrote:
 Hi all,
 
 It seems that texinfo is compiled as cross-tools for buildworld.
 But, is it really needed when -DNOINFO has been specified?
 
Yes, because we need an up-to-date makeinfo to be able to build
newer info's (like those in texinfo itself and grep).

Your patch does work only for the reason that you're not building
texinfo plus info build for grep has been disabled till today.

The world breakage has been fixed in src/Makefile.inc1,v 1.130 by
moving gnu/usr.bin/texinfo before gnu/usr.bin/cc:

http://www.freebsd.org/cgi/cvsweb.cgi/src/Makefile.inc1?r1=1.129r2=1.130


Cheers,
-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Is texinfo needed for buildworld with -DNOINFO ?

2000-01-18 Thread Ruslan Ermilov

On Tue, Jan 18, 2000 at 12:31:18PM +0200, Sheldon Hearn wrote:
 
 
 On Tue, 18 Jan 2000 19:14:19 +0900, Munehiro Matsuda wrote:
 
  It seems that texinfo is compiled as cross-tools for buildworld.
  But, is it really needed when -DNOINFO has been specified?
 
 It's arguable, so I'd go with the status quo -- always build and install
 the texinfo program, even if info files are not to be installed.
 
The problem is that `{bootstrap,cross}-tools' are always built with
-DNOINFO, and thus there is no way to determine wherher the user
explicitly requested -DNOINFO or not.

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Is texinfo needed for buildworld with -DNOINFO ?

2000-01-18 Thread Ruslan Ermilov

On Tue, Jan 18, 2000 at 11:47:27PM +1100, Bruce Evans wrote:
 On Tue, 18 Jan 2000, Ruslan Ermilov wrote:
 
  On Tue, Jan 18, 2000 at 12:31:18PM +0200, Sheldon Hearn wrote:
   
   
   On Tue, 18 Jan 2000 19:14:19 +0900, Munehiro Matsuda wrote:
   
It seems that texinfo is compiled as cross-tools for buildworld.
But, is it really needed when -DNOINFO has been specified?
   
   It's arguable, so I'd go with the status quo -- always build and install
   the texinfo program, even if info files are not to be installed.
 
 The patch is a (small) optimization.  It happens to avoid the bug when
 NOINFO is set for the whole world.
 
  The problem is that `{bootstrap,cross}-tools' are always built with
  -DNOINFO, and thus there is no way to determine wherher the user
  explicitly requested -DNOINFO or not.
 
 Not a problem.  Only Makefile.1 needs to know whether the user set it.
 
How's that not a problem?  The current Makefile.inc1 is written so,
that bootstrap-tools are built with:

BMAKE=${BMAKEENV} ${MAKE} -f Makefile.inc1 -DNOMAN -DNOINFO -DNOHTML
   

So, how inside the Makefile.inc1's bootstrap-tools: target I could know
whether the user requested NOINFO, or Makefile.inc1 itself?

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: HEADS UP: grep 2.4a is now in the tree

2000-01-18 Thread Ruslan Ermilov

On Tue, Jan 18, 2000 at 11:00:43AM -0500, Ben Rosengart wrote:
 On Tue, 18 Jan 2000, Ruslan Ermilov wrote:
 
--binary-files='text' treats binary files as text
(equivalent to -a or --text).
 
 So "-a" now does the opposite of what it used to do?
 
Not exactly.

A stock grep 2.0 did not distinguish between binary and text files.
So we (FreeBSD) added -a option, which caused grep to skip binary
files.

A stock grep 2.3 intoduced a stock -a option.  By default, grep 2.3
prints a one-line message "Binary file FOO matches" (if it really
matches).

Grep 2.4 introduces a --binary-files option, which could be used
to either 1) print a one-line message, if files matches; 2) treat
the binary files as text files; 3) skip binary files.

The equivalent to the old -a option is --binary-files=without-match.
If you want this by default, you can hardcode it in GREP_OPTIONS
environment variable.

For a full story, see src/gnu/usr.bin/grep/NEWS.


Cheers,
-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: HEADS UP: grep 2.4a is now in the tree

2000-01-19 Thread Ruslan Ermilov

On Wed, Jan 19, 2000 at 10:02:14AM +0600, Max Khon wrote:
 hi, there!
 
 On Tue, 18 Jan 2000, Ruslan Ermilov wrote:
 
  The equivalent to the old -a option is --binary-files=without-match.
  If you want this by default, you can hardcode it in GREP_OPTIONS
  environment variable.
 
 I think there should be one-letter shorthand for this.
 
I asked GNU folks for this, but unfortunately, they don't think so.
If you feel strongly, please argue on [EMAIL PROTECTED].

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: installworld fialed

2000-01-19 Thread Ruslan Ermilov

On Wed, Jan 19, 2000 at 10:51:50AM -0500, T. Hsiang wrote:
 Does anyone have the same problem?
 
 --
 === gnu/usr.bin/texinfo/doc
 sflag=`grep -q ^INFO-DIR-SECTION info.info || echo 1`;  eflag=`grep -q 
^START-INFO-DIR-ENTRY info.info || echo 1`;  install-info  
${sflag:+--section=Miscellaneous}  ${eflag:+--entry=}  info.info /usr/share/info/dir
 sflag=`grep -q ^INFO-DIR-SECTION info-stnd.info || echo 1`;  eflag=`grep -q 
^START-INFO-DIR-ENTRY info-stnd.info || echo 1`;  install-info  
${sflag:+--section=Miscellaneous}  ${eflag:+--entry=}  info-stnd.info 
/usr/share/info/dir
 sflag=`grep -q ^INFO-DIR-SECTION texinfo.info || echo 1`;  eflag=`grep -q 
^START-INFO-DIR-ENTRY texinfo.info || echo 1`;  install-info  
${sflag:+--section=Miscellaneous}  ${eflag:+--entry=}  texinfo.info 
/usr/share/info/dir
 install-info: menu item `makeinfo' already exists, for file `makeinfo'
 *** Error code 1
 
 Stop in /usr/src/gnu/usr.bin/texinfo/doc.
 *** Error code 1

On Wed, Jan 19, 2000 at 11:02:44AM -0500, Jim Bloom wrote:
 Yes, I had the same problem.  I simply removed /usr/share/info and ran
 installworld again.  I don't know what you might lose if you try this,
 but I don't use info much so I didn't really care.
 

On Wed, Jan 19, 2000 at 06:32:32PM +0200, Sheldon Hearn wrote:
 
 Are you getting this with rev 1.131 of src/Makefile.inc1?
 
 I make and installed world successfully with this version about 15 hours
 ago.
 

The problem is that new install-info(1) will (correctly) refuse to install
file FOO with BAR entry if BAR entry already exists for another file FOO2
in /usr/share/info/dir file.

In this particular case, the problem is observed because till 1999/01/15
we had src/contrib/texinfo/makeinfo/makeinfo.texi (with entry=makeinfo,
file=makeinfo), and starting from that date we have
src/contrib/texinfo/doc/texinfo.txi with entry=makeinfo, file=texinfo.

The correct fix will be to re-initialize ${DESTDIR}/usr/share/info/dir at
the early stage of installworld.

I've just committed the fix (src/share/Makefile, src/share/info/Makefile).

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Please help spread the CVSup mirror load more evenly

2000-01-22 Thread Ruslan Ermilov

On Fri, Jan 21, 2000 at 10:43:39AM -0800, John Polstra wrote:
 This is another in my series of occasional nags to try to get people
 to use some of the less heavily loaded CVSup mirrors.  In the US
 alone, we have 8 mirror sites now, named (duh) cvsup[1-8].FreeBSD.org.
 The newest, cvsup8, is a very high-capacity and well-connected site,
 yet hardly anybody is using it.  Please give it a try!
 
What's wrong with DNS-based load-balancing solution?
I.e.

cvsup[1-8]  CNAME   cvsup   ; for backward compatibility
cvsup   A   x.x.x.x
A   y.y.y.y
...
A   z.z.z.z

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: 4.0 CODE FREEZE vs PR patches

2000-01-25 Thread Ruslan Ermilov

On Mon, Jan 24, 2000 at 10:54:46PM -0500, Danny J. Zerkel wrote:
 While I don't have much time to hack, I have tried to spend a little
 time
 going through the open PRs.  When I find something I can reproduce,
 I try
 to fix it.  How can I get the patches I have submitted into 4.0?  Some
 of
 the problems were not very "obvious" patches, but all of them have been
 very short (unsually 1 or 2 lines), so I would guess that reviewing
 would
 not be quite as easy.  How can I help?  Who should I bug?
 
 The PRs in question:
 4420
 9350
 12137
 12242
 12806
 
Please send your patches to [EMAIL PROTECTED]

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: grep --binary-files=without-match (fwd)

2000-01-26 Thread Ruslan Ermilov

On Wed, Jan 26, 2000 at 10:17:05AM +0600, Max Khon wrote:
 hi, there!
 
 can we merge this when it's ready before freeze?
 
Of course, if Jordan approves.  This will be a pretty small
diff.  Jordan?

 -- Forwarded message --
 Date: Tue, 25 Jan 100 22:47:26 -0500 (EST)
 From: Alain Magloire [EMAIL PROTECTED]
 To: Paul Eggert [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED], [EMAIL PROTECTED]
 Subject: Re: grep --binary-files=without-match
 
 Bonjour
 
 Date: Tue, 25 Jan 2000 10:18:30 +0600 (NS)
 From: Max Khon [EMAIL PROTECTED]
  
 Sometimes I need to find all files that
 contain something. Sometimes I need only text files
 (e.g: vi `grep -rl xxx .` -- no binary files are desired).
  
  Thanks; that explains why you need a short-option equivalent to
  --binary-files=without-match.  Here is a proposed patch to implement
  this, plus it fixes a couple of minor manual bugs I found while
  documenting this.  It assumes all the previous patches that I've sent
  to the grep maintainer.
  
  2000-01-25  Paul Eggert  [EMAIL PROTECTED]
  
  * NEWS, doc/grep.1, doc/grep.texi: Add -I option.
  * src/grep.c (short_options, usage, main): Likewise.
  
  * doc/grep.texi: Fix some incorrect references to ASCII.
 
 Patch applied.
 Ruslan, there will be a beta on alpha, this weekend, grep-2.4d, I will
 notify you since FreeBSD'ers  are the one pushing hard for the
 --binary-files options.
 
 --
 alain
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with "unsubscribe freebsd-current" in the body of the message

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: src/include/Makefile,v 1.109 is broken

2000-01-27 Thread Ruslan Ermilov

On Thu, Jan 27, 2000 at 06:34:08PM +0200, Sheldon Hearn wrote:
 
 
 On Thu, 27 Jan 2000 17:00:58 +0200, Ruslan Ermilov wrote:
 
  An attached patch seems to fix the problem.
 
 Does anybody actually understand what's really going on in this file?
 Everyone uses the words "seems to" and "I think" when they're proposing
 fixes in this file.
 
Disregard my "seems" word above, it really fixes the problem ;=)

BTW, I has given a comment:
| The idea was that `copies' should first undo all the
| things `symlinks' did, but it is broken now.

 I propose that we hold out for a fix which is accompanied by comments
 that explain what the hell all these oddball variables are used for and
 why SHARED is overridden (or used at all in the buildworld case).
 
Obviously, to speed up the building process.

 Ruslan, if I misunderstood your words, please don't take offense.  It's
 just that this'll be the 5th commit in this regard without comment
 from Marcel, who was responsible for rewriting most of this Makefile
 recently.
 
I was told by Alexey Zelkin that Marcel was hired by some giant company,
and he asked for FreeBSD vacation for some time (though I personally
did not see such a message)...

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: conflicts keyword gone?

2000-01-31 Thread Ruslan Ermilov

On Mon, Jan 31, 2000 at 06:06:09AM -0500, Donn Miller wrote:
 I noticed that the "conflicts" keyword was eliminated from the kernel
 config file syntax.  Do we just eliminate this keyword, or is there
 another keyword that we should use in its place?  Sorry if I missed
 this...
 
 - Donn
 
: peter   2000/01/29 10:07:08 PST
: 
:   Modified files:
: sys/i386/confGENERIC LINT
: sys/alpha/conf   GENERIC
: sys/pc98/confGENERIC98
:   Log:
:   Remove 'conflicts' token - it has been effectively doing absolutely
:   nothing for quite some time.  The only thing that cared was userconfig,
:   but it was for one invisible device so we never saw it's effects.
: 
:   Revision  ChangesPath
:   1.239 +2 -2  src/sys/i386/conf/GENERIC
:   1.742 +2 -2  src/sys/i386/conf/LINT
:   1.68  +2 -2  src/sys/alpha/conf/GENERIC
:   1.126 +2 -2  src/sys/pc98/conf/GENERIC98

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



HEADS UP: GNU grep 2.4d

2000-01-31 Thread Ruslan Ermilov

Hi!

Under a big pressure from the FreeBSD community, GNU grep
maintainers released grep-2.4d, which has a new option -I,
a short equivalent to --binary-files='without-match'.

Grep 2.4d is now in the source tree (Approved by: jkh).

This, I hope, will finally close this can of worms ;=)


Enjoy,
-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: HEADS UP: GNU grep 2.4d

2000-01-31 Thread Ruslan Ermilov

On Mon, Jan 31, 2000 at 01:02:29PM -0500, Will Andrews wrote:
 On Mon, Jan 31, 2000 at 03:54:00PM +0200, Ruslan Ermilov wrote:
  Under a big pressure from the FreeBSD community, GNU grep
  maintainers released grep-2.4d, which has a new option -I,
  a short equivalent to --binary-files='without-match'.
 
 Is this also equivalent to the old grep's -a option? I mean OLD grep, from
 like 6 months ago?
 
Yes, that's why all this fuss have taken place ;=)

 grep -a normally ignored binary files completely, back then.
 
It was a local FreeBSD feature; now it is part of the official GNU grep.

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: HEADS UP: GNU grep 2.4d

2000-02-01 Thread Ruslan Ermilov

On Tue, Feb 01, 2000 at 08:24:41AM -0500, Will Andrews wrote:
 On Mon, Jan 31, 2000 at 08:28:30PM +0200, Ruslan Ermilov wrote:
  Yes, that's why all this fuss have taken place ;=)
 
 WOOHOO!
 
 I agree with Alex Langer, though. -R - -r gets on my nerves. But I suppose
 it is consistent with `rm`, just not `cp`.. hmm, consistency.
 
In fact, it is consistent with GNU grep ;=)
Old -a and -R were FreeBSD extensions that have gone now.

-- 
Ruslan Ermilov  Sysadmin and DBA of the
[EMAIL PROTECTED]United Commercial Bank,
[EMAIL PROTECTED]  FreeBSD committer,
+380.652.247.647Simferopol, Ukraine

http://www.FreeBSD.org  The Power To Serve
http://www.oracle.com   Enabling The Information Age


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



<    1   2   3   4   5   6   7   >