Thursday, July 28, 2005

If a program requires a superuser privileges to do some job, "It is always best to give up the extra privilege when it is no longer needed, just in case the program has a latent bug that someone could exploit".
Richard Stevenes, Unix N/W Prog. V1
see line 11 page 666:
setuid(getuid()); /* don't need special permissions any more */
// it drops superuser privileges that was previuosly given to a normal user to be able to create a raw socket

السلطات البريطانية لم توجه أي اتهام للنشار

طب اعتقلوه بناءاً على ايه؟
عشان شوية إشاعات في الجرايد؟
للدرجة دى من الاحتقار وهضم الحقوق تتعامل الدولة مع مواطنيها لإظهار مدى خنوعها للحكومة البريطانية ؟؟!!؟؟

فعلا : فى مصر، المواطن متهم حتى تثبت براءته

Sunday, July 17, 2005

Struct vs. Union

if you defined:
struct s
int i;
char c;

when you define a variable of type s, a memory of size equals to the size of integer + the size of character will be reserved.

In contrasts, when you define:
union u
int i;
char c;

A variable of type u, results in the reservation of memory size of the max of integer and character, and this makes you are able to use the type u as either integer OR character.

struct = AND
unio = OR
Error msg in gcc:
invalid conversion from `void*' to `char*'

This error message appeared to me in a line using malloc()

when, i changed just the file extension form .cpp to .c the error disappeared !