sed -i psuje uprawnienia do modyfikowanych plików
Arkadiusz Patyk
areq w pld-linux.org
Nie, 4 Lip 2004, 16:11:46 CEST
On Sun, 04 Jul 2004 15:21:20 +0200, you wrote:
>On Sun, 04 Jul 2004 15:12:47 +0200, you wrote:
>
>>witam
>>
>>[areq w gw tmp]$ cat > test.txt
>>aaaa
>>bbbb
>>cccc
>>dddd
>>[areq w gw tmp]$ chmod +x test.txt
>>[areq w gw tmp]$ ls -al test.txt
>>-rwx------ 1 areq admin 20 2004-07-04 15:05 test.txt
>>[areq w gw tmp]$ sed -i -e '/bbbb/d' test.txt
>>[areq w gw tmp]$ ls -al test.txt
>>-rw------- 1 areq admin 15 2004-07-04 15:06 test.txt
>>
>>sprawdzone na sed-4.1-1 i sed-4.1-2
>>Tak ma być ? IMHO nie.
>
>starce:
>open("test.txt", O_RDONLY|O_LARGEFILE) = 3
>gettimeofday({1088947026, 329070}, NULL) = 0
>getpid() = 7278
>open("./sedWa2sWB", O_RDWR|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = 4
>fcntl64(4, F_GETFL) = 0x8002 (flags
>O_RDWR|O_LARGEFILE)
>fstat64(4, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0
>mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
>0) = 0xb7eba000
>_llseek(4, 0, [0], SEEK_CUR) = 0
>fstat64(3, {st_mode=S_IFREG|0600, st_size=10, ...}) = 0
>fchmod(125864, 0100600) = -1 EBADF (Bad file
>descriptor)
>fchown32(125864, 500, 2000) = -1 EBADF (Bad file
>descriptor)
>fchown32(125864, -1, 2000) = -1 EBADF (Bad file
>descriptor)
>fstat64(3, {st_mode=S_IFREG|0600, st_size=10, ...}) = 0
>mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
>0) = 0xb7eb9000
>read(3, "aaaa\ndddd\n", 4096) = 10
>write(4, "dddd\n", 5) = 5
>read(3, "", 4096) = 0
>close(3) = 0
>munmap(0xb7eb9000, 4096) = 0
>close(4) = 0
>munmap(0xb7eba000, 4096) = 0
>rename("./sedWa2sWB", "test.txt") = 0
>close(1) = 0
>close(2) = 0
>exit_group(0) = ?
ok, poprawiłem
http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/sed-permissions.patch
--
Arkadiusz Patyk [areq(at)pld-linux.org] [http://rescuecd.pld-linux.org/]
[IRC:areq ICQ:16231667 GG:1383] [AP3-6BONE] [AP14126-RIPE]
Więcej informacji o liście dyskusyjnej pld-devel-pl