| From: WATNOW::"[email protected]" 18-APR-1997
13:51:50.41
To: [email protected]
CC:
Subj: RE : POINT #26220 Sema Madrid C file attachment
--Boundary (ID 1WZuLhtuXDLhtt4Ykn9o1Q)
Content-type: TEXT/PLAIN; CHARSET=ISO-8859-1
Content-transfer-encoding: QUOTED-PRINTABLE
Hi Nick :
Following our telephone conversation here is the original email with =
file
attached!
Regards,
Gr=E1inne Maycock
[email protected]
822 4360
--Boundary (ID 1WZuLhtuXDLhtt4Ykn9o1Q)
Content-type: TEXT/PLAIN; CHARSET=ISO-8859-1
Content-transfer-encoding: QUOTED-PRINTABLE
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <mqueue.h>
main()
{
=20
char queue_name[100];
=20
mqd_t queueCD_ID;
int result;
int fd;
struct mq_attr mqstat;
struct mq_attr omqstat;
=20
strcpy (queue_name, "/mediadkb0/usuarios/guiller/pruebas/capture_q"=
);
/**********************
fd =3D open (queue_name, O_WRONLY|O_CREAT, 0220);
if ( fd =3D=3D -1 )
{
fprintf (stderr, "OPEN: %d\n", errno);
perror ("open ");
exit(1);=20
}
**********************/
memset (&mqstat, 0, sizeof (struct mq_attr));
mqstat.mq_maxmsg =3D 200;
mqstat.mq_msgsize =3D 200;
queueCD_ID =3D mq_open (queue_name, O_RDWR|O_CREAT, 0666, NULL);
if ( queueCD_ID =3D=3D (mqd_t)-1 )
{
fprintf (stderr, "MQ_OPEN: %d\n", errno);
perror ("mq_open ");
exit(1);=20
}
memset (&mqstat, 0, sizeof (struct mq_attr));
result =3D mq_getattr (queueCD_ID, &mqstat);
if ( result =3D=3D -1 )
{
fprintf (stderr, "MQ_GETATTR: %d\n", errno);
exit(1);=20
}
memset (&omqstat, 0, sizeof (struct mq_attr));
memcpy (&omqstat, &mqstat, sizeof (struct mq_attr));
omqstat.mq_maxmsg =3D 400;
result =3D mq_setattr (queueCD_ID, &mqstat, &omqstat);
if ( result =3D=3D -1 )
{
fprintf (stderr, "MQ_SETATTR: %d\n", errno);
exit(1);=20
}
memset (&mqstat, 0, sizeof (struct mq_attr));
result =3D mq_getattr (queueCD_ID, &mqstat);
if ( result =3D=3D -1 )
{
fprintf (stderr, "MQ_GETATTR: %d\n", errno);
exit(1);=20
}
exit (0);
}
--Boundary (ID 1WZuLhtuXDLhtt4Ykn9o1Q)--
|
| From: WATNOW::"[email protected]" 22-APR-1997 15:47:02.16
To: "'[email protected]'" <[email protected]>
CC:
Subj: privileges
Dear Nick.
I have been testing the program colas.c.
1) I have that queue_name =3D /mediadkb0/usuarios/eugenio/queue_name
When I run the program I have always the errno 13 (using the accounts =
eugenio and system).
If I run the program colas.c using a sentence open instead of mq_open, I =
do not have the error. (So with open the privileges are ok, but with =
mq_open the privileges are not ok).
If I have that queue_name =3D /tmp/queue_name
When I run the program with the system account, the program works. If I =
do this with my account (eugenio), the program does not work (errno 13).
I send you the privileges I have in the directories I have been testing. =
Probably you can see something is wrong.
lr-xr-xr-x 1 system system tmp->/cont/MEDIA_tmp
drwxrwxrwx 10 system system cont
drwxrwxrwx 4 system system MEDIA_tmp
drwxrwxrwx 2 65793 65537 mediadkb0
drwxrwxrwx 2 65793 65537 usuarios
drwxrwxrwx 2 eugenio 65600 eugenio
Thanks a lot.
Eugenio Montero
Sema Group s.a.e - Division Telecom
c/ Albarracin 25. 28010 Madrid. Spain
tlf : 34-1-3272828 fax : 34-1-7543253
|
| From: DEC:.REO.REOVTX::HUDSON "[email protected] - UK Software
Partner Engineering 830-4121" 25-APR-1997 16:34:41.81
To: nm%WATNOW::"[email protected]"
CC: HUDSON
Subj: RE: privileges
Hello Eugenio
I don't know why you are seeing this problem, I seem to have the same settings
as you. This is a log of my session below, containing a smaller version of the
program you sent, and display of the directory protections. Perhaps you could
try this little one and tell me what happens?
psx> ls -l /tmp/capture_q
ls: File or directory "/tmp/capture_q" is not found
psx> cat prog1.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <mqueue.h>
main(int argc, char *argv[])
{
char queue_name[100];
mqd_t queueCD_ID;
strcpy (queue_name, "/tmp/capture_q");
queueCD_ID = mq_open (queue_name, O_RDWR|O_CREAT, 0666, NULL);
printf("queue_CD_ID is %d\n",queueCD_ID);
if ( queueCD_ID == (mqd_t)-1 )
{
fprintf (stderr, "MQ_OPEN: %d\n", errno);
perror ("mq_open ");
exit(1);
}
exit(1);
}
psx> cc prog1.c
psx> a.out
queue_CD_ID is 3
psx> ls -l /tmp/capture_q
xrw-rw-rw- 1 hudson system 0 Apr 25 16:29 /tmp/capture_q
psx> ls -l /tmp
lr-xr-xr-x 1 system system 16 Jan 1 1970 /tmp -> /cont/SPEAXP_tmp
psx> ls -l /cont
total 32
drwxrwxrwx 2 system system 1915 Mar 21 1996 SPEAXP_dev
drwxrwxrwx 4 wood_j system 1915 Apr 25 16:29 SPEAXP_tmp
drwxr-xr-x 2 system system 1915 Mar 21 1996 bin
drwxr-xr-x 2 system system 1915 Mar 21 1996 dev
drwxr-xr-x 2 system system 1915 Sep 12 1996 etc
drwxr-xr-x 2 system system 1915 Mar 21 1996 lib
drwxr-xr-x 2 system system 1915 Mar 21 15:36 tmp
drwxr-xr-x 9 system system 1915 Mar 21 15:36 usr
psx> ls -l /cont/SPEAXP_tmp
total 8
xrw-rw-rw- 1 hudson system 0 Apr 25 16:29 capture_q
drwxrwxrwx 2 wood_j system 1915 Mar 21 15:36 msg
drwxrwxrwx 2 wood_j system 1915 Mar 21 15:36 shm
psx> exit
|