This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

B20.1 on NT4.0SP5: remove() and unlink() don't return an err



I tried to remove() and unlink() files in write-protected directories, where
files cannot be removed.
(1) C:\TMP\X\ is local on NTFS protectet by NTFS security (I'm a local admin)
(2) V:\WINNT\JAVA\ is remote on a NetWare drive (where I'm not admin)
(3) J:\MQF\X\ is on a remote Samba Drive (where I'm not admin)

In cases (1) and (2) remove() and unlink() don't return an error !
The files are not removed though (they can't). Surprisingly in case (3) they do
return an error !

I think it's because dirs (1) and (2) appear to cygwin to be writable whereas
(3) appears to be readonly.


The sample code I used:

#include <stdio.h>
#include <unistd.h>
void main(int argc, char ** argv) {
  int i;
  for (i=1; i<argc; i++) {
    if      ( remove(argv[i])   ) perror(argv[i]);
    else printf("%s remove()'d\n",argv[i]);
    if      ( unlink(argv[i])   ) perror(argv[i]);
    else printf("%s unlink()'d\n",argv[i]);
    if      ( !fopen(argv[i],"r") ) perror(argv[i]);
    else printf("%s still there\n",argv[i]);
  }
}


I compiled it with "gcc -ormx rmx.c"


The output I get is:

C:\TMP\x>ls -ld .
drwxr-xr-x   2 administ Kein            0 Mar  3 15:32 .

C:\TMP\x>ls -l t.c
-rw-r--r--   1 administ Kein         1053 Mar  1 11:08 t.c

C:\TMP\x>rmx t.c
t.c remove()'d
t.c unlink()'d
t.c still there

C:\TMP\x>v:

V:\WINNT\JAVA11>ls -ld .
drwxr-xr-x   4 0        Everyone        0 Oct 12  1998 .

V:\WINNT\JAVA11>ls -ld CHANGES
-rw-r--r--   1 0        Everyone   100806 Apr 28  1998 CHANGES

V:\WINNT\JAVA11>rmx CHANGES
CHANGES remove()'d
CHANGES unlink()'d
CHANGES still there

V:\WINNT\JAVA11>j:

J:\mqf\x>ls -ld .
dr-xr-xr-x   2 hansmay  Kein            0 Mar  3 11:50 .

J:\mqf\x>ls -l xxx
-rw-r--r--   1 hansmay  Kein        29097 Mar  3 11:39 xxx

J:\mqf\x>rmx xxx
xxx: Permission denied
xxx: Permission denied
xxx still there

----------------------------------

The snapshot cygwin1.dll from Feb. 25, 2000 seems to behave better, (but I
can't compile with it) :

C:\TMP\x>copy c:\cygnus\CYGWIN~1\H-I586~1\bin\cygwin1.200002.dll
c:\winnt\system32\cygwin1.dll
        1 Datei(en) kopiert.

C:\TMP\x>ls -ld .
drwxr-xr-x   2 administ Kein            0 Mar  3 15:32 .

C:\TMP\x>ls -l t.c
-rw-r--r--   1 administ Kein         1053 Mar  1 11:08 t.c

C:\TMP\x>rmx t.c
t.c: Permission denied
t.c: Permission denied
t.c still there

---------------------------------

Is there a stable cygwin1.dll with this bug fixed ?

Hans-Juergen May


--------------------------------------------------------------
Cygnus Win95/NT Configuration Diagnostics
Current System Time: Fri Mar 03 14:40:00 2000

WinNT Ver 4.0 build 1381 Service Pack 5

Path:   /cygnus/CYGWIN~1/H-I586~1/bin
        //g/archi/hansmay/sw/gnu.nt
        //g/archi/hansmay/sw/mc.nt
        /SW/VAJ/EAB/BIN
        /WINNT/SYSTEM32
        /WINNT
        /PROGRAMME/PERSONAL COMMUNICATIONS
        /IMNNQ_NT
        /SQLLIB/BIN
        /SQLLIB/SAMPLES/REPL
        /SQLLIB/HELP
        /MQM/BIN
        /WINNT/system32/nls/English
        //V/WINNT/SYBASE/BIN
        //V/WINNT/SYBASE/DLL
        //V/WINNT/ORACLE/BIN
        //U.
        //O.
        //N.
        //M.

SysDir: C:\WINNT\System32
WinDir: C:\WINNT

HOME = `//P'
MAKE_MODE = `UNIX'

!C: = `C:\TMP'
!EXITCODE = `00000000'
!G: = `G:\OR-ALLG\MQS\MQF'
!L: = `L:\'
!M: = `M:\'
!N: = `N:\'
!O: = `O:\'
!P: = `P:\'
!Q: = `Q:\'
!R: = `R:\'
!S: = `S:\'
!T: = `T:\'
!U: = `U:\'
!V: = `V:\WINNT\JAVA11'
!W: = `W:\'
!X: = `X:\'
!Y: = `Y:\'
!Z: = `Z:\'
CLASSPATH =
`V:\WINNT\EXCEED\HCLJRCSV.ZIP;V:\WINNT\EXCEED;C:\SQLLIB\JAVA\DB2JAVA.ZIP;C:\SQLL
IB\JAVA\RUNTIME.ZIP;.;;;C:\MQM\JAVA\LIB'
COMPUTERNAME = `W0000283'
COMSPEC = `C:\WINNT\system32\cmd.exe'
CYGROOT = `c:\cygnus\cygwin-b20'
DB2INSTANCE = `DB2'
HOMEDRIVE = `P:'
HOMEPATH = `\'
IMNINST = `help'
IMNINSTSRV = `C:\IMNNQ_NT'
INCLUDE = `c:\sqllib\include;'
ISLVINI = `C:\WINNT'
LANG = `de'
LIB = `;c:\sqllib\lib'
LOGONSERVER = `\\W0000283'
MQSERVER = `MERCT.SVRCONN/TCP/MERCT'
NUMBER_OF_PROCESSORS = `1'
NWLANGUAGE = `ENGLISH'
NWUSERNAME = `hansmay'
OS = `Windows_NT'
OS2LIBPATH = `C:\WINNT\system32\os2\dll;'
PATHEXT = `.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH'
PROCESSOR_ARCHITECTURE = `x86'
PROCESSOR_IDENTIFIER = `x86 Family 5 Model 4 Stepping 3, GenuineIntel'
PROCESSOR_LEVEL = `5'
PROCESSOR_REVISION = `0403'
PROMPT = `$P$G'
SYBASE = `V:\WINNT\SYBASE'
SYSTEMDRIVE = `C:'
SYSTEMROOT = `C:\WINNT'
TEMP = `C:\TEMP'
TMP = `C:\TEMP'
USERDOMAIN = `W0000283'
USERNAME = `hansmay'
USERPROFILE = `C:\WINNT\Profiles\hansmay'
WINDIR = `C:\WINNT'
WINDOWS_LOGIN = `0'
ZUGRIFF = `82105'
TERM = `cygwin'

HKEY_CURRENT_USER\Software\Cygnus Solutions
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
  (default) = `/cygdrive'
  cygdrive flags = 0x00000020
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = `c:'
  flags = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/dev/fd0
  (default) = `\\.\a:'
  flags = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/dev/fd1
  (default) = `\\.\b:'
  flags = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/dev/st0
  (default) = `\\.\tape0:'
  flags = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/dev/st1
  (default) = `\\.\tape1:'
  flags = 0x00000000
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00
  (default) = `\\.\tape1:'
  unix = `/dev/st1'
  fbinary = 0x00000000
  fsilent = 0x00000001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
  (default) = `\\.\tape0:'
  unix = `/dev/st0'
  fbinary = 0x00000000
  fsilent = 0x00000001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
  (default) = `\\.\b:'
  unix = `/dev/fd1'
  fbinary = 0x00000000
  fsilent = 0x00000001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
  (default) = `\\.\a:'
  unix = `/dev/fd0'
  fbinary = 0x00000000
  fsilent = 0x00000001
HKEY_CURRENT_USER\Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
  (default) = `c:'
  unix = `/'
  fbinary = 0x00000000
  fsilent = 0x00000000
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin B20
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin B20\B20.1
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\00
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\01
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\02
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\03
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\04
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\05
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\06
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\07
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\08
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\09
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0A
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0B
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0C
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0D
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0E
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\0F
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\10
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\11
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\12
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\13
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\14
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\15
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\16
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\17
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\18
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\19
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1A
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1B
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1C
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\1D
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\GNUPro\i586-cygwin32\i586-cygwin32
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus
Solutions\GNUPro\i586-cygwin32\i586-cygwin32\cygwin-B20.1
  (default) = `c:\cygnus\cygwin-b20'
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Cygnus
Cygwin B20
  (default) = `C:\WINNT\IsUninst.exe -fc:\sw\cygnus\cygwin-b20\Uninst.isu'
  DisplayName = `Cygwin B20'

a:\ fd  FAT        1Mb  11% CP    UN
c:\ hd  NTFS    1506Mb  98% CP CS UN PA FC     WINNT
d:\ net NWFS   113510Mb  57% CP                 VOL1
g:\ net NWFS   113510Mb  57% CP                 VOL1
j:\ net Samba   3802Mb  46% CP    UN           mercator
l:\ net NWFS    5000Mb  19% CP                 SYS
m:\ net NWFS   62723Mb  60% CP                 VOL1
n:\ net NWFS   62723Mb  60% CP                 VOL1
o:\ net NWFS    5000Mb  19% CP                 SYS
p:\ net NWFS   113510Mb  57% CP                 VOL1
q:\ net NWFS   113510Mb  57% CP                 VOL1
r:\ net NWFS   113510Mb  57% CP                 VOL1
s:\ net NWFS    5000Mb  19% CP                 SYS
t:\ net NWFS   113510Mb  57% CP                 VOL1
u:\ net NWFS    5000Mb  19% CP                 SYS
v:\ net NWFS   113510Mb  57% CP                 VOL1
w:\ net NWFS   113510Mb  57% CP                 VOL1
x:\ net NWFS   113510Mb  57% CP                 VOL1
y:\ net NWFS   62723Mb  60% CP                 VOL1
z:\ net NWFS   62723Mb  60% CP                 VOL1

c:          /         native  text!=binary
\\.\a:      /dev/fd0  native  text!=binary
\\.\b:      /dev/fd1  native  text!=binary
\\.\tape0:  /dev/st0  native  text!=binary
\\.\tape1:  /dev/st1  native  text!=binary

Found: c:\cygnus\CYGWIN~1\H-I586~1\bin\bash.exe
Found: c:\cygnus\CYGWIN~1\H-I586~1\bin\cat.exe
Found: g:\archi\hansmay\sw\gnu.nt\cat.exe
Warning: c:\cygnus\CYGWIN~1\H-I586~1\bin\cat.exe hides
g:\archi\hansmay\sw\gnu.nt\cat.exe
Not Found: cpp (good!)
Found: c:\cygnus\CYGWIN~1\H-I586~1\bin\find.exe
Found: c:\cygnus\CYGWIN~1\H-I586~1\bin\gcc.exe
Found: g:\archi\hansmay\sw\gnu.nt\gcc.exe
Warning: c:\cygnus\CYGWIN~1\H-I586~1\bin\gcc.exe hides
g:\archi\hansmay\sw\gnu.nt\gcc.exe
Found: c:\cygnus\CYGWIN~1\H-I586~1\bin\gdb.exe
Found: c:\cygnus\CYGWIN~1\H-I586~1\bin\ld.exe
Found: c:\cygnus\CYGWIN~1\H-I586~1\bin\ls.exe
Found: g:\archi\hansmay\sw\gnu.nt\ls.exe
Warning: c:\cygnus\CYGWIN~1\H-I586~1\bin\ls.exe hides
g:\archi\hansmay\sw\gnu.nt\ls.exe
Found: c:\cygnus\CYGWIN~1\H-I586~1\bin\make.exe
Found: g:\archi\hansmay\sw\gnu.nt\make.exe
Warning: c:\cygnus\CYGWIN~1\H-I586~1\bin\make.exe hides
g:\archi\hansmay\sw\gnu.nt\make.exe
Found: c:\cygnus\CYGWIN~1\H-I586~1\bin\sh.exe

  446k 1998/12/03 C:\WINNT\System32\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=1998/12/4 5:39
  371k 1998/12/01 c:\cygnus\CYGWIN~1\H-I586~1\bin\cygtcl80.dll - os=4.0 img=1.0
sys=4.0
                  "cygtcl80.dll" v0.0 ts=1998/12/1 9:25
    5k 1998/12/01 c:\cygnus\CYGWIN~1\H-I586~1\bin\cygtclpip80.dll - os=4.0
img=1.0 sys=4.0
   10k 1998/12/01 c:\cygnus\CYGWIN~1\H-I586~1\bin\cygtclreg80.dll - os=4.0
img=1.0 sys=4.0
                  "cygtclreg80.dll" v0.0 ts=1998/12/1 9:25
  600k 1998/12/01 c:\cygnus\CYGWIN~1\H-I586~1\bin\cygtk80.dll - os=4.0 img=1.0
sys=4.0
                  "cygtk80.dll" v0.0 ts=1998/12/1 9:28
  451k 2000/03/03 c:\cygnus\CYGWIN~1\H-I586~1\bin\cygwin1-19990115.dll - os=4.0
img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=1999/1/16 6:09
  587k 2000/02/25 c:\cygnus\CYGWIN~1\H-I586~1\bin\cygwin1.200002.dll - os=4.0
img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2000/2/25 6:15
  446k 1998/12/03 c:\cygnus\CYGWIN~1\H-I586~1\bin\cygwin1.dll - os=4.0 img=1.0
sys=4.0
                  "cygwin1.dll" v0.0 ts=1998/12/4 5:39
Use -h to see help about each section
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]