From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.bugs Subject: bug#26126: 26.0.50; file-notify-rm-watch removes arbitrary watches Date: Sat, 25 Mar 2017 17:19:23 +0100 Message-ID: <87shm1fhx0.fsf@luca> References: <87r31x9ulw.fsf@luca> <87shmcney8.fsf@detlef> <87efxw7xvc.fsf@luca> <87mvcjophx.fsf@detlef> <87tw6rssoi.fsf@luca> <87pohfkmvh.fsf@detlef> <87lgs2sobr.fsf@luca> <87y3w2gywc.fsf@detlef> <8737e8excq.fsf@luca> <877f3el80j.fsf@luca> <87a889jvvw.fsf@detlef> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1490458830 28091 195.159.176.226 (25 Mar 2017 16:20:30 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 25 Mar 2017 16:20:30 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 26126@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 25 17:20:26 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1croQK-0005uc-J0 for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Mar 2017 17:20:17 +0100 Original-Received: from localhost ([::1]:37924 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1croQQ-00019C-DP for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Mar 2017 12:20:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50263) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1croQB-00015w-VG for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 12:20:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1croQ6-0005Hd-W7 for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 12:20:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46297) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1croQ6-0005HZ-KU for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 12:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1croQ6-0006sQ-Ax for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 12:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Politz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Mar 2017 16:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26126 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26126-submit@debbugs.gnu.org id=B26126.149045878726406 (code B ref 26126); Sat, 25 Mar 2017 16:20:02 +0000 Original-Received: (at 26126) by debbugs.gnu.org; 25 Mar 2017 16:19:47 +0000 Original-Received: from localhost ([127.0.0.1]:44496 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1croPq-0006rp-OC for submit@debbugs.gnu.org; Sat, 25 Mar 2017 12:19:46 -0400 Original-Received: from gateway-a.fh-trier.de ([143.93.54.181]:39671) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1croPn-0006rZ-Kq for 26126@debbugs.gnu.org; Sat, 25 Mar 2017 12:19:45 -0400 X-Virus-Scanned: by Amavisd-new + McAfee uvscan + ClamAV [Rechenzentrum Hochschule Trier (RZ/HT)] Original-Received: from localhost (ip5f5bdecf.dynamic.kabel-deutschland.de [95.91.222.207]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: politza) by gateway-a.fh-trier.de (Postfix) with ESMTPSA id D999C179B521; Sat, 25 Mar 2017 17:19:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=hochschule-trier.de; s=default; t=1490458764; bh=ZuuaH8Eg7A51SBftFjtczmBzvr0=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=DXocsMqpQveVnSLbkwPJhmQ4noPORDvAHP33ClEiCmcfYtZkSvjmjpNz61Ao6k06N nq2nOGOCyqojbcwGB9ko5b5yRO1IvYgtGlw8zuygdeMIkpRur7cHlXomn6KR22PTeP bwGCspWf0gsk8wjv8rsVrg9WE4HKWFKZTIi6Afiw= In-Reply-To: <87a889jvvw.fsf@detlef> (Michael Albinus's message of "Sat, 25 Mar 2017 15:04:03 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130935 Archived-At: --=-=-= Content-Type: text/plain Michael Albinus writes: > Andreas Politz writes: >> + further simplify filenotify.el nor >> >> + handle differing masks in inotify.c . > > Thanks for this. Next time you provide a patch, could you pls merge > emacs recent changes from master first? Your patch was rejected partly, > and I had to apply rejected hunks manually. Comments: Sorry, I forgot to pull. Anyway, here is the more progressive version of the patch, adding both of the above points. (I guess, I'm to conservative sometimes and/or seeing only problems everywhere.) >> +;; * "inotify_add_watch adds a new watch, or modifies an existing watch" >> +;; We need to make sure that different watches for the same directory >> +;; don't set the mask in a conflicting way regarding changed/attribute-changed >> +;; * Also check which other inotify flags are problematic >> +;; for concurrent use of the underlying descriptor > > Well, I had always the hope to modify inotify watches in this case. If > there is a watch with flags f1, and a new watch for the same file is > requested with flags f2, and f2 contains a flag which is not part of f1, > then either the existing watch shall be adapted, or the existing watch > shall be removed, and a new shall be installed. Don't know what's > possible in inotify. I implemented it by always using constantly watching for all events (IN_ALL_EVENTS) and storing the given user-flags with the callback etc. When an event occurs, I check whether it matches the given mask. For that to work, I had to restrict the flag-usage by the user to those not having an effect on the shared descriptor. I also added IN_EXCL_UNLINK as a default. This avoids reporting events for already deleted filenames, which are still opened by some process, which seems what we want as a default. > Your changes look good; "make -C test filenotify-tests > SELECTOR='$(SELECTOR_DEFAULT)'" passes all tests. Even if there is room > for improvement I believe you could push your patch to master now, in > order to get feedback from other developers. I ran the non-expensive tests for inotify, kqueue and they succeeded. I have no push privileges. --=-=-= Content-Type: test/x-patch Content-Disposition: inline Content-Transfer-Encoding: base64 Content-Description: Draft 3 ZGlmZiAtLWdpdCBhL2xpc3AvZmlsZW5vdGlmeS5lbCBiL2xpc3AvZmlsZW5vdGlmeS5lbAppbmRl eCA4MGU5Zjg5OGIyLi4wZjhjOTQ1YTc5IDEwMDY0NAotLS0gYS9saXNwL2ZpbGVub3RpZnkuZWwK KysrIGIvbGlzcC9maWxlbm90aWZ5LmVsCkBAIC00MCw0MSArNDAsNDIgQEAgZmlsZS1ub3RpZnkt LWxpYnJhcnkKIHRvIGJlIHVzZWQgZm9yIGxvY2FsIGZpbGUgc3lzdGVtcy4gIFJlbW90ZSBmaWxl IG5vdGlmaWNhdGlvbnMKIGNvdWxkIHVzZSBhbm90aGVyIGltcGxlbWVudGF0aW9uLiIpCiAKKyhj bC1kZWZzdHJ1Y3QgKGZpbGUtbm90aWZ5LS13YXRjaAorICAgICAgICAgICAgICAgKDpjb25zdHJ1 Y3RvciBuaWwpCisgICAgICAgICAgIC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KG51bGwgZmlsZS1ub3Rp ZnktLXBlbmRpbmctZXZlbnQpCi0JCSAgICAnY3JlYXRlZAotCQkgIChzZXRxIGZpbGUxIGZpbGUK LQkJCWZpbGUgKGZpbGUtbm90aWZ5LS1ldmVudC1maWxlLW5hbWUKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIChjYXIgZmlsZS1ub3RpZnktLXBlbmRpbmctZXZlbnQpKSkKLSAgICAgICAg ICAgICAgICAgIDs7IElmIHRoZSBzb3VyY2UgaXMgaGFuZGxlZCBieSBhbm90aGVyIHdhdGNoLCB3 ZQotICAgICAgICAgICAgICAgICAgOzsgbXVzdCBmaXJlIHRoZSByZW5hbWUgZXZlbnQgdGhlcmUg YXMgd2VsbC4KLSAgICAgICAgICAgICAgICAgICh3aGVuIChub3QgKGVxdWFsIChmaWxlLW5vdGlm eS0tZGVzY3JpcHRvciBkZXNjIGZpbGUxKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgKGZpbGUtbm90aWZ5LS1kZXNjcmlwdG9yCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKGNhYXIgZmlsZS1ub3RpZnktLXBlbmRpbmctZXZlbnQpCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZpbGUtbm90aWZ5LS1ldmVudC1maWxlLW5hbWUK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsZS1ub3RpZnktLXBlbmRp bmctZXZlbnQpKSkpCi0gICAgICAgICAgICAgICAgICAgIChzZXRxIHBlbmRpbmctZXZlbnQKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgYCgoLChjYWFyIGZpbGUtbm90aWZ5LS1wZW5kaW5nLWV2 ZW50KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW5hbWVkICxmaWxlICxmaWxlMSkK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAsKGNhZHIgZmlsZS1ub3RpZnktLXBlbmR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Fja3VwLWZpbGUtbmFtZS1wIGZpbGUxKSkpCi0gICAgICAgICAgICAgICAgICAgICAgIDs7 IFdhdGNoZWQgZmlsZSBvciBkaXJlY3RvcnkgaXMgY29uY2VybmVkLgotICAgICAgICAgICAgICAg ICAgICAgICAoc3RyaW5nLWVxdWFsCi0gICAgICAgICAgICAgICAgICAgICAgICBmaWxlIChmaWxl LW5vdGlmeS0tZXZlbnQtd2F0Y2hlZC1maWxlIGV2ZW50KSkpKQotICAgICAgICAgIChmaWxlLW5v dGlmeS1ybS13YXRjaCAoZmlsZS1ub3RpZnktLWRlc2NyaXB0b3IgZGVzYyAoY2FyIGVudHJ5KSkp KSkpKSkKKyAgICAgICh3aGlsZSBhY3Rpb25zCisgICAgICAgIChsZXQgKChhY3Rpb24gKHBvcCBh Y3Rpb25zKSkpCisgICAgICAgICAgOzsgU2VuZCBwZW5kaW5nIGV2ZW50LCBpZiBpdCBkb2Vzbid0 IG1hdGNoLgorICAgICAgICAgICh3aGVuIChhbmQgZmlsZS1ub3RpZnktLXBlbmRpbmctZXZlbnQK KyAgICAgICAgICAgICAgICAgICAgIDs7IFRoZSBjb29raWUgZG9lc24ndCBtYXRjaC4KKyAgICAg ICAgICAgICAgICAgICAgIChub3QgKGVxIChmaWxlLW5vdGlmeS0tZXZlbnQtY29va2llCisgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNhciBmaWxlLW5vdGlmeS0tcGVuZGluZy1ldmVu dCkpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmlsZS1ub3RpZnktLWV2ZW50LWNv b2tpZSBldmVudCkpKQorICAgICAgICAgICAgICAgICAgICAgKG9yCisgICAgICAgICAgICAgICAg ICAgICAgOzsgaW5vdGlmeS4KKyAgICAgICAgICAgICAgICAgICAgICAoYW5kIChlcSAobnRoIDEg KGNhciBmaWxlLW5vdGlmeS0tcGVuZGluZy1ldmVudCkpCisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgJ21vdmVkLWZyb20pCisgICAgICAgICAgICAgICAgICAgICAgICAgICAobm90IChl cSBhY3Rpb24gJ21vdmVkLXRvKSkpCisgICAgICAgICAgICAgICAgICAgICAgOzsgdzMybm90aWZ5 LgorICAgICAgICAgICAgICAgICAgICAgIChhbmQgKGVxIChudGggMSAoY2FyIGZpbGUtbm90aWZ5 LS1wZW5kaW5nLWV2ZW50KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAncmVuYW1l ZC1mcm9tKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgKG5vdCAoZXEgYWN0aW9uICdyZW5h bWVkLXRvKSkpKSkKKyAgICAgICAgICAgIChzZXRxIHBlbmRpbmctZXZlbnQgZmlsZS1ub3RpZnkt LXBlbmRpbmctZXZlbnQKKyAgICAgICAgICAgICAgICAgIGZpbGUtbm90aWZ5LS1wZW5kaW5nLWV2 ZW50IG5pbCkKKyAgICAgICAgICAgIChzZXRjYXIgKGNkYXIgcGVuZGluZy1ldmVudCkgJ2RlbGV0 ZWQpKQorCisgICAgICAgICAgOzsgTWFwIGFjdGlvbi4gIFdlIGlnbm9yZSBhbGwgZXZlbnRzIHdo aWNoIGNhbm5vdCBiZSBtYXBwZWQuCisgICAgICAgICAgKHNldHEgYWN0aW9uCisgICAgICAgICAg ICAgICAgKGNvbmQKKyAgICAgICAgICAgICAgICAgKChtZW1xIGFjdGlvbgorICAgICAgICAgICAg ICAgICAgICAgICAgJyhhdHRyaWJ1dGUtY2hhbmdlZCBjaGFuZ2VkIGNyZWF0ZWQgZGVsZXRlZCBy ZW5hbWVkKSkKKyAgICAgICAgICAgICAgICAgIGFjdGlvbikKKyAgICAgICAgICAgICAgICAgKCht ZW1xIGFjdGlvbiAnKG1vdmVkIHJlbmFtZSkpCisgICAgICAgICAgICAgICAgICA7OyBUaGUga3F1 ZXVlIHJlbmFtZSBldmVudCBkb2VzIG5vdCByZXR1cm4gZmlsZTEgaW4KKyAgICAgICAgICAgICAg ICAgIDs7IGNhc2UgYSBmaWxlIG1vbml0b3IgaXMgZXN0YWJsaXNoZWQuCisgICAgICAgICAgICAg ICAgICAoaWYgKHNldHEgZmlsZTEgKGZpbGUtbm90aWZ5LS1ldmVudC1maWxlMS1uYW1lIGV2ZW50 KSkKKyAgICAgICAgICAgICAgICAgICAgICAncmVuYW1lZCAnZGVsZXRlZCkpCisgICAgICAgICAg ICAgICAgICgoZXEgYWN0aW9uICdpZ25vcmVkKQorICAgICAgICAgICAgICAgICAgKHNldHEgc3Rv cHBlZCB0IGFjdGlvbnMgbmlsKSkKKyAgICAgICAgICAgICAgICAgKChtZW1xIGFjdGlvbiAnKGF0 dHJpYiBsaW5rKSkgJ2F0dHJpYnV0ZS1jaGFuZ2VkKQorICAgICAgICAgICAgICAgICAoKG1lbXEg YWN0aW9uICcoY3JlYXRlIGFkZGVkKSkgJ2NyZWF0ZWQpCisgICAgICAgICAgICAgICAgICgobWVt cSBhY3Rpb24gJyhtb2RpZnkgbW9kaWZpZWQgd3JpdGUpKSAnY2hhbmdlZCkKKyAgICAgICAgICAg ICAgICAgKChtZW1xIGFjdGlvbiAnKGRlbGV0ZSBkZWxldGUtc2VsZiBtb3ZlLXNlbGYgcmVtb3Zl ZCkpICdkZWxldGVkKQorICAgICAgICAgICAgICAgICA7OyBNYWtlIHRoZSBldmVudCBwZW5kaW5n LgorICAgICAgICAgICAgICAgICAoKG1lbXEgYWN0aW9uICcobW92ZWQtZnJvbSByZW5hbWVkLWZy b20pKQorICAgICAgICAgICAgICAgICAgKHNldHEgZmlsZS1ub3RpZnktLXBlbmRpbmctZXZlbnQK KyAgICAgICAgICAgICAgICAgICAgICAgIGAoKCxkZXNjICxhY3Rpb24gLGZpbGUgLChmaWxlLW5v dGlmeS0tZXZlbnQtY29va2llIGV2ZW50KSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgLChm aWxlLW5vdGlmeS0td2F0Y2gtY2FsbGJhY2sgd2F0Y2gpKSkKKyAgICAgICAgICAgICAgICAgIG5p bCkKKyAgICAgICAgICAgICAgICAgOzsgTG9vayBmb3IgcGVuZGluZyBldmVudC4KKyAgICAgICAg ICAgICAgICAgKChtZW1xIGFjdGlvbiAnKG1vdmVkLXRvIHJlbmFtZWQtdG8pKQorICAgICAgICAg ICAgICAgICAgKGlmIChudWxsIGZpbGUtbm90aWZ5LS1wZW5kaW5nLWV2ZW50KQorICAgICAgICAg ICAgICAgICAgICAgICdjcmVhdGVkCisgICAgICAgICAgICAgICAgICAgIChzZXRxIGZpbGUxIGZp bGUKKyAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsZSAoZmlsZS1ub3RpZnktLWV2ZW50LWZp bGUtbmFtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY2FyIGZpbGUtbm90aWZ5 LS1wZW5kaW5nLWV2ZW50KSkpCisgICAgICAgICAgICAgICAgICAgIDs7IElmIHRoZSBzb3VyY2Ug aXMgaGFuZGxlZCBieSBhbm90aGVyIHdhdGNoLCB3ZQorICAgICAgICAgICAgICAgICAgICA7OyBt dXN0IGZpcmUgdGhlIHJlbmFtZSBldmVudCB0aGVyZSBhcyB3ZWxsLgorICAgICAgICAgICAgICAg ICAgICAod2hlbiAobm90IChlcXVhbCBkZXNjIChjYWFyIGZpbGUtbm90aWZ5LS1wZW5kaW5nLWV2 ZW50KSkpCisgICAgICAgICAgICAgICAgICAgICAgKHNldHEgcGVuZGluZy1ldmVudAorICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGAoKCwoY2FhciBmaWxlLW5vdGlmeS0tcGVuZGluZy1ldmVu dCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZW5hbWVkICxmaWxlICxmaWxlMSkK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICwoY2FkciBmaWxlLW5vdGlmeS0tcGVuZGlu Zy1ldmVudCkpKSkKKyAgICAgICAgICAgICAgICAgICAgKHNldHEgZmlsZS1ub3RpZnktLXBlbmRp bmctZXZlbnQgbmlsKQorICAgICAgICAgICAgICAgICAgICAncmVuYW1lZCkpKSkKKworICAgICAg ICAgIDs7IEFwcGx5IHBlbmRpbmcgY2FsbGJhY2suCisgICAgICAgICAgKHdoZW4gcGVuZGluZy1l dmVudAorICAgICAgICAgICAgKHNldGNhcgorICAgICAgICAgICAgIChjYXIgcGVuZGluZy1ldmVu dCkKKyAgICAgICAgICAgICAoY2FhciBwZW5kaW5nLWV2ZW50KSkKKyAgICAgICAgICAgIChmdW5j YWxsIChjYWRyIHBlbmRpbmctZXZlbnQpIChjYXIgcGVuZGluZy1ldmVudCkpCisgICAgICAgICAg ICAoc2V0cSBwZW5kaW5nLWV2ZW50IG5pbCkpCisKKyAgICAgICAgICA7OyBBcHBseSBjYWxsYmFj ay4KKyAgICAgICAgICAod2hlbiAoYW5kIGFjdGlvbgorICAgICAgICAgICAgICAgICAgICAgKG9y CisgICAgICAgICAgICAgICAgICAgICAgOzsgSWYgdGhlcmUgaXMgbm8gcmVsYXRpdmUgZmlsZSBu YW1lIGZvciB0aGF0IHdhdGNoLAorICAgICAgICAgICAgICAgICAgICAgIDs7IHdlIHdhdGNoIHRo ZSB3aG9sZSBkaXJlY3RvcnkuCisgICAgICAgICAgICAgICAgICAgICAgKG51bGwgKGZpbGUtbm90 aWZ5LS13YXRjaC1maWxlbmFtZSB3YXRjaCkpCisgICAgICAgICAgICAgICAgICAgICAgOzsgRmls ZSBtYXRjaGVzLgorICAgICAgICAgICAgICAgICAgICAgIChzdHJpbmctZXF1YWwKKyAgICAgICAg ICAgICAgICAgICAgICAgKGZpbGUtbm90aWZ5LS13YXRjaC1maWxlbmFtZSB3YXRjaCkKKyAgICAg ICAgICAgICAgICAgICAgICAgKGZpbGUtbmFtZS1ub25kaXJlY3RvcnkgZmlsZSkpCisgICAgICAg ICAgICAgICAgICAgICAgOzsgRGlyZWN0b3J5IG1hdGNoZXMuCisgICAgICAgICAgICAgICAgICAg ICAgKHN0cmluZy1lcXVhbAorICAgICAgICAgICAgICAgICAgICAgICAoZmlsZS1uYW1lLW5vbmRp cmVjdG9yeSBmaWxlKQorICAgICAgICAgICAgICAgICAgICAgICAoZmlsZS1uYW1lLW5vbmRpcmVj dG9yeQorICAgICAgICAgICAgICAgICAgICAgICAgKGZpbGUtbm90aWZ5LS13YXRjaC1kaXJlY3Rv cnkgd2F0Y2gpKSkKKyAgICAgICAgICAgICAgICAgICAgICA7OyBGaWxlMSBtYXRjaGVzLgorICAg ICAgICAgICAgICAgICAgICAgIChhbmQgKHN0cmluZ3AgZmlsZTEpCisgICAgICAgICAgICAgICAg ICAgICAgICAgICAoc3RyaW5nLWVxdWFsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZp bGUtbm90aWZ5LS13YXRjaC1maWxlbmFtZSB3YXRjaCkKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoZmlsZS1uYW1lLW5vbmRpcmVjdG9yeSBmaWxlMSkpKSkpCisgICAgICAgICAgICA7Oyht ZXNzYWdlCisgICAgICAgICAgICA7OyJmaWxlLW5vdGlmeS1jYWxsYmFjayAlUyAlUyAlUyAlUyAl UyIKKyAgICAgICAgICAgIDs7ZGVzYworICAgICAgICAgICAgOzthY3Rpb24gZmlsZSBmaWxlMSB3 YXRjaCkKKyAgICAgICAgICAgIChpZiBmaWxlMQorICAgICAgICAgICAgICAgIChmdW5jYWxsIChm aWxlLW5vdGlmeS0td2F0Y2gtY2FsbGJhY2sgd2F0Y2gpCisgICAgICAgICAgICAgICAgICAgICAg ICAgYCgsZGVzYyAsYWN0aW9uICxmaWxlICxmaWxlMSkpCisgICAgICAgICAgICAgIChmdW5jYWxs IChmaWxlLW5vdGlmeS0td2F0Y2gtY2FsbGJhY2sgd2F0Y2gpCisgICAgICAgICAgICAgICAgICAg ICAgIGAoLGRlc2MgICxhY3Rpb24gLGZpbGUpKSkpCisKKyAgICAgICAgICA7OyBTZW5kIGBzdG9w cGVkJyBldmVudC4KKyAgICAgICAgICAod2hlbiAob3Igc3RvcHBlZAorICAgICAgICAgICAgICAg ICAgICAoYW5kICh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5bWFzayAoYXNwZWN0KTsKIH0KIAorc3Rh dGljIExpc3BfT2JqZWN0CittYWtlX2xpc3B5X21hc2sgKHVpbnQzMl90IG1hc2spCit7CisgIHJl dHVybiBGY29ucyAobWFrZV9udW1iZXIgKG1hc2sgJiAweGZmZmYpLAorICAgICAgICAgICAgICAg IG1ha2VfbnVtYmVyIChtYXNrID4+IDE2KSk7Cit9CisKK3N0YXRpYyBib29sCitsaXNweV9tYXNr X21hdGNoX3AgKExpc3BfT2JqZWN0IG1hc2ssIHVpbnQzMl90IG90aGVyKQoreworICByZXR1cm4g KFhJTlQgKFhDQVIgKG1hc2spKSAmIG90aGVyKQorICAgIHx8ICgoWElOVCAoWENEUiAobWFzaykp IDw8IDE2KSAmIG90aGVyKTsKK30KKworc3RhdGljIExpc3BfT2JqZWN0Citpbm90aWZ5ZXZlbnRf dG9fZXZlbnQgKExpc3BfT2JqZWN0IHdhdGNoLCBzdHJ1Y3QgaW5vdGlmeV9ldmVudCBjb25zdCAq ZXYpCit7CisgIExpc3BfT2JqZWN0IG5hbWUgPSBRbmlsOworCisgIGlmICghIGxpc3B5X21hc2tf bWF0Y2hfcCAoRm50aCAobWFrZV9udW1iZXIgKDMpLCB3YXRjaCksIGV2LT5tYXNrKSkKKyAgICBy ZXR1cm4gUW5pbDsKKworICBpZiAoZXYtPmxlbiA+IDApCisgICAgeworICAgICAgc2l6ZV90IGNv bnN0IGxlbiA9IHN0cmxlbiAoZXYtPm5hbWUpOworICAgICAgbmFtZSA9IG1ha2VfdW5pYnl0ZV9z dHJpbmcgKGV2LT5uYW1lLCBtaW4gKGxlbiwgZXYtPmxlbikpOworICAgICAgbmFtZSA9IERFQ09E RV9GSUxFIChuYW1lKTsKKyAgICB9CisgIGVsc2UKKyAgICBuYW1lID0gWENBUiAoWENEUiAod2F0 Y2gpKTsKKworICByZXR1cm4gbGlzdDIgKGxpc3Q0IChGY29ucyAobWFrZV9udW1iZXIgKGV2LT53 ZCksIFhDQVIgKHdhdGNoK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KKyAgICAgIExpc3BfT2JqZWN0IGVsdCA9IEZhc3NvYyAoZGVzY3JpcHRvciwg d2F0Y2hfbGlzdCk7CisKKyAgICAgIGlmICghIE5JTFAgKGVsdCkpCisgICAgICAgIHsKKyAgICAg ICAgICBMaXNwX09iamVjdCB3YXRjaGVzID0gWENEUiAoZWx0KTsKKyAgICAgICAgICB3aGlsZSAo ISBOSUxQICh3YXRjaGVzKSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgZXZlbnQuYXJn ID0gaW5vdGlmeWV2ZW50X3RvX2V2ZW50IChYQ0FSICh3YXRjaGVzKSwgZXYpOworICAgICAgICAg ICAgICBpZiAoIU5JTFAgKGV2ZW50LmFyZykpCisgICAgICAgICAgICAgICAga2JkX2J1ZmZlcl9z dG9yZV9ldmVudCAoJmV2ZW50KTsKKyAgICAgICAgICAgICAgd2F0Y2hlcyA9IFhDRFIgKHdhdGNo ZXMpOworICAgICAgICAgICAgfQorICAgICAgICAgIC8qIElmIGV2ZW50IHdhcyByZW1vdmVkIGF1 dG9tYXRpY2FsbHk6IERyb3AgaXQgZnJvbSB3YXRjaCBsaXN0LiAgKi8KKyAgICAgICAgICBpZiAo ZXYtPm1hc2sgJiBJTl9JR05PUkVEKQorICAgICAgICAgICAgcmVtb3ZlX2Rlc2NyaXB0b3IgKGRl c2NyaXB0b3IsIHRydWUpOworICAgICAgICB9CisgICAgICBpICs9IHNpemVvZiAoKmV2KSArIGV2 LT5sZW47CisgICAgfQorCisgIHhmcmVlIChidWZmZXIpOworfQorCiBERUZVTiAoImlub3RpZnkt YWRkLXdhdGNoIiwgRmlub3RpZnlfYWRkX3dhdGNoLCBTaW5vdGlmeV9hZGRfd2F0Y2gsIDMsIDMs IDAsCiAgICAgICAgZG9jOiAvKiBBZGQgYSB3YXRjaCBmb3IgRklMRS1OQU1FIHRvIGlub3RpZnku CiAKQEAgLTI2NCwxMCArMzYwLDYgQEAgY2xvc2UKIFRoZSBmb2xsb3dpbmcgc3ltYm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HN5bXNfb2ZfaW5vdGlmeSAodm9p ZCkKICAgREVGU1lNIChRY2xvc2UsICJjbG9zZSIpOwkJLyogSU5fQ0xPU0UgKi8KIAogICBERUZT WU0gKFFkb250X2ZvbGxvdywgImRvbnQtZm9sbG93Iik7CS8qIElOX0RPTlRfRk9MTE9XICovCi0g IERFRlNZTSAoUWV4Y2xfdW5saW5rLCAiZXhjbC11bmxpbmsiKTsJLyogSU5fRVhDTF9VTkxJTksg Ki8KLSAgREVGU1lNIChRbWFza19hZGQsICJtYXNrLWFkZCIpOwkvKiBJTl9NQVNLX0FERCAqLwot ICBERUZTWU0gKFFvbmVzaG90LCAib25lc2hvdCIpOwkJLyogSU5fT05FU0hPVCAqLwotICBERUZT WU0gKFFvbmx5ZGlyLCAib25seWRpciIpOwkJLyogSU5fT05MWURJUiAqLwogCiAgIERFRlNZTSAo UWlnbm9yZWQsICJpZ25vcmVkIik7CQkvKiBJTl9JR05PUkVEICovCiAgIERFRlNZTSAoUWlzZGly LCAiaXNkaXIiKTsJCS8qIElOX0lTRElSICovCkBAIC00MTQsNiArNTA2LDEwIEBAIHN5bXNfb2Zf aW5vdGlmeSAodm9pZCkKICAgZGVmc3ViciAoJlNpbm90aWZ5X3JtX3dhdGNoKTsKICAgZGVmc3Vi ciAoJlNpbm90aWZ5X3ZhbGlkX3ApOwogCisjaWZkZWYgSU5PVElGWV9ERUJVRworICBkZWZzdWJy ICgmU2lub3RpZnlfd2F0Y2hfbGlzdCk7CisgIGRlZnN1YnIgKCZTaW5vdGlmeV9hbGxvY2F0ZWRf cCk7CisjZW5kaWYKICAgc3RhdGljcHJvICgmd2F0Y2hfbGlzdCk7CiAKICAgRnByb3ZpZGUgKGlu dGVybl9jX3N0cmluZyAoImlub3RpZnkiKSwgUW5pbCk7Cg== --=-=-= Content-Type: text/plain -ap --=-=-=--