<i>[file readable/writable] broken on W2K (CVS HEAD)</i> status still Open with 4 other changes
by
.
D 2003-12-09T18:46:14
J icomment Logged\sIn:\sYES\s\nuser_id=143885\n\nHi\sVince,\n\nSure,\shere\sis\ssome\sextended\scommentary\son\sthe\sscript.\nNote\sthat\sI\sam\snot\ssure\sat\sall\show\sportable\sthis\sis\sor\ncan\sbe\smade.\s\sThis\srelies\son\scommand-line\stools\sand\nespecially\slocalization\scan\smake\sinteraction\swith\ncommand-line\stools\svery\sugly\son\sWindows.\s\sIn\saddition\nthe\scacls\stool\sis\svery\stricky,\sand\ssome\sof\sthe\sproblem\nI\shave\shad\smay\sjust\sbe\sbugs,\swhich\smay\sbe\sfixed\slater.\n\n\n>\sproc\scacls\s{fname\sargs}\s{\n\nA\ssmall\sproc\sto\sencapsulate\sthe\sNT\scacls\scommand-line\ntool.\s\sA\s"y"\sis\spiped\sinto\sthe\scommand\sto\scover\sa\npossible\squestion\sfor\sconfirmation.\s\sOnly\sone\s"y",\sso\nonly\sone\sfile\scan\sbe\sgiven,\sI\sthink.\n\nSee\sthe\soutput\sof\scacls\s/?\son\sa\scommand\sprompt\sfor\sall\nI\sknow\sabout\scacls.\s\n\nI'm\snot\ssure\show\sportable\sthis\sis\sto\sXP.\s\sThe\stool\sis\nalso\sprobably\slocalized\sfor\snon-english\ssystems.\n\n>\sproc\sgetuser\s{fname}\s{\n\nParses\sthe\soutput\sof\sthe\s"dir/q"\scommand\sto\sfind\sthe\nowner\sof\sa\sfile.\s\sI\shaven't\sfound\sa\sspecialized\stool\nfor\sthis\sand\scacls\sdoesn't\ssay\seither.\n\n>\sproc\stest_read\s{fname}\s{\n\nA\stest\sfor\sreadablity\sby\sactually\sreading\sthe\sfile.\s\n\n>\sproc\stest_writ\s{fname}\s{\n\nA\stest\sfor\swritability\sby\sactually\swriting\sthe\sfile\n(overwrites\sthe\scontents).\n\n>\sproc\stest_access\s{fname\sread\swrit}\s{\n\nTest\sthe\sreadablilty\sand\swritability\sof\sa\sfile.\s\sOutput\nto\sstdout,\sif\sa\stest\sdoes\snot\sagree\swith\sthe\sparameters\n"read"\sor\s"writ".\s\sThis\stests\swith\s[file\nreadable/writable]\sas\swell\sas\swith\s[test_read]\sand\ntest_writ].\s\sIf\sany\sdifferences\sbetween\sthe\stest\sand\nthe\sgiven\sparameters\sare\sdetected,\scacls\sis\scalled\sat\nthe\send\sto\soutput\sthe\sactual\srights\sof\sthe\sfile\sfor\ndiagnosis.\n\nSee\scalls\sin\s[test]\sbelow.\n\n\n>\sproc\stest\s{}\s{\n\nA\sbunch\sof\sactual\stest\sscenarios.\s\n\n>\sset\sowner\s[getuser\s$fname]\n>\sset\suser\s$::env(USERDOMAIN)\\$::env(USERNAME)\n>\sputs\s"Owner:\s$owner"\n>\sputs\s"User:\s$user"\n\nDetermine\sand\sprint\swhat\swe\sknow\sabout\suser\sand\sfile\nowner.\n\n>\s#\sClean\sout\sall\swell-known\sACLs\n>\scatch\s{cacls\s$fname\s/E\s/R\s"Everyone"}\sresult\n>\scatch\s{cacls\s$fname\s/E\s/R\s$user}\sresult\n>\scatch\s{cacls\s$fname\s/E\s/R\s$owner}\sresult\n\nRemove\sall\sACLs\sthat\sare\sknown\sto\sbe\sadded\nautomatically\sto\snew\sfiles.\s\n\n>\sputs\s"\nTest\sno\saccess"\n>\stest_access\s$fname\s0\s0\n\nWithout\sACLs\sthere\sshould\sbe\sno\saccess.\s\n\n>\sputs\s"\nTest\sreadable\sonly"\n>\scacls\s$fname\s/E\s/G\s$user:R\n>\stest_access\s$fname\s1\s0\n\nAdd\sGENERIC_READ\sACL\sfor\scurrent\suser.\s\sNow\sthere\nshould\sbe\sonly\sread\saccess.\s\n\n>\sputs\s"\nTest\swritable\sonly"\n>\scatch\s{cacls\s$fname\s/E\s/R\s$user}\sresult\n>\scacls\s$fname\s/E\s/G\s$user:W\n>\stest_access\s$fname\s0\s1\n\nRemove\sACL\sfor\scurrent\suser.\s\sAdd\sGENERIC_WRITE\sACL.\nNow\sthere\sshould\sbe\sonly\swrite\saccess.\n\n>\sputs\s"\nTest\sread+write"\n>\scatch\s{cacls\s$fname\s/E\s/R\s$user}\sresult\n>\scacls\s$fname\s/E\s/G\s$user:R\n>\scacls\s$fname\s/E\s/G\s$user:W\n>\stest_access\s$fname\s1\s1\n\nRemove\sACL\sfor\scurrent\suser.\s\sAdd\sGENERIC_READ\sACL\sand\nGENERIC_WRITE\sACL.\s\sNow\sthere\sshould\sbe\sboth\sread\sand\nwrite\saccess.\n\n>\sputs\s"\nTest\sfull\saccess"\n>\scatch\s{cacls\s$fname\s/E\s/R\s$user}\sresult\n>\scacls\s$fname\s/E\s/G\s$user:F\n>\stest_access\s$fname\s1\s1\n\nRemove\sACL\sfor\scurrent\suser.\s\sAdd\sGENERIC_ALL\s(full)\nACL.\s\sThere\sshould\sbe\sboth\sread\sand\swrite\saccess.\n\n\nTo\syour\stest\srun:\n\n>\sOwner:\sTURINGVinceD\n>\sUser:\sTURINGVinceD\n\nSo\syou\sare\suser\sTURINGVinceD\s(where\sdid\sthat\sbackslash\ngo?)\sand\syou\sown\sthe\sfile\syourself.\n\n>\sTest\sno\saccess\n>\s0\s!=\s[file\sreadable\stest.dat]\n>\s0\s!=\s[test_read\stest.dat]\n>\s0\s!=\s[file\swritable\stest.dat]\n>\s0\s!=\s[test_writ\stest.dat]\n>\sActual\srights\sare:\n>\sC:Documents\sand\sSettingsVinceDest.dat\sNT\sAUTHORITYSYSTEM:F\s\n>\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\n>\sBUILTINAdministrators:F\n\nWe\shave\sa\sproblem\shere,\sbecause\s"System"\sand\sthe\n"Administrators"\sstill\shave\sfull\saccess,\sand\sthat\naccess\sseems\sto\sbe\sused\sfor\sthe\stests.\s\sCan\syou\stry\nthis\sto\sadd\sto\sall\soccurrences\sof\n\ncatch\s{cacls\s$fname\s/E\s/R\s$user}\sresult\n\nalso\sthis\srule:\n\ncacls\s$fname\s/E\s/P\s$user:N\n\nThat\sadds\san\sexplicit\sACL\sto\sdeny\saccess\sfor\sthe\ncurrent\suser.\n\nbenny\n\n
J login cc_benny
J mimetype text/plain
J username cc_benny
K 855923ffffffffffffffffffffffffffffffffff
U cc_benny
Z 7da3bd3db6c09e63ab8a8e23587f75ea