O_EXCL check went missing.

This commit is contained in:
Philip Homburg 2007-08-07 14:26:56 +00:00
parent d01d630727
commit 9c51f0b92a

View File

@ -38,7 +38,7 @@
FORWARD _PROTOTYPE( int x_open, (int bits, int oflags, int omode,
char *lastc, struct vnode **vpp) );
FORWARD _PROTOTYPE( int common_open, (int oflags, mode_t omode) );
FORWARD _PROTOTYPE( int create_open, (_mnx_Mode_t omode,
FORWARD _PROTOTYPE( int create_open, (_mnx_Mode_t omode, int excl,
struct vnode **vpp, int *created) );
FORWARD _PROTOTYPE( int y_open, (struct vnode *vp, _mnx_Mode_t bits,
int oflags));
@ -112,7 +112,7 @@ PRIVATE int common_open(register int oflags, mode_t omode)
}
if (oflags & O_CREAT)
r= create_open(omode, &vp, &created);
r= create_open(omode, !!(oflags & O_EXCL), &vp, &created);
else
{
#if 0
@ -244,8 +244,9 @@ PRIVATE int common_open(register int oflags, mode_t omode)
/*===========================================================================*
* create_open *
*===========================================================================*/
PRIVATE int create_open(omode, vpp, created)
PRIVATE int create_open(omode, excl, vpp, created)
mode_t omode;
int excl;
struct vnode **vpp;
int *created;
{
@ -334,6 +335,14 @@ int *created;
}
if (r == EEXIST && excl)
{
printf(
"vfs:create_open: creating existing file with O_EXCL\n");
put_vnode(dir_vp);
return r;
}
/* Try a regular lookup */
memcpy(user_fullpath, lastc, len);
r1= lookup_rel_vp(dir_vp, 0 /*flags*/, 0 /*!use_realuid*/, &vp);