ときどきの雑記帖 RE* (新南口)
東京ワッショイ
彼は、艦隊が直面する現実をあけすけな表現で要約した。「はっきりしているのは、我々の夏は過ぎ去ってしまったということなのだ。秋と冬に耐える覚悟を固め給え。以上だ」/ゴドフリード・ハイエ中将 外伝第一巻「戦艦ヒンデンブルグの最期」
— レッドサンブラッククロスbot (@RSBC_bot) July 18, 2021
infra
へー、向こう(ってどこですか)でも Infrastructure を Infraって略したりするんだ。
Andrew Clay Shafer walks through the progression of ‘Infrastructure as Code’ in theory and practice, some problems these developments solved and also some problems they revealed.
infraの意味・使い方・読み方|英辞郎 on the WEB
16年間潜んでいたプリンタドライバの脆弱性が明らかに 影響は数百万台に登る可能性 - ITmedia エンタープライズ
共通した何かのバグで、だから三つのメーカーの名前が出てるんだろうけどなぜこの三つ? (HPとサムスンはわからないでもないけど、Xeroxは?)
16年間にわたって、HPとSamsung、Xeroxのプリンタソフトウェアに深刻度の高い脆弱性が存在していたことが明らかになった。 何百万台ものプリンタがこの脆弱性の影響を受けると考えられており注意が必要だ。
んで、どんなバグなのよと追いかけると
HP patches vulnerable driver lurking in printers for 16 years | ZDNet
The vulnerable function in the driver is the acceptance of data without size parameter validation, allowing attackers to overrun the driver’s buffer theoretically.
A potential buffer overflow in the software drivers for certain HP LaserJet products and Samsung product printers could lead to an escalation of privilege.
CWE-120 Buffer Copy without Checking Size of Input (‘Classic Buffer Overflow’)
…なんだかなあ(肩透かしを食らった気分)。
env (GNU coreutilsの)
ふと
GNU Coreutilsのマニュアル
を見ていたら、Coreutilsのenvもオプション指定で -
を受け付けることに気がついた。
‘-’
‘-i’
‘–ignore-environment’Start with an empty environment, ignoring the inherited environment.
え、じゃあ単独の-
のハンドリングはどうやっているのかと思ってソースを見たら
coreutils/env.c at master · coreutils/coreutils
while ((optc = getopt_long (argc, argv, shortopts, longopts, NULL)) != -1)
{
switch (optc)
{
case 'i':
ignore_environment = true;
break;
case 'u':
のループを抜けたあとにこんなコードが。
if (optind < argc && STREQ (argv[optind], "-"))
{
ignore_environment = true;
++optind;
}
なるほど。
しっかしGNUのコマンドの常ではあるのだろうけどオプション豊富だねえ。
glob zsh 7
zshのソースディレクトリをみると、いくつかawkのファイルがある。
- zsh/signames1.awk at master · zsh-users/zsh
- zsh/signames2.awk at master · zsh-users/zsh
- zsh/makepro.awk at master · zsh-users/zsh
んで、その中の zsh/signames1.awk at master · zsh-users/zsh をみたら
Tanaka Akira Initial revision
akrさんのお名前が。
それはまあさておき、 zsh/makepro.awk at master · zsh-users/zsh の中身を見ると
#
# makepro.awk - generate prototype lists
#
BEGIN {
aborting = 0
# arg 1 is the name of the file to process
# arg 2 is the name of the subdirectory it is in
if(ARGC != 3) {
aborting = 1
exit 1
}
name = ARGV[1]
gsub(/^.*\//, "", name)
gsub(/\.c$/, "", name)
name = ARGV[2] "_" name
gsub(/\//, "_", name)
ARGC--
printf "E#ifndef have_%s_globals\n", name
printf "E#define have_%s_globals\n", name
printf "E\n"
}
# all relevant declarations are preceded by "/**/" on a line by itself
/^\/\*\*\/$/ {
# The declaration is on following lines. The interesting part might
# be terminated by a `{' (`int foo(void) { }' or `int bar[] = {')
# or `;' (`int x;').
line = ""
isfunc = 0
while(1) {
if(getline <= 0) {
aborting = 1
exit 1
}
if (line == "" && $0 ~ /^[ \t]*#/) {
# Directly after the /**/ was a preprocessor line.
# Spit it out and re-start the outer loop.
printf "E%s\n", $0
printf "L%s\n", $0
next
}
gsub(/\t/, " ")
line = line " " $0
gsub(/\/\*([^*]|\*+[^*\/])*\*+\//, " ", line)
if(line ~ /\/\*/)
continue
# If it is a function definition, note so.
if(line ~ /\) *(VA_DCL )*[{].*$/) #}
isfunc = 1
if(sub(/ *[{;].*$/, "", line)) #}
break
}
if (!match(line, /VA_ALIST/)) {
縦にも横にも長いのでこの辺でぶった切っちゃうけど、
# all relevant declarations are preceded by "/**/" on a line by itself
/^\/\*\*\/$/ {
# The declaration is on following lines. The interesting part might
# be terminated by a `{' (`int foo(void) { }' or `int bar[] = {')
# or `;' (`int x;').
とあるので/**/
がマーカーだという推測は正しかった模様。
具体的にどういう操作をしているのかはなんとなーくわかるけど、書かれている正規表現読み解くの気が進まないな(笑)
Hugo メモ
86.0 がリリースされたので一気に上げた (マイナーバージョンが0のものをでたばかりで使うのはちょっと怖いが😄)
PS C:\Users\kbk> hugo version
Hugo Static Site Generator v0.80.0/extended windows/amd64 BuildDate: unknown
(裏で実行ファイル置き換え)
PS C:\Users\kbk> hugo version
hugo v0.86.0-41C6C52E+extended windows/amd64 BuildDate=2021-07-21T09:53:14Z VendorInfo=gohugoio
PS C:\Users\kbk>
起動時のメッセージも微妙に変わっているっぽい?
銀河の歴史がまた一ページ
宇宙暦640年7月22日04:30 銀河帝国軍遠征部隊は消滅した。参加将兵440万8000人のうち、生還率はわずかに8.3%であった。自由惑星同盟軍の生還者は250万人中234万で、提督の戦死者はなかった。#ダゴン星域会戦 #外伝5巻
— 今日は何の日@銀英伝bot (@logh_today) July 21, 2021