Ariel, many thanks for your patch!

best wishes
Mark

ariel mastracchio wrote:
> Hi,
>   First, sorry for my english.  I found some problem
> cfservd.c hanging when running with no-root user and
> cfagent, with other too:
> 
> cfagent - user x   (remote copy file x.x from cfservd)
> cfservd (other machine) - user xx
> 
> when cfagent try download x.x from cfservd and the
> permission are not read for 'others' cfservd (or
> cfagent) hang with the following meesage:
> 
> "Caller x is not the owner of the file"
> 
> and then hang.
> 
> i found in the cfservd.c code that the error is never
> sent to the client, so that line is incorrect
> (probably the call to 'RefuseAccess') :
> 
> (...)
>            Debug("Caller %s is not the owner of the
> file\n",(args->connect)->username);
> !         
> RefuseAccess(args->connect,sendbuffer,args->buf_size,"");
>            return;
> (...)           
> 
> so the patch i made is :
> 
> *** cfengine-2.2.1/src/cfservd.c        Wed Apr  4
> 02:42:17 2007
> --- cfengine-2.2.1/src/cfservd.c.new    Wed Sep 12
> 11:51:01 2007
> ***************
> *** 2851,2857 ****
>         else
>            {
>            Debug("Caller %s is not the owner of the
> file\n",(args->connect)->username);
> !         
> RefuseAccess(args->connect,sendbuffer,args->buf_size,"");
>            return;
>            }
>         }
> --- 2851,2862 ----
>         else
>            {
>            Debug("Caller %s is not the owner of the
> file\n",(args->connect)->username);
> ! //        
> RefuseAccess(args->connect,sendbuffer,args->buf_size,"");
> !          snprintf(sendbuffer,CF_BUFSIZE,"Open error
> of file [%s]\n",filename);
> !          CfLog(cferror,sendbuffer,"open");
> !         
> snprintf(sendbuffer,CF_BUFSIZE,"%s",CF_FAILEDSTR);
> !         
> SendSocketStream(sd,sendbuffer,args->buf_size,0);
> !
>            return;
>            }
>         }
> 
> So, when the file is requested from cfagent, cfservd
> report the error and the remote cfagent can continue
> downloading other files or exit.
> 
> hugs
> 
> 
> 
> 
> 
>        
> ____________________________________________________________________________________
> Need a vacation? Get great deals
> to amazing places on Yahoo! Travel.
> http://travel.yahoo.com/
> _______________________________________________
> Bug-cfengine mailing list
> [email protected]
> https://cfengine.org/mailman/listinfo/bug-cfengine

-- 
Mark Burgess

Professor of Network and System Administration
Oslo University College

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Work: +47 22453272            Email:  [EMAIL PROTECTED]
Fax : +47 22453205            WWW  :  http://www.iu.hio.no/~mark
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_______________________________________________
Bug-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/bug-cfengine

Reply via email to