瀏覽代碼

* Add extra check for owner of tty

git-svn-id: trunk@2202 -
daniel 19 年之前
父節點
當前提交
155b36dc87
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      utils/grab_vcsa.pp

+ 3 - 0
utils/grab_vcsa.pp

@@ -56,6 +56,7 @@ const   result_success=0;
         result_stat_error=2;
         result_chown_error=3;
         result_chmod_error=4;
+        result_not_owner_error=5;
 
 var thistty:string;
     vcs,vcsa:string;
@@ -74,6 +75,8 @@ begin
           {We are running on the Linux console}
           if fpstat(thistty,ttystat)<>0 then
             halt(result_stat_error);
+          if ttystat.uid<>fpgetuid then
+            halt(result_not_owner_error);
           vcs:='/dev/vcs'+copy(thistty,9,255);
           vcsa:='/dev/vcsa'+copy(thistty,9,255);