Re: Semantics of seteuid(uid) vs. setreuid(-1,uid)

2004-06-10 Thread Stefan Eßer
On 2004-06-07 01:30 -0700, David Schultz [EMAIL PROTECTED] wrote:
 On Sun, Jun 06, 2004, Stefan Eer wrote:
  Any reason, that there is a difference in semantics between:
  
  seteuid(id) vs. setreuid(-1, id)???
  
  The tests performed on the arguments are different (assuming a
  fixed arg of -1 for ruid) in that seteuid does not support the
  case of (euid == cr_uid):
  [...]
  Is the difference between seteuid() and setreuid() deliberate ?
 
 The best rationale I can think of is that setreuid(x, geteuid())
 does something useful, whereas seteuid(geteuid()) is a no-op.  I
 think the seteuid() behavior you complain about exists for purely
 historical reasons.  POSIX does not require seteuid(geteuid()) to
 succeed, but it implicitly allows it as an extension.  Solaris and
 Linux have this extension.  The trouble with tweaking the
 interface is that you always have to ask: what new security holes
 could this open up in existing software?

Thanks for the reply. I'm afraid that there might be security risks
and/or broken programs in the system. Problem is, that the current 
behaviour breaks programs in ports, that expect seteuid to behave
the same as setreuid(-1,uid) does on FreeBSD. But this can be fixed
in the individual ports ...

 Hao Chen points out that the failure of seteuid(geteuid()) in
 FreeBSD is one of many tricky issues with using the set*uid()
 interface portably.  In my (biased) opinion, his Setuid
 Demystified paper, is well worth reading if you want to untangle
 this stuff in your mind:
 
   http://www.usenix.org/events/sec02/full_papers/chen/chen.pdf

Thank you for the pointer: Interesting reading !

Regards, STefan
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Dell SBLive! (almost) fixed

2004-06-10 Thread Joseph Dunn
Hello hackers@,

I just helped a friend install FreeBSD 5.2.1 on his Dell desktop
machine, and we've been struggling to get his sound card working. His
system has an SBLive! card, we were unable to use it with the stock
snd_emu10k1 driver. However...

pciconf -lv output:
[EMAIL PROTECTED]:2:0: class=0x040100 card=0x10031102 chip=0x00061102 rev=0x00
hdr=0x00
vendor   = 'Creative Labs'
device   = 'emu10k1x Soundblaster Live! 5.1'
class= multimedia  
subclass = audio

relevant lines from /usr/src/sys/dev/sound/pci/emu10k1.c:
#define EMU10K1_PCI_ID  0x00021102
#define EMU10K2_PCI_ID  0x00041102

As you can see, Dell has apparently changed the card's PCI ID, and thus
the driver is not detecting it. I modified emu10k1.c to include the PCI
ID (see attached diff). Now, the new snd_emu10k1 driver detects the
card:
pcm0: Creative EMU10K1 (Dell) port 0xdf20-0xdf3f irq 17 at device 2.0 on pci2
pcm0: SigmaTel STAC9708/11 AC97 Codec

This *appears* to be working, but when I tried to play an mp3 with
mpg123, I got this error, and no sound:
pcm0:play:0: play interrupt timeout, channel dead

Could anyone with experience in this area venture a guess as to the
problem?

Thanks,

Joseph
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Dell SBLive! (almost) fixed

2004-06-10 Thread Joseph Dunn
Whoops, forgot the diff. It's attached.

Joseph
--- emu10k1.c   2004-06-09 11:26:37.0 -0500
+++ emu10k1.c.dell  2004-06-09 11:29:26.0 -0500
@@ -37,6 +37,7 @@
 /*  */
 
 #defineEMU10K1_PCI_ID  0x00021102
+#defineEMU10K1_DELL_PCI_ID 0x00061102
 #defineEMU10K2_PCI_ID  0x00041102
 #defineEMU_DEFAULT_BUFSZ   4096
 #defineEMU_CHANS   4
@@ -1441,6 +1442,10 @@
case EMU10K1_PCI_ID:
s = Creative EMU10K1;
break;
+
+   case EMU10K1_DELL_PCI_ID:
+   s = Creative EMU10K1 (Dell);
+   break;
 /*
case EMU10K2_PCI_ID:
s = Creative EMU10K2;
@@ -1595,6 +1600,10 @@
s = Creative EMU10K1 Joystick;
device_quiet(dev);
break;
+   case 0x70041102:
+   s = Creative EMU10K1 Joystick (Dell);
+   device_quiet(dev);
+   break;
case 0x70031102:
s = Creative EMU10K2 Joystick;
device_quiet(dev);
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: bugs with disk space

2004-06-10 Thread Joan Picanyol
* Jose Hidalgo Herrera [EMAIL PROTECTED] [20040609 19:35]:
 srv0:~# df -hi /
 FilesystemSize   Used  Avail Capacity iused ifree %iused  Mounted on
 /dev/ad0s1a   126M   125M  -8.9M   108%1364 148908%   /
 
 srv0:~# du -shx /
  36M/
 
 The operating system complains about free space, but I'm only using 36M,
 while the df says that I'm using 125M, the inodes are not the problem.

FAQ 9.23

qvb
-- 
pica
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Dell SBLive! (almost) fixed

2004-06-10 Thread Mathew Kanner
On Jun 09, Joseph Dunn wrote:
 Hello hackers@,
 
 I just helped a friend install FreeBSD 5.2.1 on his Dell desktop
 machine, and we've been struggling to get his sound card working. His
 system has an SBLive! card, we were unable to use it with the stock
 snd_emu10k1 driver. However...
 
 pciconf -lv output:
 [EMAIL PROTECTED]:2:0: class=0x040100 card=0x10031102 chip=0x00061102 rev=0x00
 hdr=0x00
 vendor   = 'Creative Labs'
 device   = 'emu10k1x Soundblaster Live! 5.1'
 class= multimedia  
 subclass = audio
 
 relevant lines from /usr/src/sys/dev/sound/pci/emu10k1.c:
 #define EMU10K1_PCI_ID  0x00021102
 #define EMU10K2_PCI_ID  0x00041102
 
 As you can see, Dell has apparently changed the card's PCI ID, and thus
 the driver is not detecting it. I modified emu10k1.c to include the PCI
 ID (see attached diff). Now, the new snd_emu10k1 driver detects the
 card:
 pcm0: Creative EMU10K1 (Dell) port 0xdf20-0xdf3f irq 17 at device 2.0 on pci2
 pcm0: SigmaTel STAC9708/11 AC97 Codec
 
 This *appears* to be working, but when I tried to play an mp3 with
 mpg123, I got this error, and no sound:
 pcm0:play:0: play interrupt timeout, channel dead
 
 Could anyone with experience in this area venture a guess as to the

Hi Joseph,
I seem to recall a couple of open PRs on this particular
issue.  I think it's more complicated than just setting the PCIID of
the device, and I've never actually heard of anyone hacking the
emu10k1 to support the DELL OEM version of the card.
I would venture a guess and say if ALSA can do, then we have a
fighting chance, though I haven't looked ALSA to see what they do in a
long time...
Please keep me up to date on your progress.
Thanks,
--Mat

-- 
Canada is a country whose main exports are hockey players
and cold fronts. Our main imports are baseball players and
acid rain.
- Pierre Elliott Trudeau
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Dell SBLive! (almost) fixed

2004-06-10 Thread Anton Alin-Adrian
Joseph Dunn wrote:
Whoops, forgot the diff. It's attached.
Joseph

--- emu10k1.c	2004-06-09 11:26:37.0 -0500
+++ emu10k1.c.dell	2004-06-09 11:29:26.0 -0500
@@ -37,6 +37,7 @@
 /*  */
 
 #define	EMU10K1_PCI_ID	0x00021102
+#define	EMU10K1_DELL_PCI_ID	0x00061102
 #define	EMU10K2_PCI_ID	0x00041102
 #define	EMU_DEFAULT_BUFSZ	4096
 #define	EMU_CHANS	4
@@ -1441,6 +1442,10 @@
 	case EMU10K1_PCI_ID:
 		s = Creative EMU10K1;
 		break;
+
+	case EMU10K1_DELL_PCI_ID:
+		s = Creative EMU10K1 (Dell);
+		break;
 /*
 	case EMU10K2_PCI_ID:
 		s = Creative EMU10K2;
@@ -1595,6 +1600,10 @@
 		s = Creative EMU10K1 Joystick;
 		device_quiet(dev);
 		break;
+	case 0x70041102:
+		s = Creative EMU10K1 Joystick (Dell);
+		device_quiet(dev);
+		break;
 	case 0x70031102:
 		s = Creative EMU10K2 Joystick;
 		device_quiet(dev);


___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]
Try the drivers from www.opensound.com and see if it can get it working. If 
they can, then probably the card is also modified too.

--
Alin-Adrian Anton
Reversed Hell Networks
GPG keyID 0x1E2FFF2E (2963 0C11 1AF1 96F6 0030 6EE9 D323 639D 1E2F FF2E)
gpg --keyserver pgp.mit.edu --recv-keys 1E2FFF2E
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


indent bugfix / added features

2004-06-10 Thread Chip Norkus

Hi all,

  I've been working on a major project, and decided to use indent to
normalize the code a bit.  In doing so I discovered a few deficencies in
the stock FreeBSD (5.2-CURRENT) indent and decided to fix them, I
thought these might be fairly common wishes (and one of them is a
bugfix) and have attached a patch which does the following:
* Adds an option to control tab use in output code (-ut and -nut)
  (This is in the GNU indent)
* Adds an option to control brace placement after function declaration
  (-fbs and -nfbs).  What this does, specifically, is allow you to have
  indent produce 'func(args..) {' instead of 'func(args..)\n{'.  The old
  behavior is the default.
* Fixes the indent bug when aligning variable names with an indentation
  level that is not a multiple of 8.  This works for both the 'tab use'
  and 'no tab use' varieties of code output.

  I don't know if anyone would be interested in committing the bugfix (I
believe it is correct) or added features, but I hope someone else finds
this useful.

-chip
--
personal: chip norkus; renaissance hacker;[EMAIL PROTECTED]
work: systems engineer @ lunarpages, inc.;[EMAIL PROTECTED]
info: finger [EMAIL PROTECTED] for plan or keys;  http://telekinesis.org
diff -u /usr/src/usr.bin/indent/args.c ./args.c
--- /usr/src/usr.bin/indent/args.c  Tue Mar 23 13:33:16 2004
+++ ./args.cThu Jun 10 19:01:10 2004
@@ -111,6 +111,7 @@
 {eei, PRO_BOOL, false, ON, extra_expression_indent},
 {ei, PRO_BOOL, true, ON, ps.else_if},
 {fbc, PRO_FONT, 0, 0, (int *) blkcomf},
+{fbs, PRO_BOOL, true, ON, function_brace_split},
 {fbx, PRO_FONT, 0, 0, (int *) boxcomf},
 {fb, PRO_FONT, 0, 0, (int *) bodyf},
 {fc1, PRO_BOOL, true, ON, format_col1_comments},
@@ -136,6 +137,7 @@
 {ndj, PRO_BOOL, false, OFF, ps.ljust_decl},
 {neei, PRO_BOOL, false, OFF, extra_expression_indent},
 {nei, PRO_BOOL, true, OFF, ps.else_if},
+{nfbs, PRO_BOOL, true, OFF, function_brace_split},
 {nfc1, PRO_BOOL, true, OFF, format_col1_comments},
 {nfcb, PRO_BOOL, true, OFF, format_block_comments},
 {nip, PRO_BOOL, true, OFF, ps.indent_parameters},
@@ -146,6 +148,7 @@
 {nps, PRO_BOOL, false, OFF, pointer_as_binop},
 {nsc, PRO_BOOL, true, OFF, star_comment_cont},
 {nsob, PRO_BOOL, false, OFF, swallow_optional_blanklines},
+{nut, PRO_BOOL, true, OFF, use_tabs},
 {nv, PRO_BOOL, false, OFF, verbose},
 {pcs, PRO_BOOL, false, ON, proc_calls_space},
 {psl, PRO_BOOL, true, ON, procnames_start_line},
@@ -154,6 +157,7 @@
 {sob, PRO_BOOL, false, ON, swallow_optional_blanklines},
 {st, PRO_SPECIAL, 0, STDIN, 0},
 {troff, PRO_BOOL, false, ON, troff},
+{ut, PRO_BOOL, true, ON, use_tabs},
 {v, PRO_BOOL, false, ON, verbose},
 /* whew! */
 {0, 0, 0, 0, 0}
diff -u /usr/src/usr.bin/indent/indent.c ./indent.c
--- /usr/src/usr.bin/indent/indent.cTue Feb 17 02:33:36 2004
+++ ./indent.c  Thu Jun 10 21:45:58 2004
@@ -91,7 +91,7 @@
 int squest;/* when this is positive, we have seen a ?
 * without the matching : in a c?s:s
 * construct */
-intuse_tabs;   /* true if using tabs to indent to var name */
+intloc_use_tabs;   /* true if using tabs to indent to var name */
 const char *t_ptr; /* used for copying tokens */
 int type_code; /* the type of token, returned by lexi */
 
@@ -765,8 +765,13 @@
}
else if (ps.in_parameter_declaration  !ps.in_or_st) {
ps.i_l_follow = 0;
-   dump_line();
-   ps.want_blank = false;
+   if (function_brace_split) {
+   /* dump the line prior to the brace ... */
+   dump_line();
+   ps.want_blank = false;
+   } else
+   /* add a space between the decl and brace */
+   ps.want_blank = true;
}
}
if (ps.in_parameter_declaration)
@@ -914,11 +919,11 @@
if (ps.ind_level == 0 || ps.dec_nest  0) {
/* global variable or struct member in local variable */
dec_ind = ps.decl_indent  0 ? ps.decl_indent : i;
-   use_tabs = ps.decl_indent  0;
+   loc_use_tabs = (use_tabs ? ps.decl_indent  0 : 0);
} else {
/* local variable */
dec_ind = ps.local_decl_indent  0 ? ps.local_decl_indent : i;
-   use_tabs = ps.local_decl_indent  0;
+   loc_use_tabs = (use_tabs ? ps.local_decl_indent  0 : 0);
}
goto copy_id;
 
@@ -936,17 +941,31 @@
e_code += strlen(e_code);
} else {
int pos, startpos;
+   int loc_dec_ind;
 
+