Thread: [Libsysio-commit] HEAD: libsysio/src open.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2004-04-01 15:38:19
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6680 Modified Files: open.c Log Message: Fix application of umask in open. From Kevin Pedretti. Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- open.c 25 Feb 2004 16:24:00 -0000 1.14 +++ open.c 1 Apr 2004 15:26:20 -0000 1.15 @@ -157,7 +157,7 @@ open(const char *path, int flags, ...) va_arg(ap, int); #endif va_end(ap); - mode &= ~_sysio_umask & 0777; /* apply umask */ + mode &= ~(_sysio_umask & 0777); /* apply umask */ if (flags & O_EXCL) { /* |
From: Lee W. <lw...@us...> - 2004-04-02 14:39:56
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30251 Modified Files: open.c Log Message: Cray Red Storm requires support for the O_NOFOLLOW flag to open. Added it for everyone. Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- open.c 1 Apr 2004 15:26:20 -0000 1.15 +++ open.c 2 Apr 2004 14:27:46 -0000 1.16 @@ -41,6 +41,11 @@ * le...@sa... */ +/* + * Incorporate the GNU flags for open if we can. + */ +#define _GNU_SOURCE + #include <stdlib.h> #include <string.h> #include <errno.h> @@ -157,7 +162,7 @@ open(const char *path, int flags, ...) va_arg(ap, int); #endif va_end(ap); - mode &= ~(_sysio_umask & 0777); /* apply umask */ + mode &= ~(_sysio_umask & 0777) | 07000; /* apply umask */ if (flags & O_EXCL) { /* @@ -166,6 +171,10 @@ open(const char *path, int flags, ...) intent.int_opmask |= INT_CREAT; } } +#ifdef O_NOFOLLOW + if (flags & O_NOFOLLOW) + ndflags |= ND_NOFOLLOW; +#endif /* * Find the file. |
From: Ruth K. <rk...@us...> - 2004-04-27 22:31:40
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24720 Modified Files: open.c Log Message: add missing interface name macro Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- open.c 27 Apr 2004 22:10:55 -0000 1.17 +++ open.c 27 Apr 2004 22:31:31 -0000 1.18 @@ -223,7 +223,7 @@ error: #undef __open sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __open) #undef open64 -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), open64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), SYSIO_INTERFACE_NAME(open64)) #undef __open64 sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(open), __open64) #endif @@ -272,7 +272,7 @@ SYSIO_INTERFACE_NAME(creat)(const char * #undef __creat sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat) #undef creat64 -sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), creat64) +sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), SYSIO_INTERFACE_NAME(creat64)) #undef __creat64 sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(creat), __creat64) #endif |
From: Lee W. <lw...@us...> - 2005-08-03 13:46:26
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26427 Modified Files: open.c Log Message: The CREAT intent flag was only being set if the caller specified O_EXCL. Changed so that it is set withonly O_CREAT specified. Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -w -b -B -p -r1.24 -r1.25 --- open.c 25 Jan 2005 00:37:14 -0000 1.24 +++ open.c 3 Aug 2005 13:46:10 -0000 1.25 @@ -162,14 +162,8 @@ SYSIO_INTERFACE_NAME(open)(const char *p #endif va_end(ap); mode &= ~(_sysio_umask & 0777) | 07000; /* apply umask */ - - if (flags & O_EXCL) { - /* - * Tell others we intend to create this file. - */ intent.int_opmask |= INT_CREAT; } - } #ifdef O_NOFOLLOW if (flags & O_NOFOLLOW) ndflags |= ND_NOFOLLOW; |
From: Lee W. <lw...@us...> - 2006-01-18 00:42:48
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10543 Modified Files: open.c Log Message: Emulate Linux behavior with the O_NOFOLLOW flag to open(). Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -w -b -B -p -r1.25 -r1.26 --- open.c 3 Aug 2005 13:46:10 -0000 1.25 +++ open.c 18 Jan 2006 00:42:41 -0000 1.26 @@ -112,6 +112,10 @@ _sysio_open(struct pnode *pno, int flags err = -EEXIST; else if (!ino) err = _sysio_p_validate(pno, NULL, NULL); +#ifdef O_NOFOLLOW + else if (flags & O_NOFOLLOW && S_ISLNK(ino->i_stbuf.st_mode)) + err = -ELOOP; +#endif else { /* * Simple open of pre-existing file. |
From: Lee W. <lw...@us...> - 2008-12-06 18:22:36
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9324 Modified Files: open.c Log Message: Fixed a bug in _sysio_open; After calling the driver open, successfully, it was taking an extra, unneeded, reference. As well, in _sysio_open, after the driver does it's open, we want to make sure there is an inode present; Next thing we will probably do is install the thing into the open file table. Added a validate, then. Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -w -b -B -p -r1.33 -r1.34 --- open.c 15 Oct 2008 22:01:01 -0000 1.33 +++ open.c 6 Dec 2008 18:22:27 -0000 1.34 @@ -96,7 +97,7 @@ _sysio_open(struct pnode *pno, int flags return -EROFS; err = _sysio_p_validate(pno->p_parent, NULL, NULL); if (!err && (err = PNOP_OPEN(pno, flags, mode)) == 0) - I_REF(pno->p_base->pb_ino); + err = _sysio_p_validate(pno, NULL, NULL); } else if ((flags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL)) err = -EEXIST; else if (!pno->p_base->pb_ino) |
From: Lee W. <lw...@us...> - 2009-09-11 06:23:54
|
Update of /cvsroot/libsysio/libsysio/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24374 Modified Files: open.c Log Message: In open, parent was always being put when we were done with it. This should only have been done when the lock was acquired. I.e., it's only needed when ND_WANTPARENT was passed to namei. Fixed. Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -b -B -p -r1.35 -r1.36 --- open.c 4 Aug 2009 15:01:24 -0000 1.35 +++ open.c 11 Sep 2009 06:23:42 -0000 1.36 @@ -179,6 +179,7 @@ SYSIO_INTERFACE_NAME(open)(const char *p * Ask for the open/creat. */ rtn = _sysio_open(pno, flags, mode); + if (ndflags & ND_WANTPARENT) P_PUT(pno->p_parent); if (rtn) goto error; |