search for: lock_ex

Displaying 20 results from an estimated 26 matches for "lock_ex".

1996 Nov 29
1
Denial of service.
There are conflicting reports about wether or not Red Hat 4.0 is vulnerable to the login-lockout described earlier. I have the impression that if you install the updates it will have been fixed. Approval of messages about this subject is now restricted to "here is a patch", and a vendors "We have made a patch available". Roger.
2008 Jan 25
1
Windows share modes and Linux file locking, flock & fcntl
...is 0x20, which is what LOCK_MAND is defined as in the samba-3.0.28 source in the file source/include/includes.h. This is the same value I find in /usr/include/bits/fcntl.h and /usr/include/asm/fcntl.h. So I wrote a test program (included below) that uses flock with this value (instad of the usual LOCK_EX) but multiple instances of this program couldn't even detect each other's locks. Nor did any windows client having the file open with any share mode have an effect. I also tried enabling mandatory locking with the mount option and the chmod bits, since the flag is called LOCK_MAND, but tha...
2003 Jul 24
1
does rsync lock exclusively files to copy?
...ygwin) and I've had other processes try to open the same files as rsync, but could not get through sometimes. Does rsync place a shared lock or an exclusive lock on the files it will copy from? I checked into the sources but did not find any use of flock() which could specify either LOCK_SH or LOCK_EX, so I'm not sure what the open() does when used with O_RDONLY. Any similar experiences? Haralabos N. Athanassiou BioInformatics Manager Automated Cell Inc -------------- next part -------------- A non-text attachment was scrubbed... Name: Haralabos N. Athanassiou.vcf Type: text/x-vcard Size:...
2003 Apr 05
1
flock a file in a NT server
...I suppose it is a matter of configuration of my clients but what should I use to get propper file locking? Windows machines lock without problems. Here it is a short verson of the test program I'm using: f=open("/mnt/smb/file",O_RDWR|O_CREAT|O_APPEND,S_IRUSR|S_IWUSR); if (flock(f, LOCK_EX)) { printf("Error locking"); exit; } printf("Text: "); scanf("%s",c); strcat(c,"\n"); write(f,c,strlen(c)); printf("Say something to quit: "); scanf("%s",c); if (flock(f, LOCK_UN)) { printf("Error unlocking"); exit; } clos...
1996 Nov 14
0
setgid binaries
...re is a patch which removes the locking. --- util-linux-2.6/login-utils/login.c.orig Thu Nov 7 06:26:15 1996 +++ util-linux-2.6/login-utils/login.c Fri Nov 29 16:12:24 1996 @@ -628,9 +628,10 @@ endutent(); if((wtmp = open(_PATH_WTMP, O_APPEND|O_WRONLY)) >= 0) { - flock(wtmp, LOCK_EX); +/* Locking wtmp allows for trivial denial of service attack by nvi */ +/* flock(wtmp, LOCK_EX); */ write(wtmp, (char *)&ut, sizeof(ut)); - flock(wtmp, LOCK_UN); +/* flock(wtmp, LOCK_UN); */ close(wtmp); } } [mod: WARNING: UNTESTED CODE, MANUALLY FABRI...
2012 Feb 17
1
Race Condition In PHP Session Handler
...s. At first it worked well and then user's started to experience a hung site. Upon some digging it appears that the PHP module is getting stuck in a race condition regarding the sessions file - [root at yannigan-orange fd]# strace -p 22607 Process 22607 attached - interrupt to quit flock(53, LOCK_EX^C <unfinished ...> where file handle 53 is ... lr-x------. 1 root root 64 Feb 17 15:24 52 -> /opt/informix/msg/en_us/0333/cli.iem lrwx------. 1 root root 64 Feb 17 15:24 53 -> /var/lib/php/session/sess_ulgsl9joplobb9o4fue3n2e1k0 l-wx------. 1 root root 64 Feb 17 15:24 6 -> pipe:[6...
2005 Dec 14
2
Panic: file mail-index-sync-ext.c: line 155 (get_ext_header): assertion failed
One of the mbox files on my server causes dovecot to assert. I've caught the assert in gdb and have attached the backtrace. Unfortunatly my binary isn't built with debugging symbols, so I'm not sure how helpful it will be. smtp:/var$ uname -a Linux smtp 2.6.14-2-686-smp #1 SMP Sat Nov 26 13:37:07 UTC 2005 i686 GNU/Linux smtp:/var$ cat /etc/debian_version 3.1 smtp:/var$ dpkg -p
2004 Jun 04
7
I''m ready to build 0.4.0 for Windows
Let me know when you''ve got the cvs repo labeled -- I''m already to go to build the 0.4.0 installer for Windows. Curt
2009 Dec 16
0
strange flock issues with glusterfs 3.0.0
...e had glusterfs up and running with 2.0.8 and it worked fine. we decided to upgrade to 3.0.0 and found out, that with linux 2.6.31.7 and glusterfs 3.0.0 and the kernel fuse module, the flock() does not seem to work, i.e. apache2 php session files distributed via glusterfs 3.0.0 make apache2 hang on LOCK_EX we reverted back to 2.0.8 and installed glusterfs-fuse 2.7.4 and everything is working fine again, as expected. is this a known bug? -- Mit freundlichen Gr??en, Florian Wiessner Smart Weblications GmbH Martinsberger Str. 1 D-95119 Naila fon.: +49 9282 9638 200 fax.: +49 9282 9638 205 24/7:...
2008 Dec 10
0
No subject
...lars protocol UPS driver $ Revision: 0.5 $ (2.2.2) writing error # cat /etc/nut/ups.conf [PRPC650] driver = powercom port = /dev/ttyUSB0 desc = "Test" Trying with strace shows the following: 12369 open("/dev/ttyUSB0", O_RDWR|O_EXCL|O_NOCTTY|O_NONBLOCK) = 4 12369 flock(4, LOCK_EX|LOCK_NB) = 0 12369 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B1200 -opost -isig -icanon -echo ...}) = 0 12369 ioctl(4, TCFLSH, 0) = 0 12369 ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, {B1200 -opost -isig -icanon -echo ...}) = 0 12369 ioctl(4, SNDCTL_TMR_START or TCSETS, {B1200 -opo...
2011 Jun 28
0
[nut-commits] svn commit r3081 - branches/apcsmart-dev/drivers
...h.debian.org>: > @@ -251,14 +251,14 @@ > if (do_lock_port) { > errno = 0; > ret = 0; > -#ifdef HAVE_UU_LOCK > + #ifdef HAVE_UU_LOCK > ret = uu_lock(xbasename(device_path)); > -#elif defined(HAVE_FLOCK) > + #elif defined(HAVE_FLOCK) > ret = flock(fd, LOCK_EX | LOCK_NB); > -#elif defined(HAVE_LOCKF) > + #elif defined(HAVE_LOCKF) > lseek(fd, 0L, SEEK_SET); > ret = lockf(fd, F_TLOCK, 0L); > -#endif > + #endif > if (ret < 0) > upslog_with_errno(LOG_ERR, "apc_ser_try: couldn't lock the port > (%s)&quot...
2006 Jan 11
0
how to force Samba respects file locking?
...s test: -- code -- #!/usr/bin/perl use strict; use warnings; use Fcntl qw(:DEFAULT :flock); my $sec = 30; print 'Please type the file that I should lock for $sec: '; my $file = <STDIN>; chomp $file; sysopen( FH, $file, O_RDWR ) or die "Cannot edit $file: $!\n"; flock( FH, LOCK_EX ) or die "Cannot lock $file: $!\n"; print 'Ok, holding the file for $sec seconds. I will not change anythingin the file', "\n"; sleep $sec; close(FH); print "Finished\n"; -- code -- Thanks in advance. Regards, Alceu Rodrigues de Freitas Junior ------...
2007 Jan 22
0
checking a locked file
...return 1; } f = open(argv[1], O_RDONLY); the_lock.l_type = F_WRLCK; the_lock.l_whence = SEEK_SET; the_lock.l_start = 0; the_lock.l_len = 0; if(f <= 0) { fprintf(stderr, "Cannot open file: %s\n", argv[1]); return 1; } fcntl(f, F_GETLK, &the_lock); retlck = flock(f, LOCK_EX | LOCK_NB); smblck = fcntl(f, F_GETLEASE, 0); fprintf(stdout, "smblck: %x\n", smblck); close(f); if((the_lock.l_type == F_UNLCK) && (retlck == 0)) { fprintf(stdout, "File is not locked\n"); } else { fprintf(stdout, "File is locked\n"); return 1; } return...
2005 Jul 10
1
VM Outcall: Rube Goldberg Edition
...uot; . $vm_box . ".call"; $call_file_name = "/var/spool/asterisk/outgoing/" . $vm_box . ".call"; if(!sysopen($call_file_handle, "$call_file_name", O_WRONLY|O_CREAT|O_EXCL)) { exit(0); } flock($call_file_handle, LOCK_EX); # Set the access and modification times to be 10 years in the future so # Asterisk will ignore this file while we are doing stuff with it. $long_time = time() + (10 * 365 * 24 * 60 * 60); utime($long_time, $long_time, "$call_file_name"); s...
2007 Jun 21
7
test program #2: mmaping
Attached another test program. I don't expect it to print any errors with any OS, but I'd like to confirm it for non-Linux SMP kernels. (Except for OpenBSD, it doesn't work correctly in it anyway because it doesn't support mixing write()s and mmap()) -------------- next part -------------- A non-text attachment was scrubbed... Name: concurrency.c Type: text/x-csrc Size: 2256
1998 Feb 04
0
An old ld-linux.so hole
...it, assuring practically 100% success ratio. Section V. Scenario 3. Let''s try to force a context switch immediately after spawn.c calls exec. spawn.c should open a file (called .lock ) receiving descriptor lock_fd and set a close-on-exec flag on it. Then spawn.c executes flock(lock_fd,LOCK_EX). Another program ( called noloop ) opens .lock and performs flock(noloop_fd,LOCK_EX) as well ( and goes to sleep). We also spawn a program called eat_time, which simply does for(;;);, generating some load on the machine. A great moment occures: spawn.c does execl("/usr/bin/passwd",long...
2004 Jul 19
2
locks cooperating with a server side process
...here I can gain the lock but the process is still writing to the file. Python code: import fcntl # open file in rw so I gain exclusive lock f = open("cygwin.tar","r+") # if this doesn't raise an IOError, the lock is acquired fcntl.lockf(f,fcntl.LOCK_EX|fcntl.LOCK_NB) which maps into a fcntl exclusive lock with 0 as the start, end, and whence arguments in the flock structure. In smb.conf, "locking = yes" had no effect on my process. The next thing I tried was "strict locking = yes". This had the effect that as soon as my co...
2003 Apr 20
0
How I got Samba 2.2.8a to run on OpenBSD 3.2 i386
...users!\n" if $?; for($newuid = 10000; $newuid < 32767; ++$newuid){ last if !getpwuid($newuid); } die "No free UID!\n" if ($newuid >= 32767); # doesn't happen open(MPW, ">> $master_passwd") or die "Can't open $master_passwd: $!\n"; flock(MPW, LOCK_EX) or die "Can't lock $master_passwd!\n"; print MPW "$newname:*:$newuid:32767::0:0::/dev/null:/sbin/nologin\n"; flock(MPW, LOCK_UN); close MPW; system($pwd_mkdb, '-p', '-u', $newname, $master_passwd); die "pwd_mkdb failed!" if $?; -------------- next...
2018 Aug 10
10
Call for testing: OpenSSH 7.8
Hi, OpenSSH 7.8p1 is almost ready for release, so we would appreciate testing on as many platforms and systems as possible. This is a bugfix release. Snapshot releases for portable OpenSSH are available from http://www.mindrot.org/openssh_snap/ The OpenBSD version is available in CVS HEAD: http://www.openbsd.org/anoncvs.html Portable OpenSSH is also available via git using the instructions at
2018 Oct 11
13
Call for testing: OpenSSH 7.9
Hi, OpenSSH 7.9p1 is almost ready for release, so we would appreciate testing on as many platforms and systems as possible. This is a bugfix release. Snapshot releases for portable OpenSSH are available from http://www.mindrot.org/openssh_snap/ The OpenBSD version is available in CVS HEAD: http://www.openbsd.org/anoncvs.html Portable OpenSSH is also available via git using the instructions at