+ Post New Thread
Results 1 to 6 of 6
Internet Related/Filtering/Firewall Thread, dansguardian & webmin issue in Technical; An odd issue with DG webmin (Webmin Module Version 0.7.0beta1b). I can view/edit a groups filter list, click on the ...
  1. #1

    Join Date
    Oct 2008
    Posts
    214
    Thank Post
    2
    Thanked 11 Times in 11 Posts
    Rep Power
    22

    dansguardian & webmin issue

    An odd issue with DG webmin (Webmin Module Version 0.7.0beta1b). I can view/edit a groups filter list, click on the appropriate group and click on the relevent list file (such as /etc/dansguardian/lists/bannedsitelist) this will then allow me to add a site and save as appropriate.

    However. If I state a different file in the base configuration of a particular group - such as pointing "Exception site (domain) list" to say /etc/dansguardian/lists/pupilsexceptionsitelist then I cannot edit this file in webmin. I simply get "You are not authorized to change this file - you will be limited to only viewing this file Expected location: /etc/dansguardian/lists/pupilsexceptionsitelist"

    The lists work in DG - they act as exceptions just like I assumed they would but I would like to edit them in webmin rather than drop to putty.

    I initially thought permissions, so I did an ls -l on the "lists directory" but that didnt help:

    -rwxr-xr-x 1 root root 5285 2009-11-17 15:50 bannedsitelist (works and can be edited in webmin)
    -rwxr-xr-x 1 root root 1458 2010-01-13 14:48 pupilsexceptionsitelist (works as a filterlist but cannot be edited in webmin)

    I must be missing something but i'm darned if I know what. Any ideas?

  2. #2

    Join Date
    Oct 2010
    Posts
    2
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    Did you ever resolve this?

    James.

  3. #3

    Join Date
    Oct 2008
    Posts
    214
    Thank Post
    2
    Thanked 11 Times in 11 Posts
    Rep Power
    22
    No. I have a feeling that webmin has some kind of template and wont let you edit files outside of the template. Annoying as I cant set up webmin for trusted teachers. In the end I just live with it and use putty for those files.

  4. #4

    Join Date
    Oct 2010
    Posts
    2
    Thank Post
    0
    Thanked 1 Time in 1 Post
    Rep Power
    0
    I did a bit of a dirty work around by editing the webmin module to circumvent the error checking of file access/permissions.

    I edited this file:
    ************************************************** *************************************
    /usr/libexec/webmin/dansguardian/dansguardian-lib.pl
    ************************************************** *************************************

    Then found this section:
    ************************************************** *************************************
    ##############
    sub accessfile
    ##############
    {
    # does the user have permission to modify this file?
    my ($filepath) = @_;
    ($filepath =~ m{\b([^/.]+?)(f\d+)?\.(conf|20\d+)$}) || ($filepath =~ m{\b([^/.]+?)(f\d+)?$});
    my $listname = $1;
    my $group = $2;
    $group = 'local' if ($filepath =~ m/\blocal\b/);
    $group = 'f0' if ! $group;

    (my $branch) = ($filepath =~ m/\b(blacklists|phraselists|authplugins|contentscann ers|downloadmanagers)/);
    return 0 if ((! $branch) && (! $listname) && (! $group)); # parse failure, wha??? return failure
    $listname = 'conf' if $listname eq 'dansguardian';
    $listname = $branch if ($branch && (! exists($basefilepermissions{$listname})));
    $listname = 'picsfile' if $listname eq 'pics';
    $listname =~ s/list.*$/list/ if $listname ne $branch; # truncate filenames only, not directory names

    if (exists $basefilepermissions{$listname}) {
    return 1 if $access{$basefilepermissions{$listname}};
    } else {
    return 1 if ($access{$listname} && $access{$group});
    }
    return 0;
    }
    ************************************************** *************************************

    and changed the final "return 0;" to "return 1;" this basically overrides all file access error checking. Yes it is a messy fix but now I can edit my files in webmin. I am sure some time down the road this will come back to haunt me but for now all I care about is that I can edit my DG files via webmin. I think whole issue is due to having webmin and DG running as a different users.

    James.

  5. Thanks to jamesjweg from:

    KK20 (8th November 2010)

  6. #5

    Join Date
    Oct 2008
    Posts
    214
    Thank Post
    2
    Thanked 11 Times in 11 Posts
    Rep Power
    22
    hah! im used to bodging things, no idea why I didnt think of this. Good work (my files were in /usr/share/webmin/dansguardian/ just in case other people have difficulty finding it)

  7. #6

    Join Date
    Nov 2011
    Location
    Canaan, NH, USA
    Posts
    1
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Thank you for this! In my case I had installed webmin under the same parent directory as MacPorts, so the file path was /opt/local/webmin/dansguardian/dansguardian-lib.pl Anyway, your method totally worked. Thank you again!

    -- MB

    Quote Originally Posted by jamesjweg View Post
    I did a bit of a dirty work around by editing the webmin module to circumvent the error checking of file access/permissions.

    I edited this file:
    ************************************************** *************************************
    /usr/libexec/webmin/dansguardian/dansguardian-lib.pl
    ************************************************** *************************************

    Then found this section:
    ************************************************** *************************************
    ##############
    sub accessfile
    ##############
    {
    # does the user have permission to modify this file?
    my ($filepath) = @_;
    ($filepath =~ m{\b([^/.]+?)(f\d+)?\.(conf|20\d+)$}) || ($filepath =~ m{\b([^/.]+?)(f\d+)?$});
    my $listname = $1;
    my $group = $2;
    $group = 'local' if ($filepath =~ m/\blocal\b/);
    $group = 'f0' if ! $group;

    (my $branch) = ($filepath =~ m/\b(blacklists|phraselists|authplugins|contentscann ers|downloadmanagers)/);
    return 0 if ((! $branch) && (! $listname) && (! $group)); # parse failure, wha??? return failure
    $listname = 'conf' if $listname eq 'dansguardian';
    $listname = $branch if ($branch && (! exists($basefilepermissions{$listname})));
    $listname = 'picsfile' if $listname eq 'pics';
    $listname =~ s/list.*$/list/ if $listname ne $branch; # truncate filenames only, not directory names

    if (exists $basefilepermissions{$listname}) {
    return 1 if $access{$basefilepermissions{$listname}};
    } else {
    return 1 if ($access{$listname} && $access{$group});
    }
    return 0;
    }
    ************************************************** *************************************

    and changed the final "return 0;" to "return 1;" this basically overrides all file access error checking. Yes it is a messy fix but now I can edit my files in webmin. I am sure some time down the road this will come back to haunt me but for now all I care about is that I can edit my DG files via webmin. I think whole issue is due to having webmin and DG running as a different users.

    James.

SHARE:
+ Post New Thread

Similar Threads

  1. Samsung Webmin Password.. Needs reseting
    By burgemaster in forum Windows
    Replies: 25
    Last Post: 5th June 2013, 08:28 PM
  2. Dansguardian, NTLM & security groups
    By j17sparky in forum Internet Related/Filtering/Firewall
    Replies: 3
    Last Post: 21st September 2009, 02:53 PM
  3. !!HELP!! Static IP & LAN Issue
    By Kamran7860 in forum Windows 7
    Replies: 8
    Last Post: 11th May 2009, 08:24 PM
  4. Replies: 1
    Last Post: 31st March 2009, 10:01 PM
  5. help with webmin
    By alonebfg in forum *nix
    Replies: 4
    Last Post: 8th November 2007, 07:46 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •